From 51dee24be94567334dfb8765cbd3bb23dcae9ee3 Mon Sep 17 00:00:00 2001 From: kali Date: Fri, 5 Oct 2012 04:10:50 +0900 Subject: init QSettings - save window geometry --- src/leap/baseapp/mainwindow.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/leap/baseapp/mainwindow.py') diff --git a/src/leap/baseapp/mainwindow.py b/src/leap/baseapp/mainwindow.py index 55be55f7..d3656cd4 100644 --- a/src/leap/baseapp/mainwindow.py +++ b/src/leap/baseapp/mainwindow.py @@ -30,14 +30,19 @@ class LeapWindow(QtGui.QMainWindow, 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.initchecks = InitChecksThread(self.run_eip_checks) # bind signals -- cgit v1.2.3 From a92ea6fcc5e2e10c6df6d41b52a5d98044317eba Mon Sep 17 00:00:00 2001 From: kali Date: Fri, 5 Oct 2012 05:32:15 +0900 Subject: wizard called from main app if not run before. --- src/leap/baseapp/mainwindow.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/leap/baseapp/mainwindow.py') diff --git a/src/leap/baseapp/mainwindow.py b/src/leap/baseapp/mainwindow.py index d3656cd4..63242fd2 100644 --- a/src/leap/baseapp/mainwindow.py +++ b/src/leap/baseapp/mainwindow.py @@ -26,6 +26,7 @@ class LeapWindow(QtGui.QMainWindow, newLogLine = QtCore.pyqtSignal([str]) statusChange = QtCore.pyqtSignal([object]) + initReady = QtCore.pyqtSignal([]) def __init__(self, opts): logger.debug('init leap window') @@ -42,6 +43,7 @@ class LeapWindow(QtGui.QMainWindow, geom = settings.value("Geometry") if geom: self.restoreGeometry(geom) + self.wizard_done = settings.value("FirstRunWizardDone") self.initchecks = InitChecksThread(self.run_eip_checks) @@ -55,9 +57,20 @@ class LeapWindow(QtGui.QMainWindow, lambda status: self.onStatusChange(status)) self.timer.timeout.connect( lambda: self.onTimerTick()) + self.initReady.connect(self.runchecks_and_eipconnect) # ... all ready. go! - + if self.wizard_done: + self.initReady.emit() + else: + # need to run 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() -- cgit v1.2.3 From b9d1b57976984d1032b3abc810f462a80fdc55aa Mon Sep 17 00:00:00 2001 From: kali Date: Fri, 5 Oct 2012 07:00:42 +0900 Subject: focus fix for wizard --- src/leap/baseapp/mainwindow.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/leap/baseapp/mainwindow.py') diff --git a/src/leap/baseapp/mainwindow.py b/src/leap/baseapp/mainwindow.py index 63242fd2..1accac30 100644 --- a/src/leap/baseapp/mainwindow.py +++ b/src/leap/baseapp/mainwindow.py @@ -26,6 +26,7 @@ class LeapWindow(QtGui.QMainWindow, newLogLine = QtCore.pyqtSignal([str]) statusChange = QtCore.pyqtSignal([object]) + mainappReady = QtCore.pyqtSignal([]) initReady = QtCore.pyqtSignal([]) def __init__(self, opts): @@ -57,13 +58,22 @@ class LeapWindow(QtGui.QMainWindow, lambda status: self.onStatusChange(status)) self.timer.timeout.connect( lambda: self.onTimerTick()) + + # 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, -- cgit v1.2.3