removed c/Confif confusion
[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):                # ok???
34                 pass    
35
36 config = Config();
37
38 class ConfigSubsection:
39         def __init__(self):
40                 pass
41
42 class configElement:
43         def __init__(self, configPath, control, defaultValue):
44                 self.configPath = configPath
45                 self.value = 0  #read from registry else use default
46                 self.controlType = control
47                 self.notifierList = [ ]
48         def addNotifier(self, notifier):
49                 self.notifierList.append(notifier);
50                 notifier(self);