allow import of ConfigLists from non Screens. positions.
[enigma2.git] / lib / python / Screens / Wizard.py
index 9c9cbd30e97b8986b80a4878c07447e29ab04593..ab1f188b21430b2da4056623b261bb7e2840835a 100644 (file)
@@ -105,7 +105,10 @@ class Wizard(Screen, HelpableScreen):
                                type = str(attrs.get('type'))
                                self.wizard[self.lastStep]["config"]["type"] = type
                                if type == "ConfigList" or type == "standalone":
-                                       exec "from Screens." + str(attrs.get('module')) + " import *"
+                                       try:
+                                               exec "from Screens." + str(attrs.get('module')) + " import *"
+                                       except:
+                                               exec "from " + str(attrs.get('module')) + " import *"
                                
                                        self.wizard[self.lastStep]["config"]["screen"] = eval(str(attrs.get('screen')))
                                        if (attrs.has_key('args')):
@@ -396,8 +399,11 @@ class Wizard(Screen, HelpableScreen):
                        print "code", code
                        exec(code)
                        
+       def getTranslation(self, text):
+               return _(text)
+                       
        def updateText(self, firstset = False):
-               text = _(self.wizard[self.currStep]["text"])
+               text = self.getTranslation(self.wizard[self.currStep]["text"])
                if text.find("[timeout]") != -1:
                        text = text.replace("[timeout]", str(self.timeoutCounter))
                        self["text"].setText(text)
@@ -429,7 +435,7 @@ class Wizard(Screen, HelpableScreen):
                        print "wizard step:", self.wizard[self.currStep]
                        
                        if self.showSteps:
-                               self["step"].setText(_("Step ") + str(self.currStep) + "/" + str(self.numSteps))
+                               self["step"].setText(self.getTranslation("Step ") + str(self.currStep) + "/" + str(self.numSteps))
                        if self.showStepSlider:
                                self["stepslider"].setValue(self.currStep)
                
@@ -437,7 +443,7 @@ class Wizard(Screen, HelpableScreen):
                                self.resetCounter() 
                                self.timeoutTimer.start(1000)
                        
-                       print "wizard text", _(self.wizard[self.currStep]["text"])
+                       print "wizard text", self.getTranslation(self.wizard[self.currStep]["text"])
                        self.updateText(firstset = True)
                        if self.wizard[self.currStep].has_key("displaytext"):
                                displaytext = self.wizard[self.currStep]["displaytext"]
@@ -471,7 +477,7 @@ class Wizard(Screen, HelpableScreen):
                                if (len(self.wizard[self.currStep]["list"]) > 0):
                                        #self["list"].instance.setZPosition(2)
                                        for x in self.wizard[self.currStep]["list"]:
-                                               self.list.append((_(x[0]), x[1]))
+                                               self.list.append((self.getTranslation(x[0]), x[1]))
                                self.wizard[self.currStep]["evaluatedlist"] = self.list
                                self["list"].list = self.list
                                self["list"].index = 0