diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-06-06 11:39:57 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-06-06 11:41:55 -0300 |
commit | 40c1190ad556aee33d1b90a9c234b36ad0759861 (patch) | |
tree | ebb2f4f27e71fb459fccd8444a59618410814631 /src/leap/gui/mainwindow.py | |
parent | 269f6535fb468ab6789d3efef27c272178e31395 (diff) |
Make the login process more granular with defers
Diffstat (limited to 'src/leap/gui/mainwindow.py')
-rw-r--r-- | src/leap/gui/mainwindow.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/leap/gui/mainwindow.py b/src/leap/gui/mainwindow.py index f9e088a7..c892cadd 100644 --- a/src/leap/gui/mainwindow.py +++ b/src/leap/gui/mainwindow.py @@ -259,6 +259,8 @@ class MainWindow(QtGui.QMainWindow): self._soledad = None self._keymanager = None + self._login_defer = None + self._smtp_config = SMTPConfig() if self._first_run(): @@ -733,10 +735,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) @@ -756,6 +755,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) @@ -1172,6 +1172,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.') |