diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2008-02-01 23:15:24 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2008-02-01 23:15:24 +0000 |
| commit | d89be097be4a9ac52166c5f47cc189c5522d3441 (patch) | |
| tree | 7da4329e4fa22017a7312da52bfe7b1df8a16a02 /lib/python/Components/RFmod.py | |
| parent | ec200e0207d0a5ddb91c9c6c4ab8ae1c8f33ecea (diff) | |
| download | enigma2-d89be097be4a9ac52166c5f47cc189c5522d3441.tar.gz enigma2-d89be097be4a9ac52166c5f47cc189c5522d3441.zip | |
add possibilty to hide menu entries when needed hardware is not available
Diffstat (limited to 'lib/python/Components/RFmod.py')
| -rw-r--r-- | lib/python/Components/RFmod.py | 65 |
1 files changed, 34 insertions, 31 deletions
diff --git a/lib/python/Components/RFmod.py b/lib/python/Components/RFmod.py index be088a53..a8f7c9f5 100644 --- a/lib/python/Components/RFmod.py +++ b/lib/python/Components/RFmod.py @@ -1,5 +1,6 @@ from config import config, ConfigSelection, ConfigSubsection, ConfigOnOff, ConfigSlider from enigma import eRFmod +from Components.SystemInfo import SystemInfo # CHECK ME. RFMOD_CHANNEL_MIN = 21 @@ -23,34 +24,36 @@ class RFmod: eRFmod.getInstance().setFinetune(value) def InitRFmod(): - - config.rfmod = ConfigSubsection() - config.rfmod.enable = ConfigOnOff(default=False) - config.rfmod.test = ConfigOnOff(default=False) - config.rfmod.sound = ConfigOnOff(default=True) - config.rfmod.soundcarrier = ConfigSelection(choices=[("4500","4.5 MHz"), ("5500", "5.5 MHz"), ("6000", "6.0 MHz"), ("6500", "6.5 MHz")], default="5500") - config.rfmod.channel = ConfigSelection(default = "36", choices = ["%d" % x for x in range(RFMOD_CHANNEL_MIN, RFMOD_CHANNEL_MAX)]) - config.rfmod.finetune = ConfigSlider(default=5, limits=(1, 10)) - - iRFmod = RFmod() - - def setFunction(configElement): - iRFmod.setFunction(configElement.value); - def setTestmode(configElement): - iRFmod.setTestmode(configElement.value); - def setSoundFunction(configElement): - iRFmod.setSoundFunction(configElement.value); - def setSoundCarrier(configElement): - iRFmod.setSoundCarrier(configElement.index); - def setChannel(configElement): - iRFmod.setChannel(int(configElement.value)); - def setFinetune(configElement): - iRFmod.setFinetune(configElement.value - 5); - - # this will call the "setup-val" initial - config.rfmod.enable.addNotifier(setFunction); - config.rfmod.test.addNotifier(setTestmode); - config.rfmod.sound.addNotifier(setSoundFunction); - config.rfmod.soundcarrier.addNotifier(setSoundCarrier); - config.rfmod.channel.addNotifier(setChannel); - config.rfmod.finetune.addNotifier(setFinetune); + detected = eRFmod.getInstance().detected() + SystemInfo["RfModulator"] = detected + if detected: + config.rfmod = ConfigSubsection() + config.rfmod.enable = ConfigOnOff(default=False) + config.rfmod.test = ConfigOnOff(default=False) + config.rfmod.sound = ConfigOnOff(default=True) + config.rfmod.soundcarrier = ConfigSelection(choices=[("4500","4.5 MHz"), ("5500", "5.5 MHz"), ("6000", "6.0 MHz"), ("6500", "6.5 MHz")], default="5500") + config.rfmod.channel = ConfigSelection(default = "36", choices = ["%d" % x for x in range(RFMOD_CHANNEL_MIN, RFMOD_CHANNEL_MAX)]) + config.rfmod.finetune = ConfigSlider(default=5, limits=(1, 10)) + + iRFmod = RFmod() + + def setFunction(configElement): + iRFmod.setFunction(configElement.value); + def setTestmode(configElement): + iRFmod.setTestmode(configElement.value); + def setSoundFunction(configElement): + iRFmod.setSoundFunction(configElement.value); + def setSoundCarrier(configElement): + iRFmod.setSoundCarrier(configElement.index); + def setChannel(configElement): + iRFmod.setChannel(int(configElement.value)); + def setFinetune(configElement): + iRFmod.setFinetune(configElement.value - 5); + + # this will call the "setup-val" initial + config.rfmod.enable.addNotifier(setFunction); + config.rfmod.test.addNotifier(setTestmode); + config.rfmod.sound.addNotifier(setSoundFunction); + config.rfmod.soundcarrier.addNotifier(setSoundCarrier); + config.rfmod.channel.addNotifier(setChannel); + config.rfmod.finetune.addNotifier(setFinetune); |
