Follow API improvements
[enigma2.git] / lib / python / Components / SetupDevices.py
1 import os
2
3 from config import config                               #global config instance
4
5 from config import configElement
6 from config import ConfigSubsection
7 from config import ConfigSlider
8 from config import configSelection
9
10 #temp. class for exhibition
11
12 class LCD:
13         def __init__(self):
14                 pass
15
16         def setBright(self, value):
17                 os.system("lcddimm " + str(value * 10))
18
19         def setContrast(self, value):
20                 os.system("lcdcontrast " + str(value * 6))
21
22 def InitSetupDevices():
23         config.timezone = ConfigSubsection();
24         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") );
25
26         config.rc = ConfigSubsection();
27         config.rc.map = configElement("config.rc.map", configSelection, 0, ("Default", "Classic") );
28
29         config.keyboard = ConfigSubsection();
30         config.keyboard.keymap = configElement("config.keyboard.keymap", configSelection, 1, ("English", "German") );
31
32         config.osd = ConfigSubsection();
33         config.osd.alpha = configElement("config.osd.alpha", ConfigSlider, 0, "");
34         config.osd.bright = configElement("config.osd.bright", ConfigSlider, 5, "");
35         config.osd.contrast = configElement("config.osd.contrast", ConfigSlider, 5, "");
36         config.osd.language = configElement("config.osd.language", configSelection, 0, ("English", "English US") );
37
38         config.lcd = ConfigSubsection();
39         config.lcd.bright = configElement("config.lcd.bright", ConfigSlider, 7, "");
40         config.lcd.contrast = configElement("config.lcd.contrast", ConfigSlider, 2, "");
41         config.lcd.standby = configElement("config.lcd.standby", ConfigSlider, 1, "");
42         config.lcd.invert = configElement("config.lcd.invert", configSelection, 1, ("Enable", "Disable") );
43
44         ilcd = LCD()
45
46         def setLCDbright(configElement):
47                 ilcd.setBright(configElement.value);
48
49         def setLCDcontrast(configElement):
50                 ilcd.setContrast(configElement.value);
51
52         config.lcd.bright.addNotifier(setLCDbright);
53         config.lcd.contrast.addNotifier(setLCDcontrast);
54
55         config.parental = ConfigSubsection();
56         config.parental.lock = configElement("config.parental.lock", configSelection, 1, ("Enable", "Disable") );
57         config.parental.setuplock = configElement("config.parental.setuplock", configSelection, 1, ("Enable", "Disable") );
58
59         config.expert = ConfigSubsection();
60         config.expert.splitsize = configElement("config.expert.splitsize", configSelection, 1, ("0.5Gbyte", "1.0 GByte", "1.5 GByte", "2.0 GByte") );
61         config.expert.satpos = configElement("config.expert.satpos", configSelection, 1, ("Enable", "Disable") );
62         config.expert.fastzap = configElement("config.expert.fastzap", configSelection, 0, ("Enable", "Disable") );
63         config.expert.skipconfirm = configElement("config.expert.skipconfirm", configSelection, 1, ("Enable", "Disable") );
64         config.expert.hideerrors = configElement("config.expert.hideerrors", configSelection, 1, ("Enable", "Disable") );
65         config.expert.autoinfo = configElement("config.expert.autoinfo", configSelection, 1, ("Enable", "Disable") );