timezone handling: when there is no timezone, use UTC. ignore illegal config values
[enigma2.git] / lib / python / Components / SetupDevices.py
index fa7cd756713578a507bf064d41e976415ed44720..612bb8c8d46047498e394ee821f13addb509fbd3 100644 (file)
@@ -1,27 +1,20 @@
-import os
-
+#import os
 from config import config                              #global config instance
 from config import config                              #global config instance
-
 from config import configElement
 from config import ConfigSubsection
 from config import ConfigSlider
 from config import configSelection
 from config import configElement
 from config import ConfigSubsection
 from config import ConfigSlider
 from config import configSelection
-
-#temp. class for exhibition
-
-class LCD:
-       def __init__(self):
-               pass
-
-       def setBright(self, value):
-               os.system("lcddimm " + str(value * 10))
-
-       def setContrast(self, value):
-               os.system("lcdcontrast " + str(value * 6))
+from config import configText
+from Components.Timezones import timezones
 
 def InitSetupDevices():
 
 def InitSetupDevices():
+       
+       def timezoneNotifier(configElement):
+               timezones.activateTimezone(configElement.value)
+               
        config.timezone = ConfigSubsection();
        config.timezone = ConfigSubsection();
-       config.timezone.val = configElement("config.timezone.val", configSelection, 1, ("GMT", "GMT+1", "GMT+2", "GMT+3", "GMT+4", "GMT+5", "GMT+6", "GMT+7", "GMT+8", "GMT+9") );
+       config.timezone.val = configElement("config.timezone.val", configSelection, timezones.getDefaultTimezone(), timezones.getTimezoneList());
+       config.timezone.val.addNotifier(timezoneNotifier)
 
        config.rc = ConfigSubsection();
        config.rc.map = configElement("config.rc.map", configSelection, 0, ("Default", "Classic") );
 
        config.rc = ConfigSubsection();
        config.rc.map = configElement("config.rc.map", configSelection, 0, ("Default", "Classic") );
@@ -35,23 +28,6 @@ def InitSetupDevices():
        config.osd.contrast = configElement("config.osd.contrast", ConfigSlider, 5, "");
        config.osd.language = configElement("config.osd.language", configSelection, 0, ("English", "English US") );
 
        config.osd.contrast = configElement("config.osd.contrast", ConfigSlider, 5, "");
        config.osd.language = configElement("config.osd.language", configSelection, 0, ("English", "English US") );
 
-       config.lcd = ConfigSubsection();
-       config.lcd.bright = configElement("config.lcd.bright", ConfigSlider, 7, "");
-       config.lcd.contrast = configElement("config.lcd.contrast", ConfigSlider, 2, "");
-       config.lcd.standby = configElement("config.lcd.standby", ConfigSlider, 1, "");
-       config.lcd.invert = configElement("config.lcd.invert", configSelection, 1, ("Enable", "Disable") );
-
-       ilcd = LCD()
-
-       def setLCDbright(configElement):
-               ilcd.setBright(configElement.value);
-
-       def setLCDcontrast(configElement):
-               ilcd.setContrast(configElement.value);
-
-       config.lcd.bright.addNotifier(setLCDbright);
-       config.lcd.contrast.addNotifier(setLCDcontrast);
-
        config.parental = ConfigSubsection();
        config.parental.lock = configElement("config.parental.lock", configSelection, 1, ("Enable", "Disable") );
        config.parental.setuplock = configElement("config.parental.setuplock", configSelection, 1, ("Enable", "Disable") );
        config.parental = ConfigSubsection();
        config.parental.lock = configElement("config.parental.lock", configSelection, 1, ("Enable", "Disable") );
        config.parental.setuplock = configElement("config.parental.setuplock", configSelection, 1, ("Enable", "Disable") );
@@ -63,28 +39,3 @@ def InitSetupDevices():
        config.expert.skipconfirm = configElement("config.expert.skipconfirm", configSelection, 1, ("Enable", "Disable") );
        config.expert.hideerrors = configElement("config.expert.hideerrors", configSelection, 1, ("Enable", "Disable") );
        config.expert.autoinfo = configElement("config.expert.autoinfo", configSelection, 1, ("Enable", "Disable") );
        config.expert.skipconfirm = configElement("config.expert.skipconfirm", configSelection, 1, ("Enable", "Disable") );
        config.expert.hideerrors = configElement("config.expert.hideerrors", configSelection, 1, ("Enable", "Disable") );
        config.expert.autoinfo = configElement("config.expert.autoinfo", configSelection, 1, ("Enable", "Disable") );
-
-       config.sat = ConfigSubsection();
-       config.sat.satA = configElement("config.sat.satA", configSelection, 1, ("Disabled" ,"Astra 19.2", "Hotbird 13.0") );
-       config.sat.satB = configElement("config.sat.satB", configSelection, 0, ("Disabled" ,"Astra 19.2", "Hotbird 13.0") );
-       config.sat.diseqcA = configElement("config.sat.diseqcA", configSelection, 3, ("no DiSEqC", "DiSEqC 1.0", "DiSEqC 1.1", "DiSEqC 1.2") );
-       config.sat.diseqcB = configElement("config.sat.diseqcB", configSelection, 0, ("no DiSEqC", "DiSEqC 1.0", "DiSEqC 1.1", "DiSEqC 1.2") );
-       config.sat.posA = configElement("config.sat.posA", configSelection, 0, ("DiSEqC A", "DiSEqC B", "DiSEqC C", "DiSEqC D") );
-       config.sat.posB = configElement("config.sat.posB", configSelection, 1, ("DiSEqC A", "DiSEqC B", "DiSEqC C", "DiSEqC D") );
-
-       #config.blasel = ConfigSubsection();
-       #config.blasel.val = configElement("", configSelection, 0, ("bunt", "s/w", "gruen") );
-       #config.inputDevices.delay = configElement("config.inputDevices.delay", ConfigSlider, 3);
-
-       #this instance anywhere else needed?    
-       #iDevices = inputDevices();     
-       
-       #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);