- show NumericalTextInput on text config entries
[enigma2.git] / lib / python / Screens / Wizard.py
index 855df6ad16cbd9c368f4a4c677c03939b91f3442..7c39b3e44fd294d7a8cd64e86b9bad415f202ea3 100644 (file)
@@ -3,7 +3,7 @@ from Screen import Screen
 import string
 
 from Screens.HelpMenu import HelpableScreen
-from Components.config import config, KEY_LEFT, KEY_RIGHT
+from Components.config import config, KEY_LEFT, KEY_RIGHT, KEY_DELETE, KEY_BACKSPACE
 from Components.Label import Label
 from Components.Slider import Slider
 from Components.ActionMap import NumberActionMap
@@ -45,7 +45,7 @@ class WizardSummary(Screen):
        def setText(self, text):
                self["text"].setText(text)
 
-class Wizard(Screen, HelpableScreen):
+class Wizard(Screen):
        def createSummary(self):
                        print "WizardCreateSummary"
                        return WizardSummary
@@ -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')):
@@ -147,7 +150,6 @@ class Wizard(Screen, HelpableScreen):
 
        def __init__(self, session, showSteps = True, showStepSlider = True, showList = True, showConfig = True):
                Screen.__init__(self, session)
-               HelpableScreen.__init__(self)
 
                self.stepHistory = []
 
@@ -178,7 +180,7 @@ class Wizard(Screen, HelpableScreen):
                self["text"] = Label()
 
                if showConfig:
-                       self["config"] = ConfigList([])
+                       self["config"] = ConfigList([], session = session)
 
                if self.showSteps:
                        self["step"] = Label()
@@ -200,7 +202,7 @@ class Wizard(Screen, HelpableScreen):
                
                self.disableKeys = False
                
-               self["actions"] = NumberActionMap(["WizardActions", "NumberActions", "ColorActions"],
+               self["actions"] = NumberActionMap(["WizardActions", "NumberActions", "ColorActions", "SetupActions"],
                {
                        "ok": self.ok,
                        "back": self.back,
@@ -212,6 +214,8 @@ class Wizard(Screen, HelpableScreen):
                        "green": self.green,
                        "yellow": self.yellow,
                        "blue":self.blue,
+                       "deleteBackward": self.deleteBackward,
+                       "deleteForward": self.deleteForward,
                        "1": self.keyNumberGlobal,
                        "2": self.keyNumberGlobal,
                        "3": self.keyNumberGlobal,
@@ -240,6 +244,22 @@ class Wizard(Screen, HelpableScreen):
                print "blue"
                pass
        
+       def deleteForward(self):
+               self.resetCounter()
+               if (self.wizard[self.currStep]["config"]["screen"] != None):
+                       self.configInstance.keyDelete()
+               elif (self.wizard[self.currStep]["config"]["type"] == "dynamic"):
+                       self["config"].handleKey(KEY_DELETE)
+               print "deleteForward"
+
+       def deleteBackward(self):
+               self.resetCounter()
+               if (self.wizard[self.currStep]["config"]["screen"] != None):
+                       self.configInstance.keyBackspace()
+               elif (self.wizard[self.currStep]["config"]["type"] == "dynamic"):
+                       self["config"].handleKey(KEY_BACKSPACE)
+               print "deleteBackward"
+       
        def setLCDTextCallback(self, callback):
                self.lcdCallbacks.append(callback)