From: Stefan Pluecken Date: Thu, 26 Jun 2008 11:02:55 +0000 (+0000) Subject: allow better and smarter configuration for > 2 nims X-Git-Tag: 2.6.0~1101 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/b540dcd4b6df8789cf4a515593e42f62bf9424e0 allow better and smarter configuration for > 2 nims --- diff --git a/lib/python/Screens/Satconfig.py b/lib/python/Screens/Satconfig.py index 398a13e1..b1757807 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 -from Components.config import getConfigListEntry, config, ConfigNothing +from Components.config import getConfigListEntry, config, ConfigNothing, ConfigSelection from Screens.MessageBox import MessageBox from time import mktime, localtime @@ -46,7 +46,7 @@ class NimSetup(Screen, ConfigListScreen): if nim.powerMeasurement.value: nim.powerMeasurement.value = False nim.powerMeasurement.save() - + def createSetup(self): print "Creating setup" self.list = [ ] @@ -77,7 +77,23 @@ class NimSetup(Screen, ConfigListScreen): self.createSimpleSetup(self.list, self.nimConfig.diseqcMode.value) if self.nimConfig.diseqcMode.value == "positioner": self.createPositionerSetup(self.list) - elif self.nimConfig.configMode.value in ["loopthrough", "satposdepends", "nothing", "equal"]: + elif self.nimConfig.configMode.value in ["satposdepends", "equal"]: + choices = [] + nimlist = nimmanager.getNimListOfType(self.nim.type, exception = self.nim.slot) + 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.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo)) + elif self.nimConfig.configMode.value == "loopthrough": + choices = [] + print "connectable to:", nimmanager.connectableTo(self.slotid) + connectable = nimmanager.connectableTo(self.slotid) + for id in connectable: + choices.append((str(id), nimmanager.getNimDescription(id))) + self.nimConfig.connectedTo = ConfigSelection(choices = choices) + self.list.append(getConfigListEntry(_("Connected to"), self.nimConfig.connectedTo)) + elif self.nimConfig.configMode.value == "nothing": pass elif self.nimConfig.configMode.value == "advanced": # advanced # SATs @@ -288,6 +304,7 @@ class NimSetup(Screen, ConfigListScreen): "cancel": self.keyCancel, }, -2) + self.slotid = slotid self.nim = nimmanager.nim_slots[slotid] self.nimConfig = self.nim.config self.createSetup()