From aa969cdbc9d8d0c77b0fa0e2c72164e8cb816c87 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Tue, 19 Nov 2013 17:08:22 -0300 Subject: Disable EIP if need login before to be usable. --- src/leap/bitmask/gui/mainwindow.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/leap/bitmask/gui/mainwindow.py') diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index b0f25af1..9074df2b 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -366,6 +366,7 @@ class MainWindow(QtGui.QMainWindow): # if we don't have any provider configured (included a pinned # one) we can't use the application, so quit. self.quit() + self.eip_needs_login.emit() else: self._finish_init() @@ -574,6 +575,9 @@ class MainWindow(QtGui.QMainWindow): if possible_password is not None: self._login_widget.set_password(possible_password) self._login() + else: + self.eip_needs_login.emit() + self._wizard = None else: self._try_autostart_eip() -- cgit v1.2.3 From 307bf9e5512d3e2037078b5722f9f9c8879e5446 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Tue, 19 Nov 2013 17:13:38 -0300 Subject: Remove unused execution path. --- src/leap/bitmask/gui/mainwindow.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/leap/bitmask/gui/mainwindow.py') diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index 9074df2b..ac73e08b 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -358,17 +358,17 @@ class MainWindow(QtGui.QMainWindow): Called if the wizard has been cancelled or closed before finishing. + This is executed for the first run wizard only. Any other execution of + the wizard won't reach this point. """ - if self._wizard_firstrun: - providers = self._settings.get_configured_providers() - has_provider_on_disk = len(providers) != 0 - if not has_provider_on_disk: - # if we don't have any provider configured (included a pinned - # one) we can't use the application, so quit. - self.quit() - self.eip_needs_login.emit() - else: - self._finish_init() + providers = self._settings.get_configured_providers() + has_provider_on_disk = len(providers) != 0 + if not has_provider_on_disk: + # if we don't have any provider configured (included a pinned + # one) we can't use the application, so quit. + self.quit() + + self.eip_needs_login.emit() def _launch_wizard(self): """ @@ -539,8 +539,7 @@ class MainWindow(QtGui.QMainWindow): TRIGGERS: self._wizard.accepted - Also called at the end of the constructor if not first run, - and after _rejected_wizard if not first run. + Also called at the end of the constructor if not first run. Implements the behavior after either constructing the mainwindow object, loading the saved user/password, or after -- cgit v1.2.3 From f174d94e00b0619c4f5dfde769e76209823702a3 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Tue, 19 Nov 2013 17:30:41 -0300 Subject: Add providers even if the wizard is rejected. --- src/leap/bitmask/gui/mainwindow.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/leap/bitmask/gui/mainwindow.py') diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index ac73e08b..ce4290a4 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -367,8 +367,11 @@ class MainWindow(QtGui.QMainWindow): # if we don't have any provider configured (included a pinned # one) we can't use the application, so quit. self.quit() - - self.eip_needs_login.emit() + else: + # This happens if the user finishes the provider + # setup but does not register + self._wizard = None + self._finish_init() def _launch_wizard(self): """ -- cgit v1.2.3 From f95df925f7640537e301442a6faabbcdd282f130 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Wed, 20 Nov 2013 11:55:36 -0300 Subject: Disable the EIP start if EIP is disabled. --- src/leap/bitmask/gui/mainwindow.py | 1 + 1 file changed, 1 insertion(+) (limited to 'src/leap/bitmask/gui/mainwindow.py') diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index ce4290a4..6a1f4445 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -1455,6 +1455,7 @@ class MainWindow(QtGui.QMainWindow): self.tr("Not supported"), error=True) else: + self._eip_status.disable_eip_start() self._eip_status.set_eip_status(self.tr("Disabled")) def _finish_eip_bootstrap(self, data): -- cgit v1.2.3 From d0a19caef10e9437b9b389764bfa50f2bb1575ac Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Wed, 20 Nov 2013 11:57:22 -0300 Subject: Remove unused import. --- src/leap/bitmask/gui/mainwindow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/leap/bitmask/gui/mainwindow.py') diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index 6a1f4445..e21d6cd2 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -22,7 +22,7 @@ import os from PySide import QtCore, QtGui from twisted.internet import threads -from zope.proxy import ProxyBase, setProxiedObject, sameProxiedObjects +from zope.proxy import ProxyBase, setProxiedObject from leap.bitmask import __version__ as VERSION from leap.bitmask.config.leapsettings import LeapSettings -- cgit v1.2.3 From 897017bfdd1ab67e2662fdd6e97b980c1e5d6258 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Mon, 25 Nov 2013 17:22:52 -0300 Subject: Select the provider selected in the login widget. In the preferences window, now we select the current provider from the login widget, no matter if the user is logged in or not. [Closes #4490] --- src/leap/bitmask/gui/mainwindow.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/leap/bitmask/gui/mainwindow.py') diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index e21d6cd2..25e25e45 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -467,9 +467,9 @@ class MainWindow(QtGui.QMainWindow): Displays the preferences window. """ - preferences_window = PreferencesWindow(self, self._srp_auth, - self._provider_config, - self._soledad) + preferences_window = PreferencesWindow( + self, self._srp_auth, self._provider_config, self._soledad, + self._login_widget.get_selected_provider()) self.soledad_ready.connect(preferences_window.set_soledad_ready) preferences_window.show() -- cgit v1.2.3 From a9765e721f210301ce06da3d8bccb4fc1a275834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Fri, 29 Nov 2013 13:59:30 -0300 Subject: Properly close Soledad at quit --- src/leap/bitmask/gui/mainwindow.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/leap/bitmask/gui/mainwindow.py') diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index 25e25e45..3758bab5 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -1652,9 +1652,9 @@ class MainWindow(QtGui.QMainWindow): # XXX this can timeout after loong time: See #3368 self._srp_auth.logout() - if self._soledad: + if self._soledad_bootstrapper.soledad is not None: logger.debug("Closing soledad...") - self._soledad.close() + self._soledad_bootstrapper.soledad.close() else: logger.error("No instance of soledad was found.") -- cgit v1.2.3 From c59b6ac74dc8e9054237f28f37c9f9573c9b5713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Mon, 2 Dec 2013 13:59:37 -0300 Subject: Remove EIP has stopped message --- src/leap/bitmask/gui/mainwindow.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/leap/bitmask/gui/mainwindow.py') diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index 25e25e45..0d55040f 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -1369,8 +1369,7 @@ class MainWindow(QtGui.QMainWindow): Sets eip status to off """ # XXX this should be handled by the state machine. - self._eip_status.set_eip_status(self.tr("EIP has stopped"), - error=error) + self._eip_status.set_eip_status("", error=error) self._eip_status.set_eip_status_icon("error") def _eip_finished(self, exitCode): -- cgit v1.2.3 From d3fd07839ec873db22c1a396eaf72951f59bc2f1 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Thu, 5 Dec 2013 11:17:23 -0300 Subject: Use service name instead of hardcoded one. --- src/leap/bitmask/gui/mainwindow.py | 40 +++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'src/leap/bitmask/gui/mainwindow.py') diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index 36d3ca67..929919ac 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -44,6 +44,8 @@ from leap.bitmask.platform_init import IS_WIN, IS_MAC from leap.bitmask.platform_init.initializers import init_platform from leap.bitmask.provider.providerbootstrapper import ProviderBootstrapper +from leap.bitmask.services import get_service_display_name, EIP_SERVICE + from leap.bitmask.services.mail import conductor as mail_conductor from leap.bitmask.services import EIP_SERVICE, MX_SERVICE @@ -339,6 +341,8 @@ class MainWindow(QtGui.QMainWindow): self.start_eip_machine() self._mail_conductor.start_mail_machine() + self._eip_name = get_service_display_name(EIP_SERVICE) + if self._first_run(): self._wizard_firstrun = True self._wizard = Wizard(bypass_checks=bypass_checks) @@ -643,7 +647,8 @@ class MainWindow(QtGui.QMainWindow): systrayMenu.addAction(self._action_visible) systrayMenu.addSeparator() - eip_menu = systrayMenu.addMenu(self.tr("Encrypted Internet: OFF")) + eip_status_label = "{0}: {1}".format(self._eip_name, self.tr("OFF")) + eip_menu = systrayMenu.addMenu(eip_status_label) eip_menu.addAction(self._action_eip_startstop) self._eip_status.set_eip_status_menu(eip_menu) systrayMenu.addSeparator() @@ -1230,10 +1235,9 @@ class MainWindow(QtGui.QMainWindow): provider_config, self._eip_config, provider) if not loaded: - self._eip_status.set_eip_status( - self.tr("Could not load Encrypted Internet " - "Configuration."), - error=True) + eip_status_label = self.tr("Could not load {0} configuration.") + eip_status_label = eip_status_label.format(self._eip_name) + self._eip_status.set_eip_status(eip_status_label, error=True) # signal connection aborted to state machine qtsigs = self._eip_connection.qtsigs qtsigs.connection_aborted_signal.emit() @@ -1270,9 +1274,9 @@ class MainWindow(QtGui.QMainWindow): self._set_eipstatus_off() except EIPNoTunKextLoaded: self._eip_status.set_eip_status( - self.tr("Encrypted Internet cannot be started because " + self.tr("{0} cannot be started because " "the tuntap extension is not installed properly " - "in your system.")) + "in your system.").format(self._eip_name)) self._set_eipstatus_off() except EIPNoPkexecAvailable: self._eip_status.set_eip_status( @@ -1407,17 +1411,18 @@ class MainWindow(QtGui.QMainWindow): # XXX check if these exitCodes are pkexec/cocoasudo specific if exitCode in (126, 127): - self._eip_status.set_eip_status( - self.tr("Encrypted Internet could not be launched " - "because you did not authenticate properly."), - error=True) + eip_status_label = self.tr( + "{0} could not be launched " + "because you did not authenticate properly.") + eip_status_label = eip_status_label.format(self._eip_name) + self._eip_status.set_eip_status(eip_status_label, error=True) self._vpn.killit() signal = qtsigs.connection_aborted_signal elif exitCode != 0 or not self.user_stopped_eip: - self._eip_status.set_eip_status( - self.tr("Encrypted Internet finished in an " - "unexpected manner!"), error=True) + eip_status_label = self.tr("{0} finished in an unexpected manner!") + eip_status_label = eip_status_label.format(self._eip_name) + self._eip_status.set_eip_status(eip_status_label, error=True) signal = qtsigs.connection_died_signal if exitCode == 0 and IS_MAC: @@ -1486,10 +1491,9 @@ class MainWindow(QtGui.QMainWindow): # DO START EIP Connection! self._eip_connection.qtsigs.do_connect_signal.emit() else: - self._eip_status.set_eip_status( - self.tr("Could not load Encrypted Internet " - "Configuration."), - error=True) + eip_status_label = self.tr("Could not load {0} configuration.") + eip_status_label = eip_status_label.format(self._eip_name) + self._eip_status.set_eip_status(eip_status_label, error=True) def _eip_intermediate_stage(self, data): # TODO missing param -- cgit v1.2.3