summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/gui')
-rw-r--r--src/leap/bitmask/gui/mainwindow.py18
-rw-r--r--src/leap/bitmask/gui/wizard.py16
2 files changed, 13 insertions, 21 deletions
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py
index 653ebc35..8127c1f6 100644
--- a/src/leap/bitmask/gui/mainwindow.py
+++ b/src/leap/bitmask/gui/mainwindow.py
@@ -206,6 +206,9 @@ class MainWindow(QtGui.QMainWindow):
self._finally_quitting = False
self._system_quit = False
+ # Used to differentiate between a real quit and a close to tray
+ self._close_to_tray = True
+
self._backend_connected_signals = []
self._backend_connect()
@@ -229,9 +232,6 @@ class MainWindow(QtGui.QMainWindow):
self.raise_window.connect(self._do_raise_mainwindow)
- # Used to differentiate between real quits and close to tray
- self._really_quit = False
-
self._systray = None
# XXX separate actions into a different module.
@@ -1144,7 +1144,7 @@ class MainWindow(QtGui.QMainWindow):
return
if QtGui.QSystemTrayIcon.isSystemTrayAvailable() and \
- not self._really_quit:
+ self._close_to_tray:
self._ensure_invisible()
e.ignore()
return
@@ -1889,10 +1889,9 @@ class MainWindow(QtGui.QMainWindow):
"""
Stop services and cancel ongoing actions (if any).
"""
- logger.debug('About to quit, doing cleanup.')
+ logger.debug('Stopping services...')
self._cancel_ongoing_defers()
-
self._services_being_stopped = set(('imap', 'eip'))
imap_stopped = lambda: self._remove_service('imap')
@@ -1921,9 +1920,10 @@ class MainWindow(QtGui.QMainWindow):
if self._quitting:
return
- autostart.set_autostart(False)
-
self._quitting = True
+ self._close_to_tray = False
+ logger.debug('Quitting...')
+ autostart.set_autostart(False)
# first thing to do quitting, hide the mainwindow and show tooltip.
self.hide()
@@ -1942,8 +1942,6 @@ class MainWindow(QtGui.QMainWindow):
# Set this in case that the app is hidden
QtGui.QApplication.setQuitOnLastWindowClosed(True)
- self._really_quit = True
-
if not self._backend.online:
self.final_quit()
return
diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py
index 0223c053..8182228d 100644
--- a/src/leap/bitmask/gui/wizard.py
+++ b/src/leap/bitmask/gui/wizard.py
@@ -96,11 +96,6 @@ class Wizard(QtGui.QWizard):
# this details are set when the provider download is complete.
self._provider_details = None
- # We will store a reference to the defers for eventual use
- # (eg, to cancel them) but not doing anything with them right now.
- self._provider_select_defer = None
- self._provider_setup_defer = None
-
self._connect_and_track(self.currentIdChanged,
self._current_id_changed)
@@ -479,8 +474,7 @@ class Wizard(QtGui.QWizard):
self.button(QtGui.QWizard.BackButton).clearFocus()
self.ui.lblNameResolution.setPixmap(self.QUESTION_ICON)
- self._provider_select_defer = self._backend.\
- provider_setup(provider=self._domain)
+ self._backend.provider_setup(provider=self._domain)
@QtCore.Slot(bool)
def _skip_provider_checks(self, skip):
@@ -678,8 +672,9 @@ class Wizard(QtGui.QWizard):
Loads the services that the provider provides into the UI for
the user to enable or disable.
"""
- self.ui.grpServices.setTitle(
- self.tr("Services by {0}").format(self._provider_details['domain']))
+ title = self.tr("Services by {0}").format(
+ self._provider_details['domain'])
+ self.ui.grpServices.setTitle(title)
services = get_supported(self._provider_details['services'])
@@ -724,8 +719,7 @@ class Wizard(QtGui.QWizard):
if not self._provider_setup_ok:
self._reset_provider_setup()
self.ui.lblDownloadCaCert.setPixmap(self.QUESTION_ICON)
- self._provider_setup_defer = self._backend.\
- provider_bootstrap(provider=self._domain)
+ self._backend.provider_bootstrap(provider=self._domain)
if pageId == self.PRESENT_PROVIDER_PAGE:
details = self._provider_details