summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui/mainwindow.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/gui/mainwindow.py')
-rw-r--r--src/leap/bitmask/gui/mainwindow.py29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py
index e086d02a..653ebc35 100644
--- a/src/leap/bitmask/gui/mainwindow.py
+++ b/src/leap/bitmask/gui/mainwindow.py
@@ -48,6 +48,7 @@ from leap.bitmask.gui.wizard import Wizard
from leap.bitmask.gui.providers import Providers
from leap.bitmask.platform_init import IS_WIN, IS_MAC, IS_LINUX
+from leap.bitmask.platform_init import locks
from leap.bitmask.platform_init.initializers import init_platform
from leap.bitmask.platform_init.initializers import init_signals
@@ -63,10 +64,6 @@ from leap.bitmask.util import autostart, make_address
from leap.bitmask.util.keyring_helpers import has_keyring
from leap.bitmask.logs.leap_log_handler import LeapLogHandler
-if IS_WIN:
- from leap.bitmask.platform_init.locks import WindowsLock
- from leap.bitmask.platform_init.locks import raise_window_ack
-
from leap.common.events import register
from leap.common.events import events_pb2 as proto
@@ -656,6 +653,10 @@ class MainWindow(QtGui.QMainWindow):
to do so, start it. Otherwise it leaves everything in place
for the user to click Turn ON.
"""
+ if self._eip_status.missing_helpers:
+ self._eip_status.disable_eip_start()
+ return
+
settings = self._settings
default_provider = settings.get_defaultprovider()
enabled_services = []
@@ -700,7 +701,9 @@ class MainWindow(QtGui.QMainWindow):
self._eip_status.disable_eip_start()
else:
self._eip_status.disable_eip_start()
- self._eip_status.set_eip_status(self.tr("Disabled"))
+ # NOTE: we shouldn't be setting the message here.
+ if not self._eip_status.missing_helpers:
+ self._eip_status.set_eip_status(self.tr("Disabled"))
# this state flag is responsible for deferring the login
# so we must update it, otherwise we're in a deadlock.
@@ -812,6 +815,15 @@ class MainWindow(QtGui.QMainWindow):
self._show_hide_unsupported_services()
+ # XXX - HACK, kind of...
+ # With the 1ms QTimer.singleShot call we schedule the call right after
+ # other signals waiting for the qt reactor to take control.
+ # That way, the method is called right after the EIP machines' signals.
+ # We need to wait until that happens because the state-machine
+ # controlled widget shows the 'Turn On' button and we want to do the
+ # changes to that button right after, not before.
+ QtDelayedCall(1, self._update_eip_enabled_status)
+
if self._wizard:
possible_username = self._wizard.get_username()
possible_password = self._wizard.get_password()
@@ -836,8 +848,6 @@ class MainWindow(QtGui.QMainWindow):
self._wizard = None
self._backend_connect(only_tracked=True)
else:
- self._update_eip_enabled_status()
-
domain = self._settings.get_provider()
if domain is not None:
self._providers.select_provider_by_name(domain)
@@ -1852,7 +1862,7 @@ class MainWindow(QtGui.QMainWindow):
Callback for the raise window event
"""
if IS_WIN:
- raise_window_ack()
+ locks.raise_window_ack()
self.raise_window.emit()
@QtCore.Slot()
@@ -2009,7 +2019,6 @@ class MainWindow(QtGui.QMainWindow):
# Remove lockfiles on a clean shutdown.
logger.debug('Cleaning pidfiles')
- if IS_WIN:
- WindowsLock.release_all_locks()
+ locks.release_lock()
self.close()