Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Fix 80 #81

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
28118b6
Renamed main folder to app
calexandru2018 Jun 5, 2020
551094b
Updated to main package name 'app'
calexandru2018 Jun 5, 2020
982b329
Updated path to resources since main package name has been changed
calexandru2018 Jun 5, 2020
347df53
Main entry file has been renamed
calexandru2018 Jun 5, 2020
b7726ff
Updated github path
calexandru2018 Jun 5, 2020
656eef5
Created variables that hold common information messages that are disp…
calexandru2018 Jun 5, 2020
3c192bf
Replaced by the constant app_name
calexandru2018 Jun 5, 2020
57f7a17
Updated url path to a constant
calexandru2018 Jun 5, 2020
2de054a
Updated app name and repo url to respetive constants
calexandru2018 Jun 5, 2020
202a60e
Updated package name and repo till to respectinve constants in setup
calexandru2018 Jun 5, 2020
8279bc6
Updated main package name
calexandru2018 Jun 5, 2020
a4925f0
Updated string so that 'admin access' instead of 'privilege escalation'
calexandru2018 Jun 5, 2020
7482746
Removed code duplication
calexandru2018 Jun 5, 2020
b99c0a3
Updated short description in case readme is not found
calexandru2018 Jun 5, 2020
16ac3de
Updated readme text
calexandru2018 Jun 5, 2020
1c0e9a0
Removed unnecessary dependency
calexandru2018 Jun 5, 2020
220203e
Added 'self.' prefix to class properties
calexandru2018 Jun 5, 2020
e3152bb
Updated to new app name
calexandru2018 Jun 17, 2020
cffdb47
Typo (#86)
arch-btw Jun 19, 2020
338c91f
Fix grammar and spelling mistakes in README.md (#91)
SandaruLJ Jun 28, 2020
f77a01b
Renamed main folder to app
calexandru2018 Jun 5, 2020
28d913d
Updated to main package name 'app'
calexandru2018 Jun 5, 2020
e81215d
Updated path to resources since main package name has been changed
calexandru2018 Jun 5, 2020
8c32b3f
Main entry file has been renamed
calexandru2018 Jun 5, 2020
f84f9dc
Updated github path
calexandru2018 Jun 5, 2020
d5402fa
Created variables that hold common information messages that are disp…
calexandru2018 Jun 5, 2020
76b6324
Replaced by the constant app_name
calexandru2018 Jun 5, 2020
8e3d2c4
Updated url path to a constant
calexandru2018 Jun 5, 2020
1dc5314
Updated app name and repo url to respetive constants
calexandru2018 Jun 5, 2020
330caa1
Updated package name and repo till to respectinve constants in setup
calexandru2018 Jun 5, 2020
68216ef
Updated main package name
calexandru2018 Jun 5, 2020
92166ff
Updated string so that 'admin access' instead of 'privilege escalation'
calexandru2018 Jun 5, 2020
f623cdd
Removed code duplication
calexandru2018 Jun 5, 2020
d11e731
Updated short description in case readme is not found
calexandru2018 Jun 5, 2020
8757cf9
Updated readme text
calexandru2018 Jun 5, 2020
3c9d590
Removed unnecessary dependency
calexandru2018 Jun 5, 2020
46c9e4e
Added 'self.' prefix to class properties
calexandru2018 Jun 5, 2020
9dd0d19
Updated to new app name
calexandru2018 Jun 17, 2020
30d743f
Merge branch 'fix-80' of github.com:ProtonVPN/linux-gui into fix-80
calexandru2018 Jun 29, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 6 additions & 6 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include protonvpn_linux_gui/resources/ui/*.glade
include protonvpn_linux_gui/resources/styles/*.css
include protonvpn_linux_gui/resources/img/logo/*.png
include protonvpn_linux_gui/resources/img/utils/*.png
include protonvpn_linux_gui/resources/img/flags/large/*.jpg
include protonvpn_linux_gui/resources/img/flags/small/*.png
include app/resources/ui/*.glade
include app/resources/styles/*.css
include app/resources/img/logo/*.png
include app/resources/img/utils/*.png
include app/resources/img/flags/large/*.jpg
include app/resources/img/flags/small/*.png
123 changes: 61 additions & 62 deletions README.md

Large diffs are not rendered by default.

File renamed without changes.
4 changes: 3 additions & 1 deletion linux_gui/constants.py → app/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
USER = getpass.getuser()

VERSION = "2.1.0"
GITHUB_URL_RELEASE = "https://github.com/ProtonVPN/linux-gui/releases/latest"
APP_NAME = "protonvpn-app"
GITHUB_URL = "https://github.com/ProtonVPN/linux-app"
GITHUB_URL_RELEASE = GITHUB_URL+"/releases/latest"

# GUI configurations
GUI_CONFIG_DIR = os.path.join(os.path.expanduser("~{0}".format(USER)), ".pvpn-gui")
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion linux_gui/indicator.py → app/indicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
TRAY_CFG_DATA_TX,
TRAY_CFG_TIME_CONN,
CURRDIR,
APP_NAME
)
from .utils import get_gui_config, set_gui_config

Expand Down Expand Up @@ -257,7 +258,7 @@ def show_gui(self, _):

self.notify.Notification.new(self.tray_title, "Displaying ProtonVPN GUI", LOGO_PATH).show()

process = subprocess.Popen(["protonvpn-gui"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) # nosec
process = subprocess.Popen([APP_NAME], stdout=subprocess.PIPE, stderr=subprocess.PIPE) # nosec
outs, errs = process.communicate()

gui_logger.debug("TRAY >>> errs: {}\nouts:{}".format(outs, errs))
Expand Down
58 changes: 22 additions & 36 deletions linux_gui/protonvpn_gui.py → app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,41 +72,27 @@ def init():
)

dialog_view = DialogView(interface, Gtk, queue)

if not find_cli():
dialog_view.display_dialog(label=CLI_ABSENCE_INFO, spinner=False, hide_close_button=True)
else:
gui_logger.debug("\n______________________________________\n\n\tINITIALIZING NEW GUI WINDOW\n______________________________________\n")

if not os.path.isfile(GUI_CONFIG_FILE):
initialize_gui_config()

if not os.path.isfile(CONFIG_FILE):
gui_logger.debug(">>> Loading LoginWindow")

settings_service = SettingsService()
settings_presenter = SettingsPresenter(settings_service, queue)
settings_view = SettingsView(interface, Gtk, settings_presenter, queue)

dashboard_service = DashboardService()
dashboard_presenter = DashboardPresenter(dashboard_service, queue)
dashboard_view = DashboardView(interface, Gtk, dashboard_presenter, settings_view, queue)

login_service = LoginService()
login_presenter = LoginPresenter(login_service, queue)
login_view = LoginView(interface, Gtk, login_presenter, dashboard_view, queue)

login_view.display_window()
else:
gui_logger.debug(">>> Loading DashboardWindow")
settings_service = SettingsService()
settings_presenter = SettingsPresenter(settings_service, queue)
settings_view = SettingsView(interface, Gtk, settings_presenter, queue)

dashboard_service = DashboardService()
dashboard_presenter = DashboardPresenter(dashboard_service, queue)
dashboard_view = DashboardView(interface, Gtk, dashboard_presenter, settings_view, queue)

dashboard_view.display_window()

gui_logger.debug("\n______________________________________\n\n\tINITIALIZING NEW GUI WINDOW\n______________________________________\n")

if not os.path.isfile(GUI_CONFIG_FILE):
initialize_gui_config()

settings_service = SettingsService()
settings_presenter = SettingsPresenter(settings_service, queue)
settings_view = SettingsView(interface, Gtk, settings_presenter, queue)

dashboard_service = DashboardService()
dashboard_presenter = DashboardPresenter(dashboard_service, queue)
window_view = DashboardView(interface, Gtk, dashboard_presenter, settings_view, queue)

if not os.path.isfile(CONFIG_FILE):
gui_logger.debug(">>> Loading LoginWindow")
login_service = LoginService()
login_presenter = LoginPresenter(login_service, queue)
window_view = LoginView(interface, Gtk, login_presenter, window_view, queue)

window_view.display_window()

Gtk.main()

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

# Local imports
from ..gui_logger import gui_logger
from ..constants import GITHUB_URL_RELEASE, VERSION, LARGE_FLAGS_BASE_PATH, SMALL_FLAGS_BASE_PATH, FEATURES_BASE_PATH
from ..constants import GITHUB_URL, GITHUB_URL_RELEASE, VERSION, LARGE_FLAGS_BASE_PATH, SMALL_FLAGS_BASE_PATH, FEATURES_BASE_PATH, APP_NAME
from ..utils import (
get_server_protocol_from_cli,
get_gui_config,
Expand Down Expand Up @@ -193,9 +193,9 @@ def on_check_for_updates(self):
if VERSION < latest_release:
return_string = "There is a newer release, you should upgrade to <b>v{0}</b>.\n\n".format(latest_release)
if pip3_installed:
return_string = return_string + "You can upgrade with the following command:\n\n<b>sudo pip3 install protonvpn-linux-gui-calexandru2018 --upgrade</b>\n\n"
return_string = return_string + "You can upgrade with the following command:\n\n<b>sudo pip3 install "+APP_NAME+" --upgrade</b>\n\n"
else:
return_string = return_string + "You can upgrade by <b>first removing this version</b>, and then cloning the new one with the following commands:\n\n<b>git clone https://github.com/calexandru2018/protonvpn-linux-gui</b>\n\n<b>cd protonvpn-linux-gui</b>\n\n<b>sudo python3 setup.py install</b>"
return_string = return_string + "You can upgrade by <b>first removing this version</b>, and then cloning the new one with the following commands:\n\n<b>git clone "+GITHUB_URL+"</b>\n\n<b>cd linux-app</b>\n\n<b>sudo pip install -e .</b>"
return_val = True

self.queue.put(dict(action="update_dialog", label=return_string))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
PATH_AUTOCONNECT_SERVICE,
SERVICE_NAME,
GUI_CONFIG_DIR,
TRAY_SUDO_TYPES
TRAY_SUDO_TYPES,
GITHUB_URL
)
from ..utils import (
set_gui_config,
Expand Down Expand Up @@ -280,7 +281,7 @@ def load_general_settings(self, general_settings_dict):
sudo_info_tooltip = general_settings_dict["sudo_info_tooltip"]
setter = 0

tooltip_msg = "Could not find PolKit installed on your system. For more information, please visit: \nhttps://github.com/ProtonVPN/linux-gui"
tooltip_msg = "Could not find PolKit installed on your system. For more information, please visit: \n"+GITHUB_URL

username = get_config_value("USER", "username")
tier = int(get_config_value("USER", "tier"))
Expand All @@ -298,7 +299,7 @@ def load_general_settings(self, general_settings_dict):

polkit_support_switch.set_property('sensitive', True)
use_cases = "\n-Update username and password (root protected file)\n-Enable/disable autoconnect (create/remove .service file)\n-Connect/disconnect to/from VPN (run CLI commands)"
tooltip_msg = "Displays a window to enter sudo password, which is needed for the following cases:{}\n\nIt is recommended to enabled this if you don't want to use the GUI via the terminal.".format(use_cases)
tooltip_msg = "Displays a window to enter sudo password, which is needed for the following cases:{}\n\nIt is recommended to enabled this if you don't want to use the app via terminal.".format(use_cases)

sudo_info_tooltip.set_tooltip_text(tooltip_msg)

Expand Down
Loading