From: Felix Domke Date: Mon, 11 Feb 2008 14:12:52 +0000 (+0000) Subject: add a 'priority' for wizard screens to define the run order X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=commitdiff_plain;h=5bc8209d19e1d41f289cfe198e4e3a839adf894b add a 'priority' for wizard screens to define the run order --- diff --git a/lib/python/Plugins/SystemPlugins/FrontprocessorUpgrade/plugin.py b/lib/python/Plugins/SystemPlugins/FrontprocessorUpgrade/plugin.py index 407f1ad..1946edf 100644 --- a/lib/python/Plugins/SystemPlugins/FrontprocessorUpgrade/plugin.py +++ b/lib/python/Plugins/SystemPlugins/FrontprocessorUpgrade/plugin.py @@ -52,6 +52,6 @@ def Plugins(**kwargs): version = getFPVersion() newversion = getUpgradeVersion() or 0 if version is not None and version < newversion: - return PluginDescriptor(name="FP Upgrade", where = PluginDescriptor.WHERE_WIZARD, fnc=FPUpgrade) + return PluginDescriptor(name="FP Upgrade", where = PluginDescriptor.WHERE_WIZARD, fnc=(8, FPUpgrade)) else: return [ ] diff --git a/lib/python/Plugins/SystemPlugins/Videomode/plugin.py b/lib/python/Plugins/SystemPlugins/Videomode/plugin.py index 719bb0a..b5e12c2 100644 --- a/lib/python/Plugins/SystemPlugins/Videomode/plugin.py +++ b/lib/python/Plugins/SystemPlugins/Videomode/plugin.py @@ -187,5 +187,5 @@ def Plugins(**kwargs): PluginDescriptor(name=_("Video Setup"), description=_("Advanced Video Setup"), where = PluginDescriptor.WHERE_MENU, fnc=startSetup) ] if config.misc.firstrun.value: - list.append(PluginDescriptor(name=_("Video Wizard"), where = PluginDescriptor.WHERE_WIZARD, fnc=VideoWizard)) + list.append(PluginDescriptor(name=_("Video Wizard"), where = PluginDescriptor.WHERE_WIZARD, fnc=(0, VideoWizard))) return list diff --git a/lib/python/Screens/ImageWizard.py b/lib/python/Screens/ImageWizard.py index 148eba5..ad0640c 100644 --- a/lib/python/Screens/ImageWizard.py +++ b/lib/python/Screens/ImageWizard.py @@ -34,7 +34,7 @@ class ImageWizard(Wizard): def markDone(self): pass -wizardManager.registerWizard(ImageWizard, backupAvailable) +wizardManager.registerWizard(ImageWizard, backupAvailable, priority = 10) def doBackup(path): os.system('tar cvpf ' + path + backupfile + ' /etc/enigma2') diff --git a/lib/python/Screens/StartWizard.py b/lib/python/Screens/StartWizard.py index 0424771..a60e3d2 100644 --- a/lib/python/Screens/StartWizard.py +++ b/lib/python/Screens/StartWizard.py @@ -41,7 +41,6 @@ class StartWizard(Wizard): config.misc.firstrun.save() configfile.save() -wizardManager.registerWizard(LanguageSelection, config.misc.languageselected.value) +wizardManager.registerWizard(LanguageSelection, config.misc.languageselected.value, priority = 5) #wizardManager.registerWizard(DefaultWizard, config.misc.defaultchosen.value) -wizardManager.registerWizard(StartWizard, config.misc.firstrun.value) - +wizardManager.registerWizard(StartWizard, config.misc.firstrun.value, priority = 20) diff --git a/lib/python/Screens/TutorialWizard.py b/lib/python/Screens/TutorialWizard.py index c90ed36..9e97b7e 100644 --- a/lib/python/Screens/TutorialWizard.py +++ b/lib/python/Screens/TutorialWizard.py @@ -30,4 +30,4 @@ class TutorialWizard(Wizard): config.misc.firstruntutorial.value = False config.misc.firstruntutorial.save() -#wizardManager.registerWizard(TutorialWizard, config.misc.firstruntutorial.value) +#wizardManager.registerWizard(TutorialWizard, config.misc.firstruntutorial.value, priority = 30) diff --git a/lib/python/Screens/Wizard.py b/lib/python/Screens/Wizard.py index e574f86..1b13315 100644 --- a/lib/python/Screens/Wizard.py +++ b/lib/python/Screens/Wizard.py @@ -459,14 +459,14 @@ class WizardManager: def __init__(self): self.wizards = [] - def registerWizard(self, wizard, precondition): - self.wizards.append((wizard, precondition)) + def registerWizard(self, wizard, precondition, priority = 0): + self.wizards.append((wizard, precondition, priority)) def getWizards(self): list = [] for x in self.wizards: if x[1] == 1: # precondition - list.append(x[0]) + list.append((x[2], x[0])) return list wizardManager = WizardManager() diff --git a/mytest.py b/mytest.py index 627d16f..fd72529 100644 --- a/mytest.py +++ b/mytest.py @@ -511,7 +511,9 @@ def runScreenTest(): profile("wizards") screensToRun += wizardManager.getWizards() - screensToRun.append(Screens.InfoBar.InfoBar) + screensToRun.append((100, Screens.InfoBar.InfoBar)) + + screensToRun.sort() ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) @@ -526,7 +528,7 @@ def runScreenTest(): quitMainloop(*result) return - screen = screensToRun[0] + screen = screensToRun[0][1] if len(screensToRun): session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen)