aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2008-07-09 16:20:27 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2008-07-09 16:20:27 +0000
commit7dd0844fdd708087461076e4da1c6bc7328ec3de (patch)
tree2c095f40a0f1796aebc712131d7edc6f27709ac3 /lib/python
parent250e846dc7fb2a3920e1aabd2430adb49fca5314 (diff)
downloadenigma2-7dd0844fdd708087461076e4da1c6bc7328ec3de.tar.gz
enigma2-7dd0844fdd708087461076e4da1c6bc7328ec3de.zip
fix configmode selection in sat config (not yet working 100% properly)
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/config.py9
-rw-r--r--lib/python/Screens/Satconfig.py10
2 files changed, 14 insertions, 5 deletions
diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py
index 8cb70987..1ccf3e37 100644
--- a/lib/python/Components/config.py
+++ b/lib/python/Components/config.py
@@ -213,6 +213,11 @@ class ConfigSelection(ConfigElement):
self.value = self.choices[0]
elif key == KEY_END:
self.value = self.choices[nchoices - 1]
+
+ def selectNext(self):
+ nchoices = len(self.choices)
+ i = self.choices.index(self.value)
+ self.value = self.choices[(i + 1) % nchoices]
def getText(self):
descr = self.description[self.value]
@@ -1364,6 +1369,10 @@ def getConfigListEntry(*args):
assert len(args) > 1, "getConfigListEntry needs a minimum of two arguments (descr, configElement)"
return args
+def updateConfigElement(element, newelement):
+ newelement.value = element.value
+ return newelement
+
#def _(x):
# return x
#
diff --git a/lib/python/Screens/Satconfig.py b/lib/python/Screens/Satconfig.py
index 7977d881..7cb59b3e 100644
--- a/lib/python/Screens/Satconfig.py
+++ b/lib/python/Screens/Satconfig.py
@@ -5,7 +5,7 @@ from Components.ActionMap import ActionMap
from Components.ConfigList import ConfigListScreen
from Components.MenuList import MenuList
from Components.NimManager import nimmanager, InitNimManager
-from Components.config import getConfigListEntry, config, ConfigNothing, ConfigSelection
+from Components.config import getConfigListEntry, config, ConfigNothing, ConfigSelection, updateConfigElement
from Screens.MessageBox import MessageBox
from time import mktime, localtime
@@ -60,7 +60,7 @@ class NimSetup(Screen, ConfigListScreen):
choices["satposdepends"] = _("second cable of motorized LNB")
if len(nimmanager.canConnectTo(self.slotid)) > 0:
choices["loopthrough"] = _("loopthrough to")
- self.nimConfig.configMode = ConfigSelection(choices = choices, default = "simple")
+ self.nimConfig.configMode = updateConfigElement(self.nimConfig.configMode, ConfigSelection(choices = choices, default = "simple"))
def createSetup(self):
print "Creating setup"
@@ -98,7 +98,7 @@ class NimSetup(Screen, ConfigListScreen):
for id in nimlist:
#choices.append((str(id), str(chr(65 + id))))
choices.append((str(id), nimmanager.getNimDescription(id)))
- self.nimConfig.connectedTo = ConfigSelection(choices = choices)
+ self.nimConfig.connectedTo = updateConfigElement(self.nimConfig.connectedTo, ConfigSelection(choices = choices))
self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
elif self.nimConfig.configMode.value == "satposdepends":
choices = []
@@ -106,7 +106,7 @@ class NimSetup(Screen, ConfigListScreen):
for id in nimlist:
#choices.append((str(id), str(chr(65 + id))))
choices.append((str(id), nimmanager.getNimDescription(id)))
- self.nimConfig.connectedTo = ConfigSelection(choices = choices)
+ self.nimConfig.connectedTo = updateConfigElement(self.nimConfig.connectedTo, ConfigSelection(choices = choices))
self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
elif self.nimConfig.configMode.value == "loopthrough":
choices = []
@@ -114,7 +114,7 @@ class NimSetup(Screen, ConfigListScreen):
connectable = nimmanager.canConnectTo(self.slotid)
for id in connectable:
choices.append((str(id), nimmanager.getNimDescription(id)))
- self.nimConfig.connectedTo = ConfigSelection(choices = choices)
+ self.nimConfig.connectedTo = updateConfigElement(self.nimConfig.connectedTo, ConfigSelection(choices = choices))
self.list.append(getConfigListEntry(_("Connected to"), self.nimConfig.connectedTo))
elif self.nimConfig.configMode.value == "nothing":
pass