add a 'priority' for wizard screens to define the run order
authorFelix Domke <tmbinc@elitedvb.net>
Mon, 11 Feb 2008 14:12:52 +0000 (14:12 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Mon, 11 Feb 2008 14:12:52 +0000 (14:12 +0000)
lib/python/Plugins/SystemPlugins/FrontprocessorUpgrade/plugin.py
lib/python/Plugins/SystemPlugins/Videomode/plugin.py
lib/python/Screens/ImageWizard.py
lib/python/Screens/StartWizard.py
lib/python/Screens/TutorialWizard.py
lib/python/Screens/Wizard.py
mytest.py

index 407f1ade02b8b9176bb4c1f670c70dc82bd94b77..1946edf04c56e02bd0541f9beff885150ce0d0e5 100644 (file)
@@ -52,6 +52,6 @@ def Plugins(**kwargs):
        version = getFPVersion()
        newversion = getUpgradeVersion() or 0
        if version is not None and version < newversion:
        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 [ ]
        else:
                return [ ]
index 719bb0a9388f13dec27ade7c721f8b5cc14175bb..b5e12c2e27c2a321f10617ba8b7ac3b6b1c219f0 100644 (file)
@@ -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:
                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
        return list
index 148eba52ba85b89f7d162109b266feee5ef3dc3f..ad0640cf95834b566a8dd4693b18ccdd2409b82a 100644 (file)
@@ -34,7 +34,7 @@ class ImageWizard(Wizard):
        def markDone(self):
                pass
 
        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')
 
 def doBackup(path):
        os.system('tar cvpf ' + path + backupfile + ' /etc/enigma2')
index 0424771ab22aec7ced213a7bc3bd848a53b7d680..a60e3d2ab72adc63da34723d768830495a52a2e0 100644 (file)
@@ -41,7 +41,6 @@ class StartWizard(Wizard):
                config.misc.firstrun.save()
                configfile.save()
                
                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(DefaultWizard, config.misc.defaultchosen.value)
-wizardManager.registerWizard(StartWizard, config.misc.firstrun.value)
-
+wizardManager.registerWizard(StartWizard, config.misc.firstrun.value, priority = 20)
index c90ed365f929365bdfd0e482de1f950a8750cf28..9e97b7e7f7770c42e830d319acd0134ca764c936 100644 (file)
@@ -30,4 +30,4 @@ class TutorialWizard(Wizard):
                config.misc.firstruntutorial.value = False
                config.misc.firstruntutorial.save()
 
                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)
index e574f861b2f4ffba36c6a39dd6312bacfaaaf27c..1b133152f61ea38e28e81938a2ee2d53582e7cac 100644 (file)
@@ -459,14 +459,14 @@ class WizardManager:
        def __init__(self):
                self.wizards = []
        
        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
        
        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()
                return list
 
 wizardManager = WizardManager()
index 627d16fbf5990f2baa84fc3333f38647b740befc..fd72529b61907e4b16b956d403ef7620a4437faf 100644 (file)
--- a/mytest.py
+++ b/mytest.py
@@ -511,7 +511,9 @@ def runScreenTest():
        profile("wizards")
        screensToRun += wizardManager.getWizards()
 
        profile("wizards")
        screensToRun += wizardManager.getWizards()
 
-       screensToRun.append(Screens.InfoBar.InfoBar)
+       screensToRun.append((100, Screens.InfoBar.InfoBar))
+
+       screensToRun.sort()
 
        ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey)
 
 
        ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey)
 
@@ -526,7 +528,7 @@ def runScreenTest():
                        quitMainloop(*result)
                        return
 
                        quitMainloop(*result)
                        return
 
-               screen = screensToRun[0]
+               screen = screensToRun[0][1]
 
                if len(screensToRun):
                        session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen)
 
                if len(screensToRun):
                        session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen)