fill configlist with correct entries
[enigma2.git] / lib / python / Components / config.py
1 #  temp stuff :)
2 class configBoolean:
3         def __init__(self, reg):
4                 self.reg = reg
5                 self.val = 0
6         
7         def toggle(self):
8                 self.val += 1
9                 self.val %= 3
10         
11         def __str__(self):
12                 return ("NO", "YES", "MAYBE")[self.val]
13
14 class configValue:
15         def __init__(self, obj):
16                 self.obj = obj
17                 
18         def __str__(self):
19                 return self.obj
20
21 def configEntry(obj):
22         # das hier ist ein zugriff auf die registry...
23         if obj == "HKEY_LOCAL_ENIGMA/IMPORTANT/USER_ANNOYING_STUFF/SDTV/FLASHES/GREEN":
24                 return ("SDTV green flashes", configBoolean(obj))
25         elif obj == "HKEY_LOCAL_ENIGMA/IMPORTANT/USER_ANNOYING_STUFF/HDTV/FLASHES/GREEN":
26                 return ("HDTV reen flashes", configBoolean(obj))
27         else:
28                 return ("invalid", "")
29
30 class Config:
31         def __init__(self):
32                 pass
33         def Slider(self,reg):            # ok???
34                 pass    
35         def getControlType(self, reg):
36                 print "getControlType " + reg
37
38                 #find the correct type in class-members
39                 if reg == "blasel":
40                         return configBoolean(reg)
41
42                 return configBoolean(reg)
43                 
44 config = Config();
45
46 class ConfigSubsection:
47         def __init__(self):
48                 pass
49
50 class configElement:
51         def __init__(self, configPath, control, defaultValue):
52                 self.configPath = configPath
53                 self.value = 0  #read from registry else use default
54                 self.controlType = control
55                 self.notifierList = [ ]
56         def addNotifier(self, notifier):
57                 self.notifierList.append(notifier);
58                 notifier(self);