diff options
Diffstat (limited to 'src/leap')
-rw-r--r-- | src/leap/app.py | 1 | ||||
-rw-r--r-- | src/leap/gui/mainwindow.py | 20 | ||||
-rw-r--r-- | src/leap/services/eip/vpnlaunchers.py | 8 | ||||
-rw-r--r-- | src/leap/services/eip/vpnprocess.py | 2 | ||||
-rw-r--r-- | src/leap/util/keyring_helpers.py | 6 |
5 files changed, 28 insertions, 9 deletions
diff --git a/src/leap/app.py b/src/leap/app.py index cb9951c1..0ee78310 100644 --- a/src/leap/app.py +++ b/src/leap/app.py @@ -151,7 +151,6 @@ def main(): lambda: twisted_main.quit(app), standalone=standalone, bypass_checks=bypass_checks) - window.show() sigint_window = partial(sigint_handler, window, logger=logger) signal.signal(signal.SIGINT, sigint_window) diff --git a/src/leap/gui/mainwindow.py b/src/leap/gui/mainwindow.py index 94343292..5e7965dd 100644 --- a/src/leap/gui/mainwindow.py +++ b/src/leap/gui/mainwindow.py @@ -439,7 +439,6 @@ class MainWindow(QtGui.QMainWindow): self._login_widget.set_user(possible_username) if possible_password is not None: self._login_widget.set_password(possible_password) - self._login_widget.set_remember(has_keyring()) self._login() self._wizard = None self._settings.set_properprovider(True) @@ -514,15 +513,26 @@ class MainWindow(QtGui.QMainWindow): if self._systray is not None: self._systray.setVisible(True) return + + # Placeholder actions + # They are temporary to display the tray as designed + preferences_action = QtGui.QAction(self.tr("Preferences"), self) + preferences_action.setEnabled(False) + help_action = QtGui.QAction(self.tr("Help"), self) + help_action.setEnabled(False) + systrayMenu = QtGui.QMenu(self) systrayMenu.addAction(self._action_visible) - systrayMenu.addAction(self.ui.action_sign_out) - systrayMenu.addSeparator() - systrayMenu.addAction(self.ui.action_quit) systrayMenu.addSeparator() systrayMenu.addAction(self._action_eip_provider) systrayMenu.addAction(self._action_eip_status) systrayMenu.addAction(self._action_eip_startstop) + systrayMenu.addSeparator() + systrayMenu.addAction(preferences_action) + systrayMenu.addAction(help_action) + systrayMenu.addSeparator() + systrayMenu.addAction(self.ui.action_sign_out) + systrayMenu.addAction(self.ui.action_quit) self._systray = QtGui.QSystemTrayIcon(self) self._systray.setContextMenu(systrayMenu) self._systray.setIcon(self._status_panel.ERROR_ICON) @@ -1006,7 +1016,7 @@ class MainWindow(QtGui.QMainWindow): error=True) self._set_eipstatus_off() except VPNLauncherException as e: - self._status_panel.set_gloal_status("%s" % (e,), error=True) + self._status_panel.set_global_status("%s" % (e,), error=True) self._set_eipstatus_off() else: self._already_started_eip = True diff --git a/src/leap/services/eip/vpnlaunchers.py b/src/leap/services/eip/vpnlaunchers.py index 570a7893..3cee9bbb 100644 --- a/src/leap/services/eip/vpnlaunchers.py +++ b/src/leap/services/eip/vpnlaunchers.py @@ -324,7 +324,9 @@ class LinuxVPNLauncher(VPNLauncher): look for openvpn in the regular paths and algo in path_prefix/apps/eip/ (in case standalone is set) - Might raise VPNException. + Might raise: + VPNLauncherException, + OpenVPNNotFoundException. :param eipconfig: eip configuration object :type eipconfig: EIPConfig @@ -373,6 +375,10 @@ class LinuxVPNLauncher(VPNLauncher): gateway_selector = VPNGatewaySelector(eipconfig) gateways = gateway_selector.get_gateways() + if not gateways: + logger.error('No gateway was found!') + raise VPNLauncherException(self.tr('No gateway was found!')) + logger.debug("Using gateways ips: {}".format(', '.join(gateways))) for gw in gateways: diff --git a/src/leap/services/eip/vpnprocess.py b/src/leap/services/eip/vpnprocess.py index 0ec56ae7..cbf554da 100644 --- a/src/leap/services/eip/vpnprocess.py +++ b/src/leap/services/eip/vpnprocess.py @@ -698,6 +698,8 @@ class VPNProcess(protocol.ProcessProtocol, VPNManager): def getCommand(self): """ Gets the vpn command from the aproppriate launcher. + + Might throw: VPNLauncherException, OpenVPNNotFoundException. """ cmd = self._launcher.get_vpn_command( eipconfig=self._eipconfig, diff --git a/src/leap/util/keyring_helpers.py b/src/leap/util/keyring_helpers.py index b815d385..8f354f28 100644 --- a/src/leap/util/keyring_helpers.py +++ b/src/leap/util/keyring_helpers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# privilege_policies.py +# keyring_helpers.py # Copyright (C) 2013 LEAP # # This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. """ - +Keyring helpers. """ import keyring @@ -29,7 +29,9 @@ OBSOLETE_KEYRINGS = [ def has_keyring(): """ + Returns whether we have an useful keyring to use. + :rtype: bool """ kr = keyring.get_keyring() return kr is not None and kr.__class__ not in OBSOLETE_KEYRINGS |