aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Screens
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2005-12-09 11:29:37 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2005-12-09 11:29:37 +0000
commitc08166b6d0671d136ca9c62ce9c915e426cff2f7 (patch)
tree1d77a10f647950cc2c8ac8ef37c7903caed97e53 /lib/python/Screens
parent796ca1530ab14e7694e5569d136ca128619d8e07 (diff)
downloadenigma2-c08166b6d0671d136ca9c62ce9c915e426cff2f7.tar.gz
enigma2-c08166b6d0671d136ca9c62ce9c915e426cff2f7.zip
use step attribute to point to the next step for a listbox entry in the wizard
scanning is now possible through the wizard
Diffstat (limited to 'lib/python/Screens')
-rw-r--r--lib/python/Screens/Satconfig.py5
-rw-r--r--lib/python/Screens/ScanSetup.py25
-rw-r--r--lib/python/Screens/Wizard.py40
3 files changed, 53 insertions, 17 deletions
diff --git a/lib/python/Screens/Satconfig.py b/lib/python/Screens/Satconfig.py
index 8748438a..f2cdaace 100644
--- a/lib/python/Screens/Satconfig.py
+++ b/lib/python/Screens/Satconfig.py
@@ -87,10 +87,13 @@ class NimSetup(Screen):
if (self["config"].getCurrent()[1].parent.enabled == True):
self["config"].handleKey(config.key[str(number)])
- def keySave(self):
+ def run(self):
for x in self["config"].list:
x[1].save()
nimmanager.sec.update()
+
+ def keySave(self):
+ self.run()
self.close()
def keyCancel(self):
diff --git a/lib/python/Screens/ScanSetup.py b/lib/python/Screens/ScanSetup.py
index 2f204b03..648e6e7f 100644
--- a/lib/python/Screens/ScanSetup.py
+++ b/lib/python/Screens/ScanSetup.py
@@ -301,9 +301,11 @@ class ScanSetup(Screen):
feid = config.scan.nims.value
# flags |= eComponentScan.scanSearchBAT
- self.session.openWithCallback(self.keyCancel, ServiceScan, tlist, feid, flags)
+ self.session.openWithCallback(self.doNothing, ServiceScan, tlist, feid, flags)
#self.close()
+ def doNothing(self):
+ pass
def keyCancel(self):
for x in self["config"].list:
@@ -312,7 +314,7 @@ class ScanSetup(Screen):
class ScanSimple(Screen):
- def keyOK(self):
+ def run(self):
print "start scan for sats:"
tlist = [ ]
for x in self.list:
@@ -321,8 +323,23 @@ class ScanSimple(Screen):
getInitialTransponderList(tlist, x[1].parent.configPath)
feid = 0 # FIXME
- self.session.openWithCallback(self.keyCancel, ServiceScan, tlist, feid, eComponentScan.scanNetworkSearch)
+ self.session.openWithCallback(self.doNothing, ServiceScan, tlist, feid, eComponentScan.scanNetworkSearch)
+
+ def keyGo(self):
+ print "start scan for sats:"
+ tlist = [ ]
+ for x in self.list:
+ if x[1].parent.value == 0:
+ print " " + str(x[1].parent.configPath)
+ getInitialTransponderList(tlist, x[1].parent.configPath)
+
+ feid = 0 # FIXME
+ self.session.openWithCallback(self.doNothing, ServiceScan, tlist, feid, eComponentScan.scanNetworkSearch)
+
+ def doNothing(self):
+ pass
+
def keyCancel(self):
self.close()
@@ -343,7 +360,7 @@ class ScanSimple(Screen):
self["actions"] = ActionMap(["SetupActions"],
{
- "ok": self.keyOK,
+ "ok": self.keyGo,
"cancel": self.keyCancel,
"left": self.keyLeft,
"right": self.keyRight,
diff --git a/lib/python/Screens/Wizard.py b/lib/python/Screens/Wizard.py
index b7c149dd..055bdf27 100644
--- a/lib/python/Screens/Wizard.py
+++ b/lib/python/Screens/Wizard.py
@@ -43,7 +43,7 @@ class WelcomeWizard(Screen, HelpableScreen):
elif (name == "text"):
self.wizard[self.lastStep]["text"] = str(attrs.get('value'))
elif (name == "listentry"):
- self.wizard[self.lastStep]["list"].append(str(attrs.get('caption')))
+ 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')))
@@ -99,16 +99,16 @@ class WelcomeWizard(Screen, HelpableScreen):
"right": self.right,
"up": self.up,
"down": self.down,
- #"1": self.keyNumberGlobal,
- #"2": self.keyNumberGlobal,
- #"3": self.keyNumberGlobal,
- #"4": self.keyNumberGlobal,
- #"5": self.keyNumberGlobal,
- #"6": self.keyNumberGlobal,
- #"7": self.keyNumberGlobal,
- #"8": self.keyNumberGlobal,
- #"9": self.keyNumberGlobal,
- #"0": self.keyNumberGlobal
+ "1": self.keyNumberGlobal,
+ "2": self.keyNumberGlobal,
+ "3": self.keyNumberGlobal,
+ "4": self.keyNumberGlobal,
+ "5": self.keyNumberGlobal,
+ "6": self.keyNumberGlobal,
+ "7": self.keyNumberGlobal,
+ "8": self.keyNumberGlobal,
+ "9": self.keyNumberGlobal,
+ "0": self.keyNumberGlobal
}, -1)
#self["actions"] = HelpableActionMap(self, "OkCancelActions",
@@ -117,6 +117,18 @@ class WelcomeWizard(Screen, HelpableScreen):
#})
def ok(self):
+ if (self.wizard[self.currStep]["config"]["screen"] != None):
+ self.configInstance.run()
+
+ if (len(self.wizard[self.currStep]["list"]) > 0):
+ nextStep = self.wizard[self.currStep]["list"][self["list"].l.getCurrentSelectionIndex()][1]
+ if nextStep == "end":
+ self.currStep = self.numSteps
+ elif nextStep == "next":
+ pass
+ else:
+ self.currStep = int(nextStep) - 1
+
if (self.currStep == self.numSteps): # wizard finished
config.misc.firstrun.value = 0;
config.misc.firstrun.save()
@@ -125,6 +137,10 @@ class WelcomeWizard(Screen, HelpableScreen):
self.currStep += 1
self.updateValues()
+ def keyNumberGlobal(self, number):
+ if (self.wizard[self.currStep]["config"]["screen"] != None):
+ self.configInstance.keyNumberGlobal(number)
+
def left(self):
if (self.wizard[self.currStep]["config"]["screen"] != None):
self.configInstance.keyLeft()
@@ -160,7 +176,7 @@ class WelcomeWizard(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, None))
+ self.list.append((x[0], None))
self["list"].l.setList(self.list)
self["config"].instance.setZPosition(1)