- increase video wizard timeout from 10 to 20 seconds
[enigma2.git] / lib / python / Screens / Wizard.py
old mode 100644 (file)
new mode 100755 (executable)
index 23d6253..7d454f4
@@ -1,9 +1,8 @@
 from Screen import Screen
 
-import string
-
 from Screens.HelpMenu import HelpableScreen
-from Components.config import config, KEY_LEFT, KEY_RIGHT, KEY_DELETE, KEY_BACKSPACE
+from Components.config import config, KEY_LEFT, KEY_RIGHT, KEY_HOME, KEY_END, KEY_0, KEY_DELETE, KEY_BACKSPACE, KEY_OK, KEY_TOGGLEOW, KEY_ASCII, KEY_TIMEOUT, KEY_NUMBERS
+
 from Components.Label import Label
 from Components.Slider import Slider
 from Components.ActionMap import NumberActionMap
@@ -86,9 +85,9 @@ class Wizard(Screen):
                                        timeoutstep = ''
                                self.wizard[self.lastStep] = {"id": id, "condition": "", "text": "", "timeout": timeout, "timeoutaction": timeoutaction, "timeoutstep": timeoutstep, "list": [], "config": {"screen": None, "args": None, "type": "" }, "code": "", "codeafter": "", "code_async": "", "codeafter_async": "", "nextstep": nextstep}
                        elif (name == "text"):
-                               self.wizard[self.lastStep]["text"] = string.replace(str(attrs.get('value')), "\\n", "\n")
+                               self.wizard[self.lastStep]["text"] = str(attrs.get('value')).replace("\\n", "\n")
                        elif (name == "displaytext"):
-                               self.wizard[self.lastStep]["displaytext"] = string.replace(str(attrs.get('value')), "\\n", "\n")
+                               self.wizard[self.lastStep]["displaytext"] = str(attrs.get('value')).replace("\\n", "\n")
                        elif (name == "list"):
                                if (attrs.has_key('type')):
                                        if attrs["type"] == "dynamic":
@@ -215,8 +214,9 @@ class Wizard(Screen):
                
                self.disableKeys = False
                
-               self["actions"] = NumberActionMap(["WizardActions", "NumberActions", "ColorActions", "SetupActions"],
+               self["actions"] = NumberActionMap(["WizardActions", "NumberActions", "ColorActions", "SetupActions", "InputAsciiActions"],
                {
+                       "gotAsciiCode": self.keyGotAscii,
                        "ok": self.ok,
                        "back": self.back,
                        "left": self.left,
@@ -368,6 +368,10 @@ class Wizard(Screen):
        def keyNumberGlobal(self, number):
                if (self.wizard[self.currStep]["config"]["screen"] != None):
                        self.configInstance.keyNumberGlobal(number)
+
+       def keyGotAscii(self):
+               if (self.wizard[self.currStep]["config"]["screen"] != None):
+                       self["config"].handleKey(KEY_ASCII)
                
        def left(self):
                self.resetCounter()
@@ -471,6 +475,11 @@ class Wizard(Screen):
                        self.currStep += 1
                        self.updateValues()
                else:
+                       if self.wizard[self.currStep].has_key("displaytext"):
+                               displaytext = self.wizard[self.currStep]["displaytext"]
+                               print "set LCD text"
+                               for x in self.lcdCallbacks:
+                                       x(displaytext)
                        if len(self.stepHistory) == 0 or self.stepHistory[-1] != self.currStep:
                                self.stepHistory.append(self.currStep)
                        print "wizard step:", self.wizard[self.currStep]