- <screen position="0,0" size="720,560" title="Welcome..." flags="wfNoBorder" >
- <widget name="text" position="50,100" size="440,300" font="Arial;23" />
- <widget name="step" position="50,50" size="440,25" font="Arial;23" />
- <widget name="stepslider" position="50,500" zPosition="1" size="440,20" backgroundColor="dark" />
- <widget name="rc" pixmap="/usr/share/enigma2/rc.png" position="500,50" size="154,475" transparent="1" alphatest="on"/>
- <widget name="arrowdown" pixmap="/usr/share/enigma2/arrowdown.png" position="0,0" zPosition="1" size="37,70" transparent="1" alphatest="on"/>
- <widget name="arrowup" pixmap="/usr/share/enigma2/arrowup.png" position="-100,-100" zPosition="1" size="37,70" transparent="1" alphatest="on"/>
- </screen>"""
-
- text = [_("Hello User.\n\nThis start-wizard will guide you through the basic setup of your Dreambox.\n\nPress the OK button on your remote control to move to the next step."),
- _("You can use the Up and Down buttons on your remote control to select your choice.\n\nWhat do you want to do?"),
- _("Blub")]
-
- def __init__(self, session):
- self.skin = WelcomeWizard.skin
- self.numSteps = 3
- self.currStep = 1
+ <screen position="0,0" size="132,64">
+ <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>
+ </screen>"""
+
+ def __init__(self, session, parent):
+ Screen.__init__(self, session, parent)
+
+ #names = parent.skinName
+ #if not isinstance(names, list):
+ #names = [names]
+#
+ #self.skinName = [x + "_summary" for x in names ]
+ #self.skinName.append("Wizard")
+ #print "*************+++++++++++++++++****************++++++++++******************* WizardSummary", self.skinName
+ #
+ self["text"] = Label("")
+ self.onShow.append(self.setCallback)
+
+ def setCallback(self):
+ self.parent.setLCDTextCallback(self.setText)
+
+ def setText(self, text):
+ self["text"].setText(text)
+
+class Wizard(Screen, HelpableScreen):
+ def createSummary(self):
+ print "WizardCreateSummary"
+ return WizardSummary
+
+ class parseWizard(ContentHandler):
+ def __init__(self, wizard):
+ self.isPointsElement, self.isReboundsElement = 0, 0
+ self.wizard = wizard
+ self.currContent = ""
+ self.lastStep = 0
+
+
+
+ def startElement(self, name, attrs):
+ print "startElement", name
+ self.currContent = name
+ if (name == "step"):
+ self.lastStep += 1
+ if attrs.has_key('id'):
+ id = str(attrs.get('id'))
+ else:
+ id = ""
+ print "id:", id
+ if attrs.has_key('nextstep'):
+ nextstep = str(attrs.get('nextstep'))
+ else:
+ nextstep = None
+ if attrs.has_key('timeout'):
+ timeout = int(attrs.get('timeout'))
+ else:
+ timeout = None
+ if attrs.has_key('timeoutaction'):
+ timeoutaction = str(attrs.get('timeoutaction'))
+ else:
+ timeoutaction = 'nextpage'
+
+ if attrs.has_key('timeoutstep'):
+ timeoutstep = str(attrs.get('timeoutstep'))
+ else:
+ timeoutstep = ''
+ self.wizard[self.lastStep] = {"id": id, "condition": "", "text": "", "timeout": timeout, "timeoutaction": timeoutaction, "timeoutstep": timeoutstep, "list": [], "config": {"screen": None, "args": None, "type": "" }, "code": "", "codeafter": "", "nextstep": nextstep}
+ elif (name == "text"):
+ self.wizard[self.lastStep]["text"] = string.replace(str(attrs.get('value')), "\\n", "\n")
+ elif (name == "displaytext"):
+ self.wizard[self.lastStep]["displaytext"] = string.replace(str(attrs.get('value')), "\\n", "\n")
+ elif (name == "list"):
+ if (attrs.has_key('type')):
+ if attrs["type"] == "dynamic":
+ self.wizard[self.lastStep]["dynamiclist"] = attrs.get("source")
+ #self.wizard[self.lastStep]["list"].append(("Hallo", "test"))
+ if (attrs.has_key("evaluation")):
+ print "evaluation"
+ self.wizard[self.lastStep]["listevaluation"] = attrs.get("evaluation")
+ if (attrs.has_key("onselect")):
+ self.wizard[self.lastStep]["onselect"] = attrs.get("onselect")
+ elif (name == "listentry"):
+ self.wizard[self.lastStep]["list"].append((str(attrs.get('caption')), str(attrs.get('step'))))
+ elif (name == "config"):
+ exec "from Screens." + str(attrs.get('module')) + " import *"
+ self.wizard[self.lastStep]["config"]["screen"] = eval(str(attrs.get('screen')))
+ if (attrs.has_key('args')):
+ print "has args"
+ self.wizard[self.lastStep]["config"]["args"] = str(attrs.get('args'))
+ self.wizard[self.lastStep]["config"]["type"] = str(attrs.get('type'))
+ elif (name == "code"):
+ if attrs.has_key('pos') and str(attrs.get('pos')) == "after":
+ self.codeafter = True
+ else:
+ self.codeafter = False
+ elif (name == "condition"):
+ pass
+ def endElement(self, name):
+ self.currContent = ""
+ if name == 'code':
+ if self.codeafter:
+ self.wizard[self.lastStep]["codeafter"] = self.wizard[self.lastStep]["codeafter"].strip()
+ else:
+ self.wizard[self.lastStep]["code"] = self.wizard[self.lastStep]["code"].strip()
+ elif name == 'condition':
+ self.wizard[self.lastStep]["condition"] = self.wizard[self.lastStep]["condition"].strip()
+ elif name == 'step':
+ print "Step number", self.lastStep, ":", self.wizard[self.lastStep]
+
+ def characters(self, ch):
+ if self.currContent == "code":
+ if self.codeafter:
+ self.wizard[self.lastStep]["codeafter"] = self.wizard[self.lastStep]["codeafter"] + ch
+ else:
+ self.wizard[self.lastStep]["code"] = self.wizard[self.lastStep]["code"] + ch
+ elif self.currContent == "condition":
+ self.wizard[self.lastStep]["condition"] = self.wizard[self.lastStep]["condition"] + ch