diff options
author | kali <kali@leap.se> | 2012-10-08 07:19:09 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2012-10-08 07:19:09 +0900 |
commit | 3a77603eae5fea0b1efb226860e0264ccf96f41b (patch) | |
tree | 19dced0267d7840d142ff9d771548f3c3f39fcbb /src/leap/baseapp/mainwindow.py | |
parent | c7cfb8fcef773b84738e36b6d0c27487cf8e952a (diff) | |
parent | 8a594577660d78a4f0f9d3c5f5902dff3911e010 (diff) |
Merge branch 'feature/firstrun-wizard' into develop
Diffstat (limited to 'src/leap/baseapp/mainwindow.py')
-rw-r--r-- | src/leap/baseapp/mainwindow.py | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/leap/baseapp/mainwindow.py b/src/leap/baseapp/mainwindow.py index 55be55f7..1accac30 100644 --- a/src/leap/baseapp/mainwindow.py +++ b/src/leap/baseapp/mainwindow.py @@ -26,18 +26,26 @@ class LeapWindow(QtGui.QMainWindow, newLogLine = QtCore.pyqtSignal([str]) statusChange = QtCore.pyqtSignal([object]) + mainappReady = QtCore.pyqtSignal([]) + initReady = QtCore.pyqtSignal([]) def __init__(self, opts): logger.debug('init leap window') self.debugmode = getattr(opts, 'debug', False) - super(LeapWindow, self).__init__() if self.debugmode: self.createLogBrowser() + EIPConductorAppMixin.__init__(self, opts=opts) StatusAwareTrayIconMixin.__init__(self) MainWindowMixin.__init__(self) + settings = QtCore.QSettings() + geom = settings.value("Geometry") + if geom: + self.restoreGeometry(geom) + self.wizard_done = settings.value("FirstRunWizardDone") + self.initchecks = InitChecksThread(self.run_eip_checks) # bind signals @@ -51,8 +59,28 @@ class LeapWindow(QtGui.QMainWindow, self.timer.timeout.connect( lambda: self.onTimerTick()) - # ... all ready. go! + # do frwizard and init signals + self.mainappReady.connect(self.do_first_run_wizard_check) + self.initReady.connect(self.runchecks_and_eipconnect) + # ... all ready. go! + # calls do_first_run_wizard_check + self.mainappReady.emit() + + def do_first_run_wizard_check(self): + logger.debug('first run wizard check...') + if self.wizard_done: + self.initReady.emit() + else: + # need to run first-run-wizard + logger.debug('running first run wizard') + from leap.gui.firstrunwizard import FirstRunWizard + wizard = FirstRunWizard( + parent=self, + success_cb=self.initReady.emit) + wizard.show() + + def runchecks_and_eipconnect(self): self.initchecks.begin() |