summaryrefslogtreecommitdiff
path: root/src/leap/baseapp/mainwindow.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-10-02 06:43:15 +0900
committerkali <kali@leap.se>2012-10-02 06:43:15 +0900
commit886d04167e51ba07a71393bad5c41b04023db527 (patch)
tree749a039b1a95ff5f888924cfd1c331166a2778a0 /src/leap/baseapp/mainwindow.py
parentbbbeef10fd581fa29090b95b8f46f4641f7e5f41 (diff)
moved eip checks to qthread to let icon show early
Diffstat (limited to 'src/leap/baseapp/mainwindow.py')
-rw-r--r--src/leap/baseapp/mainwindow.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/leap/baseapp/mainwindow.py b/src/leap/baseapp/mainwindow.py
index 10b23d9a..55be55f7 100644
--- a/src/leap/baseapp/mainwindow.py
+++ b/src/leap/baseapp/mainwindow.py
@@ -38,8 +38,11 @@ class LeapWindow(QtGui.QMainWindow,
StatusAwareTrayIconMixin.__init__(self)
MainWindowMixin.__init__(self)
+ self.initchecks = InitChecksThread(self.run_eip_checks)
+
# bind signals
- # XXX move to parent classes init??
+ self.initchecks.finished.connect(
+ lambda: logger.debug('Initial checks finished'))
self.trayIcon.activated.connect(self.iconActivated)
self.newLogLine.connect(
lambda line: self.onLoggerNewLine(line))
@@ -50,7 +53,17 @@ class LeapWindow(QtGui.QMainWindow,
# ... all ready. go!
- # could send "ready" signal instead
- # eipapp should catch that
- if self.conductor.autostart:
- self.start_or_stopVPN()
+ self.initchecks.begin()
+
+
+class InitChecksThread(QtCore.QThread):
+
+ def __init__(self, fun, parent=None):
+ QtCore.QThread.__init__(self, parent)
+ self.fun = fun
+
+ def run(self):
+ self.fun()
+
+ def begin(self):
+ self.start()