diff options
| author | Ronny Strutz <ronny.strutz@multimedia-labs.de> | 2005-08-28 23:13:58 +0000 |
|---|---|---|
| committer | Ronny Strutz <ronny.strutz@multimedia-labs.de> | 2005-08-28 23:13:58 +0000 |
| commit | 301bab11f8453a6899153b7be338a352803b22cb (patch) | |
| tree | 5df637e4d8812cb83f5073f5160625aee65c3937 /lib/python/Components | |
| parent | 1f5b1a20e4de369c197de1dae8fcb368e3e10b26 (diff) | |
| download | enigma2-301bab11f8453a6899153b7be338a352803b22cb.tar.gz enigma2-301bab11f8453a6899153b7be338a352803b22cb.zip | |
added setup screens
Diffstat (limited to 'lib/python/Components')
| -rw-r--r-- | lib/python/Components/Clock.py | 3 | ||||
| -rw-r--r-- | lib/python/Components/InputDevice.py | 4 | ||||
| -rw-r--r-- | lib/python/Components/Makefile.am | 3 | ||||
| -rw-r--r-- | lib/python/Components/__init__.py | 3 | ||||
| -rw-r--r-- | lib/python/Components/config.py | 39 |
5 files changed, 35 insertions, 17 deletions
diff --git a/lib/python/Components/Clock.py b/lib/python/Components/Clock.py index 3beed551..eba5ea27 100644 --- a/lib/python/Components/Clock.py +++ b/lib/python/Components/Clock.py @@ -21,7 +21,8 @@ class Clock(HTMLComponent, GUIComponent, VariableText): # "funktionalitaet" def doClock(self): t = time.localtime() - self.setText("%2d:%02d:%02d" % (t[3], t[4], t[5])) + #HACK use timezone settings + self.setText("%2d:%02d:%02d" % (t[3] + 2, t[4], t[5])) # realisierung als GUI def createWidget(self, parent): diff --git a/lib/python/Components/InputDevice.py b/lib/python/Components/InputDevice.py index 599dff34..eb88e650 100644 --- a/lib/python/Components/InputDevice.py +++ b/lib/python/Components/InputDevice.py @@ -17,8 +17,8 @@ class inputDevices: def InitInputDevices(): config.inputDevices = ConfigSubsection(); - config.inputDevices.repeat = configElement("config.inputDevices.repeat", ConfigSlider, 3); - config.inputDevices.delay = configElement("config.inputDevices.delay", ConfigSlider, 3); + config.inputDevices.repeat = configElement("config.inputDevices.repeat", ConfigSlider, 5, ""); + config.inputDevices.delay = configElement("config.inputDevices.delay", ConfigSlider, 4, ""); #this instance anywhere else needed? iDevices = inputDevices(); diff --git a/lib/python/Components/Makefile.am b/lib/python/Components/Makefile.am index 969077aa..88118ebf 100644 --- a/lib/python/Components/Makefile.am +++ b/lib/python/Components/Makefile.am @@ -6,6 +6,5 @@ install_DATA = \ Clock.py HTMLSkin.py ServiceList.py VariableText.py \ ConfigList.py Header.py ServiceName.py VariableValue.py \ EventInfo.py Label.py ServiceScan.py VolumeBar.py \ - GUIComponent.py MenuList.py TextInput.py __init__.py MovieList.py \ + GUIComponent.py MenuList.py TextInput.py __init__.py MovieList.py \ InputDevice.py ServicePosition.py - diff --git a/lib/python/Components/__init__.py b/lib/python/Components/__init__.py index 8453ced5..fb9eeaa4 100644 --- a/lib/python/Components/__init__.py +++ b/lib/python/Components/__init__.py @@ -3,5 +3,6 @@ __all__ = ["ActionMap", "Button", "Clock", "ConfigList", "EventInfo", "GUIComponent", "GUISkin", "HTMLComponent", "HTMLSkin", "Header", "Label", "MenuList", "PerServiceDisplay", "ProgressBar", "ServiceList", "ServiceName", "ServiceScan", "VariableText", "VariableValue", "VolumeBar", - "components", "config", "TimerList", "TimeInput", "MovieList", "ServicePosition" ] + "components", "config", "TimerList", "TimeInput", "MovieList", + "InputDevice", "ServicePosition" ] diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index 10296437..15119617 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -1,15 +1,31 @@ # temp stuff :) class configBoolean: - def __init__(self, reg): - self.reg = reg - self.val = 0 + def __init__(self, parent): + self.parent = parent + self.val = parent.value + self.vals = parent.vals + + def handleKey(self, key): + if key == 1: + self.val = self.val - 1 + if key == 2: + self.val = self.val + 1 + + if self.val < 0: + self.val = 0 + +# if self.val > 1: +# self.val = 1 - def toggle(self): - self.val += 1 - self.val %= 3 + def __call__(self): #needed by configlist - def __str__(self): - return ("NO", "YES", "MAYBE")[self.val] + print len(self.vals) + print self.val + + if(self.val > (len(self.vals) - 1)): + self.val = len(self.vals) - 1 + + return ("text",self.vals[self.val]) class configValue: def __init__(self, obj): @@ -48,7 +64,6 @@ class ConfigSlider: if self.val > 10: self.val = 10 - def __call__(self): #needed by configlist return ("slider", self.val * 10) @@ -57,10 +72,12 @@ class ConfigSubsection: pass class configElement: - def __init__(self, configPath, control, defaultValue): + def __init__(self, configPath, control, defaultValue, vals): self.configPath = configPath - self.value = 0 #read from registry else use default +# self.value = 0 #read from registry else use default + self.value = defaultValue #read from registry else use default self.controlType = control + self.vals = vals self.notifierList = [ ] def addNotifier(self, notifier): self.notifierList.append(notifier); |
