summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui/mainwindow.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-03-07 20:10:19 -0300
committerTomás Touceda <chiiph@leap.se>2014-03-07 20:10:19 -0300
commit92290fa7df14fd6282b362dba39b01c562a5725c (patch)
tree1e28404524718f6d38715ab949fc14a8f22d7887 /src/leap/bitmask/gui/mainwindow.py
parent399d1874fb86e72600d396cdbc64b2209eee96a0 (diff)
parentf274193b30cbe28f75a976b0fd5710f06c2c9c49 (diff)
Merge remote-tracking branch 'refs/remotes/ivan/feature/centralized-defer-cancel' into develop
Diffstat (limited to 'src/leap/bitmask/gui/mainwindow.py')
-rw-r--r--src/leap/bitmask/gui/mainwindow.py26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py
index 7b2592a9..5dc9b0f3 100644
--- a/src/leap/bitmask/gui/mainwindow.py
+++ b/src/leap/bitmask/gui/mainwindow.py
@@ -1066,16 +1066,24 @@ class MainWindow(QtGui.QMainWindow):
Stops the login sequence.
"""
- logger.debug("Cancelling setup provider defer.")
+ logger.debug("Cancelling log in.")
+ self._cancel_ongoing_defers()
+
+ def _cancel_ongoing_defers(self):
+ """
+ Cancel the running defers to avoid app blocking.
+ """
self._backend.cancel_setup_provider()
if self._login_defer is not None:
logger.debug("Cancelling login defer.")
self._login_defer.cancel()
+ self._login_defer = None
if self._soledad_defer is not None:
logger.debug("Cancelling soledad defer.")
self._soledad_defer.cancel()
+ self._soledad_defer = None
def _set_login_cancelled(self):
"""
@@ -1811,9 +1819,8 @@ class MainWindow(QtGui.QMainWindow):
"""
self._soledad_bootstrapper.cancel_bootstrap()
setProxiedObject(self._soledad, None)
- if self._soledad_defer is not None:
- logger.debug("Cancelling soledad defer.")
- self._soledad_defer.cancel()
+
+ self._cancel_ongoing_defers()
# reset soledad status flag
self._already_started_soledad = False
@@ -1930,16 +1937,7 @@ class MainWindow(QtGui.QMainWindow):
logger.debug('Terminating vpn')
self._vpn.terminate(shutdown=True)
- if self._login_defer:
- logger.debug("Cancelling login defer.")
- self._login_defer.cancel()
-
- logger.debug("Cancelling setup provider defer.")
- self._backend.cancel_setup_provider()
-
- if self._soledad_defer is not None:
- logger.debug("Cancelling soledad defer.")
- self._soledad_defer.cancel()
+ self._cancel_ongoing_defers()
# TODO missing any more cancels?