diff options
| author | Ronny Strutz <ronny.strutz@multimedia-labs.de> | 2005-10-08 02:11:07 +0000 |
|---|---|---|
| committer | Ronny Strutz <ronny.strutz@multimedia-labs.de> | 2005-10-08 02:11:07 +0000 |
| commit | 20e411da4dda00404457eac47ca69a95cbbe2fe6 (patch) | |
| tree | 956d46cc993f2c365d3105badfb20dfbf64f364f | |
| parent | 67e8a7bf868725c2d6fec00675dc5320bbbeb6ff (diff) | |
| download | enigma2-20e411da4dda00404457eac47ca69a95cbbe2fe6.tar.gz enigma2-20e411da4dda00404457eac47ca69a95cbbe2fe6.zip | |
added config-callbacks for nimsetup
| -rw-r--r-- | lib/python/Components/NimManager.py | 55 |
1 files changed, 43 insertions, 12 deletions
diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 6af1e765..d2148326 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -11,6 +11,13 @@ from xml.dom import EMPTY_NAMESPACE from skin import elementsWithTag from Tools import XMLTools +class boundFunction: + def __init__(self, fnc, *args): + self.fnc = fnc + self.args = args + def __call__(self, *args): + self.fnc(*self.args + args) + class nimSlot: def __init__(self, slotid, nimtype, name): self.slotid = slotid @@ -87,9 +94,38 @@ class NimManager: list.append((nimText, slot)) return list + #callbacks for c++ config + def nimConfigModeChanged(self, slotid, mode): + print "nimConfigModeChanged set to " + str(mode) + def nimDiseqcModeChanged(self, slotid, mode): + print "nimDiseqcModeChanged set to " + str(mode) + def nimPortAChanged(self, slotid, val): + print "nimDiseqcA set to " + str(val) + def nimPortBChanged(self, slotid, val): + print "nimDiseqcB set to " + str(val) + def nimPortCChanged(self, slotid, val): + print "nimDiseqcC set to " + str(val) + def nimPortDChanged(self, slotid, val): + print "nimDiseqcD set to " + str(val) + + def InitNimManager(nimmgr): config.Nims = [ConfigSubsection()] * nimmgr.nimCount + def nimConfigModeChanged(slotid, configElement): + nimmgr.nimConfigModeChanged(slotid, configElement.value) + def nimDiseqcModeChanged(slotid, configElement): + nimmgr.nimDiseqcModeChanged(slotid, configElement.value) + + def nimPortAChanged(slotid, configElement): + nimmgr.nimPortAChanged(slotid, configElement.vals[configElement.value][1]) + def nimPortBChanged(slotid, configElement): + nimmgr.nimPortBChanged(slotid, configElement.vals[configElement.value][1]) + def nimPortCChanged(slotid, configElement): + nimmgr.nimPortCChanged(slotid, configElement.vals[configElement.value][1]) + def nimPortDChanged(slotid, configElement): + nimmgr.nimPortDChanged(slotid, configElement.vals[configElement.value][1]) + for slot in nimmgr.nimslots: x = slot.slotid cname = nimmgr.getConfigPrefix(x) @@ -101,19 +137,14 @@ def InitNimManager(nimmgr): config.Nims[x].diseqcB = configElement(cname + "diseqcB",configSatlist, 130, nimmgr.satList); config.Nims[x].diseqcC = configElement(cname + "diseqcC",configSatlist, 0, nimmgr.satList); config.Nims[x].diseqcD = configElement(cname + "diseqcD",configSatlist, 0, nimmgr.satList); + + config.Nims[x].configMode.addNotifier(boundFunction(nimConfigModeChanged,x)) + config.Nims[x].diseqcMode.addNotifier(boundFunction(nimDiseqcModeChanged,x)) + config.Nims[x].diseqcA.addNotifier(boundFunction(nimPortAChanged,x)) + config.Nims[x].diseqcB.addNotifier(boundFunction(nimPortBChanged,x)) + config.Nims[x].diseqcC.addNotifier(boundFunction(nimPortCChanged,x)) + config.Nims[x].diseqcD.addNotifier(boundFunction(nimPortDChanged,x)) else: print "pls add support for this frontend type!" - #def nimConfig - - #def inputDevicesRepeatChanged(configElement): - # iDevices.setRepeat(configElement.value); - - #def inputDevicesDelayChanged(configElement): - # iDevices.setDelay(configElement.value); - - # this will call the "setup-val" initial - #config.inputDevices.repeat.addNotifier(inputDevicesRepeatChanged); - #config.inputDevices.delay.addNotifier(inputDevicesDelayChanged); - nimmanager = NimManager() |
