fix crash when eof in background: windows cannot be opened from other than the curren...
[enigma2.git] / lib / python / Screens / Wizard.py
index 14faba244cbc557a0ce1edaa32eff099fd5fc782..f018c3ce137a6888b183eaa2788a24efc574239c 100644 (file)
@@ -19,7 +19,7 @@ from xml.sax.handler import ContentHandler
 class WizardSummary(Screen):
        skin = """
        <screen position="0,0" size="132,64">
-               <widget name="text" position="6,4" size="120,42" font="Regular;14" />
+               <widget name="text" position="6,4" size="120,42" font="Regular;14" transparent="1" />
                <widget source="parent.list" render="Label" position="6,25" size="120,21" font="Regular;16">
                        <convert type="StringListSelection" />
                </widget>
@@ -162,7 +162,7 @@ class Wizard(Screen, HelpableScreen):
                self.currStep = 1
                
                self.timeoutTimer = eTimer()
-               self.timeoutTimer.timeout.get().append(self.timeoutCounterFired)
+               self.timeoutTimer.callback.append(self.timeoutCounterFired)
 
                self["text"] = Label()
 
@@ -211,12 +211,17 @@ class Wizard(Screen, HelpableScreen):
                self.lcdCallbacks.append(callback)
 
        def back(self):
+               print "getting back..."
+               print "stepHistory:", self.stepHistory
                if len(self.stepHistory) > 1:
                        self.currStep = self.stepHistory[-2]
                        self.stepHistory = self.stepHistory[:-2]
                if self.currStep < 1:
                        self.currStep = 1
+               print "currStep:", self.currStep
+               print "new stepHistory:", self.stepHistory
                self.updateValues()
+               print "after updateValues stepHistory:", self.stepHistory
                
        def markDone(self):
                pass
@@ -366,7 +371,8 @@ class Wizard(Screen, HelpableScreen):
                self.condition = True
                exec (self.wizard[self.currStep]["condition"])
                if self.condition:
-                       self.stepHistory.append(self.currStep)
+                       if len(self.stepHistory) == 0 or self.stepHistory[-1] != self.currStep:
+                               self.stepHistory.append(self.currStep)
                        print "wizard step:", self.wizard[self.currStep]
                        
                        if self.showSteps:
@@ -459,14 +465,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()