summaryrefslogtreecommitdiff
path: root/src/leap/gui/mainwindow.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/gui/mainwindow.py')
-rw-r--r--src/leap/gui/mainwindow.py45
1 files changed, 31 insertions, 14 deletions
diff --git a/src/leap/gui/mainwindow.py b/src/leap/gui/mainwindow.py
index ed0d4652..87dd4f5c 100644
--- a/src/leap/gui/mainwindow.py
+++ b/src/leap/gui/mainwindow.py
@@ -218,8 +218,8 @@ class MainWindow(QtGui.QMainWindow):
self._vpn.qtsigs.process_finished.connect(
self._eip_finished)
- self.ui.action_sign_out.setEnabled(False)
- self.ui.action_sign_out.triggered.connect(self._logout)
+ self.ui.action_log_out.setEnabled(False)
+ self.ui.action_log_out.triggered.connect(self._logout)
self.ui.action_about_leap.triggered.connect(self._about)
self.ui.action_quit.triggered.connect(self.quit)
self.ui.action_wizard.triggered.connect(self._launch_wizard)
@@ -563,7 +563,7 @@ class MainWindow(QtGui.QMainWindow):
systrayMenu.addAction(preferences_action)
systrayMenu.addAction(help_action)
systrayMenu.addSeparator()
- systrayMenu.addAction(self.ui.action_sign_out)
+ systrayMenu.addAction(self.ui.action_log_out)
systrayMenu.addAction(self.ui.action_quit)
self._systray = QtGui.QSystemTrayIcon(self)
self._systray.setContextMenu(systrayMenu)
@@ -603,7 +603,11 @@ class MainWindow(QtGui.QMainWindow):
Toggles the window visibility
"""
- self.setVisible(not self.isVisible())
+ if not self.isVisible():
+ self.show()
+ self.raise_()
+ else:
+ self.hide()
def _center_window(self):
"""
@@ -745,11 +749,13 @@ class MainWindow(QtGui.QMainWindow):
download_if_needed=True)
else:
self._login_widget.set_status(
- self.tr("Could not load provider configuration."))
+ self.tr("Unable to login: Problem with provider"))
+ logger.error("Could not load provider configuration.")
self._login_widget.set_enabled(True)
else:
self._login_widget.set_status(
- data[self._provider_bootstrapper.ERROR_KEY])
+ self.tr("Unable to login: Problem with provider"))
+ logger.error(data[self._provider_bootstrapper.ERROR_KEY])
self._login_widget.set_enabled(True)
def _login(self):
@@ -852,7 +858,8 @@ class MainWindow(QtGui.QMainWindow):
self._login_defer = self._srp_auth.authenticate(username, password)
else:
self._login_widget.set_status(
- data[self._provider_bootstrapper.ERROR_KEY])
+ "Unable to login: Problem with provider")
+ logger.error(data[self._provider_bootstrapper.ERROR_KEY])
self._login_widget.set_enabled(True)
def _authentication_finished(self, ok, message):
@@ -863,10 +870,16 @@ class MainWindow(QtGui.QMainWindow):
Once the user is properly authenticated, try starting the EIP
service
"""
+
+ # In general we want to "filter" likely complicated error
+ # messages, but in this case, the messages make more sense as
+ # they come. Since they are "Unknown user" or "Unknown
+ # password"
self._login_widget.set_status(message, error=not ok)
+
if ok:
self._logged_user = self._login_widget.get_user()
- self.ui.action_sign_out.setEnabled(True)
+ self.ui.action_log_out.setEnabled(True)
# We leave a bit of room for the user to see the
# "Succeeded" message and then we switch to the EIP status
# panel
@@ -983,12 +996,14 @@ class MainWindow(QtGui.QMainWindow):
# TODO: Make the encrypted_only configurable
from leap.mail.smtp import setup_smtp_relay
+ client_cert = self._eip_config.get_client_cert_path(
+ self._provider_config)
setup_smtp_relay(port=1234,
keymanager=self._keymanager,
smtp_host=host,
smtp_port=port,
- smtp_username=".",
- smtp_password=".",
+ smtp_cert=client_cert,
+ smtp_key=client_cert,
encrypted_only=False)
def _get_socket_host(self):
@@ -1234,7 +1249,7 @@ class MainWindow(QtGui.QMainWindow):
def _logout(self):
"""
SLOT
- TRIGGER: self.ui.action_sign_out.triggered
+ TRIGGER: self.ui.action_log_out.triggered
Starts the logout sequence
"""
@@ -1251,7 +1266,7 @@ class MainWindow(QtGui.QMainWindow):
logging out
"""
self._logged_user = None
- self.ui.action_sign_out.setEnabled(False)
+ self.ui.action_log_out.setEnabled(False)
self.ui.stackedWidget.setCurrentIndex(self.LOGIN_INDEX)
self._login_widget.set_password("")
self._login_widget.set_enabled(True)
@@ -1275,7 +1290,8 @@ class MainWindow(QtGui.QMainWindow):
self._login_widget.set_cancel(False)
self._login_widget.set_enabled(True)
self._login_widget.set_status(
- data[self._provider_bootstrapper.ERROR_KEY])
+ self.tr("Unable to connect: Problem with provider"))
+ logger.error(data[self._provider_bootstrapper.ERROR_KEY])
def _eip_intermediate_stage(self, data):
"""
@@ -1290,7 +1306,8 @@ class MainWindow(QtGui.QMainWindow):
passed = data[self._provider_bootstrapper.PASSED_KEY]
if not passed:
self._login_widget.set_status(
- data[self._provider_bootstrapper.ERROR_KEY])
+ self.tr("Unable to connect: Problem with provider"))
+ logger.error(data[self._provider_bootstrapper.ERROR_KEY])
self._already_started_eip = False
def _eip_finished(self, exitCode):