summaryrefslogtreecommitdiff
path: root/src/leap/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/gui')
-rw-r--r--src/leap/gui/mainwindow.py23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/leap/gui/mainwindow.py b/src/leap/gui/mainwindow.py
index fa49c55d..ea5bca1a 100644
--- a/src/leap/gui/mainwindow.py
+++ b/src/leap/gui/mainwindow.py
@@ -258,6 +258,8 @@ class MainWindow(QtGui.QMainWindow):
self._soledad = None
self._keymanager = None
+ self._login_defer = None
+
self._smtp_config = SMTPConfig()
if self._first_run():
@@ -725,10 +727,7 @@ class MainWindow(QtGui.QMainWindow):
self._srp_auth.logout_finished.connect(
self._done_logging_out)
- auth_partial = partial(self._srp_auth.authenticate,
- username,
- password)
- threads.deferToThread(auth_partial)
+ self._login_defer = self._srp_auth.authenticate(username, password)
else:
self._set_status(data[self._provider_bootstrapper.ERROR_KEY])
self._login_set_enabled(True)
@@ -748,6 +747,7 @@ class MainWindow(QtGui.QMainWindow):
# "Succeeded" message and then we switch to the EIP status
# panel
QtCore.QTimer.singleShot(1000, self._switch_to_status)
+ self._login_defer = None
else:
self._login_set_enabled(True)
@@ -880,12 +880,24 @@ class MainWindow(QtGui.QMainWindow):
return host, port
def _start_eip(self):
+ """
+ SLOT
+ TRIGGERS:
+ self.ui.btnEipStartStop.clicked
+ self._action_eip_startstop.triggered
+ or called from _finish_eip_bootstrap
+
+ Starts EIP
+ """
try:
host, port = self._get_socket_host()
self._vpn.start(eipconfig=self._eip_config,
providerconfig=self._provider_config,
socket_host=host,
socket_port=port)
+
+ self._settings.set_defaultprovider(
+ self._provider_config.get_domain())
self.ui.btnEipStartStop.setText(self.tr("Turn Encryption OFF"))
self.ui.btnEipStartStop.disconnect(self)
self.ui.btnEipStartStop.clicked.connect(
@@ -1162,6 +1174,9 @@ class MainWindow(QtGui.QMainWindow):
self.close()
+ if self._login_defer:
+ self._login_defer.cancel()
+
if self._quit_callback:
self._quit_callback()
logger.debug('Bye.')