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/gui/firstrunwizard.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/leap/gui') diff --git a/src/leap/gui/firstrunwizard.py b/src/leap/gui/firstrunwizard.py index bf1f351c..b93dc8e9 100755 --- a/src/leap/gui/firstrunwizard.py +++ b/src/leap/gui/firstrunwizard.py @@ -1,14 +1,18 @@ #!/usr/bin/env python -# This is only needed for Python v2 but is harmless for Python v3. +import logging + import sip sip.setapi('QString', 2) sip.setapi('QVariant', 2) +from PyQt4 import QtCore from PyQt4 import QtGui # XXX change and use some other stuff. import firstrunwizard_rc +logger = logging.getLogger(__name__) + # registration ###################### # move to base/ @@ -83,13 +87,16 @@ QLabel { color: red; class FirstRunWizard(QtGui.QWizard): - def __init__(self, parent=None, providers=None): + def __init__(self, parent=None, providers=None, success_cb=None): super(FirstRunWizard, self).__init__(parent) if not providers: providers = ('springbok',) self.providers = providers + # success callback + self.success_cb = success_cb + self.addPage(IntroPage()) self.addPage(SelectProviderPage(providers=providers)) @@ -119,6 +126,14 @@ class FirstRunWizard(QtGui.QWizard): # and pass a dict with options # XXX unless one exists by default... + settings = QtCore.QSettings() + settings.setValue("FirstRunWizardDone", True) + + logger.debug('First Run Wizard Done.') + cb = self.success_cb + if cb and callable(cb): + self.success_cb() + def get_provider(self): provider = self.field('provider_index') return self.providers[provider] -- cgit v1.2.3