<wizard>
- <step id="welcome" nextstep="nothingtoinstall">
+ <step id="startdefaultlists" nextstep="nothingtoinstall">
<condition>
packagelist = self.fillPackagesList()
self.runWizard = (len(packagelist) > 0)
self.disableKeys = True
</code>
</step>
- <step id="nopackages" nextstep="install">
+ <step id="nopackages" nextstep="finisheddefaultsatlists">
<text value="There are no default services lists in your image." />
</step>
- <step id="nothingtoinstall" nextstep="install">
+ <step id="nothingtoinstall" nextstep="finisheddefaultsatlists">
<condition>
if self.runWizard:
self.condition = True
<code>
self.disableKeys = False
</code>
- <code pos="after">
-self.markDone()
- </code>
</step>
- <step id="install">
+ <step id="install" nextstep="finisheddefaultsatlists">
<condition>
self.condition = False
if self.runWizard:
<code>
self.disableKeys = True
self.installPackages(self.indexList)
- </code>
- <code>
-#print "len of packageslist", len(self.packageslist)
-#if (len(self.packageslist) == 1):
- #self.installPackage(0)
</code>
<text value="Installing default sat lists... Please wait..." />
</step>
+
+ <step id="finisheddefaultsatlists">
+ <condition>
+self.markDone()
+self.condition = False
+ </condition>
+ </step>
</wizard>
<wizard>
- <step id="welcome" nextstep="introduction">
+ <step id="start" nextstep="introduction">
<text value="Welcome.\n\nThis start wizard will guide you through the basic setup of your Dreambox.\nPress the OK button on your remote control to move to the next step." />
<code>
self["arrowdown"].moveTo(557, 232, 1)
self["arrowdown"].startMoving()
</code>
</step>
+ <step id="satlistsquestion">
+ <text value="Do you want to install default sat lists?" />
+ <condition>
+self.condition = config.misc.startwizard.doservicescan.value
+ </condition>
+ <code>
+self["rc"].moveTo(800, 50, 1)
+self["rc"].startMoving()
+self["arrowup"].moveTo(800, 310, 1)
+self["arrowup"].startMoving()
+self["arrowup2"].moveTo(800, 310, 1)
+self["arrowup2"].startMoving()
+ </code>
+ <list>
+ <listentry caption="Yes" step="startdefaultlists" />
+ <listentry caption="No" step="scanquestion" />
+ </list>
+ </step>
+
<step id="scanquestion">
<text value="Do you want to do a service scan?" />
<condition>
<list>
<listentry caption="Yes, do an automatic scan now" step="scan" />
<listentry caption="Yes, do a manual scan now" step="manualscan" />
- <listentry caption="No, let me choose default lists" step="parentalcontrol" />
- <listentry caption="No, scan later manually" step="parentalcontrol" />
+ <listentry caption="No, scan later manually" step="finisheddefaultsatlists" />
</list>
- <code pos="after">
-if self["list"].index == 2:
- #from Screens.ScanSetup import ScanSetup
- from Screens.ScanSetup import DefaultSatLists
- self.session.open(DefaultSatLists)
- </code>
</step>
- <step id="scan" nextstep="parentalcontrol">
+ <step id="scan" nextstep="finisheddefaultsatlists">
<condition>
self.condition = config.misc.startwizard.doservicescan.value
</condition>
<text value="Do you want to do another manual service scan?" />
<list>
<listentry caption="Yes, do another manual scan now" step="manualscan" />
- <listentry caption="No, scan later manually" step="parentalcontrol" />
+ <listentry caption="No, scan later manually" step="finisheddefaultsatlists" />
</list>
</step>
- <step id="parentalcontrol">
+ <step id="finisheddefaultsatlists">
<text value="Do you want to enable the parental control feature on your dreambox?" />
<list>
<listentry caption="Yes" step="parentalsetup" />
class DefaultSatLists(DefaultWizard):
def __init__(self, session, silent = True, showSteps = False):
+ self.xmlfile = "defaultsatlists.xml"
DefaultWizard.__init__(self, session, silent, showSteps, neededTag = "services")
print "configuredSats:", nimmanager.getConfiguredSats()
import os
os.system("mount %s %s" % (resolveFilename(SCOPE_DEFAULTPARTITION), resolveFilename(SCOPE_DEFAULTPARTITIONMOUNTDIR)))
self.directory.append(resolveFilename(SCOPE_DEFAULTPARTITIONMOUNTDIR))
- self.xmlfile = "defaultsatlists.xml"
-
+
def statusCallback(self, status, progress):
print "statusCallback:", status, progress
from Components.DreamInfoHandler import DreamInfoHandler
from Wizard import wizardManager
from Screens.WizardLanguage import WizardLanguage
+from Screens.ScanSetup import DefaultSatLists
+from Screens.DefaultWizard import DefaultWizard
from Components.Pixmap import Pixmap, MovingPixmap
from Components.config import config, ConfigBoolean, configfile, ConfigSubsection
config.misc.startwizard.doservicescan = ConfigBoolean(default = True)
config.misc.languageselected = ConfigBoolean(default = True)
-class StartWizard(WizardLanguage):
- def __init__(self, session):
- self.xmlfile = "startwizard.xml"
+class StartWizard(DefaultSatLists):
+ def __init__(self, session, silent = True, showSteps = False, neededTag = None):
+ self.xmlfile = ["startwizard.xml", "defaultsatlists.xml"]
WizardLanguage.__init__(self, session, showSteps = False)
+ DefaultWizard.__init__(self, session, silent, showSteps, neededTag = "services")
self["wizard"] = Pixmap()
self["rc"] = MovingPixmap()
self["arrowdown"] = MovingPixmap()
self.isPointsElement, self.isReboundsElement = 0, 0
self.wizard = wizard
self.currContent = ""
- self.lastStep = 0
-
-
-
+ self.lastStep = 0
+
def startElement(self, name, attrs):
- print "startElement", name
+ #print "startElement", name
self.currContent = name
if (name == "step"):
self.lastStep += 1
id = str(attrs.get('id'))
else:
id = ""
- print "id:", id
+ #print "id:", id
if attrs.has_key('nextstep'):
nextstep = str(attrs.get('nextstep'))
else:
self.wizard[self.lastStep]["dynamiclist"] = attrs.get("source")
#self.wizard[self.lastStep]["list"].append(("Hallo", "test"))
if (attrs.has_key("evaluation")):
- print "evaluation"
+ #print "evaluation"
self.wizard[self.lastStep]["listevaluation"] = attrs.get("evaluation")
if (attrs.has_key("onselect")):
self.wizard[self.lastStep]["onselect"] = attrs.get("onselect")
self.wizard[self.lastStep]["config"]["screen"] = eval(str(attrs.get('screen')))
if (attrs.has_key('args')):
- print "has args"
+ #print "has args"
self.wizard[self.lastStep]["config"]["args"] = str(attrs.get('args'))
elif type == "dynamic":
self.wizard[self.lastStep]["config"]["source"] = str(attrs.get('source'))
self.codeafter = False
elif (name == "condition"):
pass
+
def endElement(self, name):
self.currContent = ""
if name == 'code':
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]
+ #print "Step number", self.lastStep, ":", self.wizard[self.lastStep]
+ pass
def characters(self, ch):
if self.currContent == "code":
self.wizard = {}
parser = make_parser()
- print "Reading " + self.xmlfile
+ if not isinstance(self.xmlfile, list):
+ self.xmlfile = [self.xmlfile]
+ print "Reading ", self.xmlfile
wizardHandler = self.parseWizard(self.wizard)
parser.setContentHandler(wizardHandler)
- if self.xmlfile[0] != '/':
- parser.parse('/usr/share/enigma2/' + self.xmlfile)
- else:
- parser.parse(self.xmlfile)
+ for xmlfile in self.xmlfile:
+ if xmlfile[0] != '/':
+ parser.parse('/usr/share/enigma2/' + xmlfile)
+ else:
+ parser.parse(xmlfile)
self.showSteps = showSteps
self.showStepSlider = showStepSlider
self.showConfig = showConfig
self.numSteps = len(self.wizard)
- self.currStep = 1
+ self.currStep = self.getStepWithID("start") + 1
self.timeoutTimer = eTimer()
self.timeoutTimer.callback.append(self.timeoutCounterFired)
def getStepWithID(self, id):
print "getStepWithID:", id
count = 0
- for x in self.wizard:
+ for x in self.wizard.keys():
if self.wizard[x]["id"] == id:
print "result:", count
return count
else:
self.currStep = self.getStepWithID(nextStep)
- if (currStep == self.numSteps): # wizard finished
+ if ((currStep == self.numSteps and self.wizard[currStep]["nextstep"] is None) or self.wizard[currStep]["id"] == "end"): # wizard finished
+ print "wizard finished"
self.markDone()
self.close()
else: