diff options
| author | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2005-11-13 10:10:57 +0000 |
|---|---|---|
| committer | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2005-11-13 10:10:57 +0000 |
| commit | 425399841b2657846be038cd0ba8fe449a528691 (patch) | |
| tree | 0cba8bdf634525f68e5350a6812e28a147ef8373 /lib/python | |
| parent | 3d5ee66a7e80c61e431e74e821242e144e88f008 (diff) | |
| download | enigma2-425399841b2657846be038cd0ba8fe449a528691.tar.gz enigma2-425399841b2657846be038cd0ba8fe449a528691.zip | |
sanity checks for the timer
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/Components/config.py | 4 | ||||
| -rw-r--r-- | lib/python/Screens/TimerEntry.py | 15 |
2 files changed, 19 insertions, 0 deletions
diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index 9c7dcb29..040a9ee4 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -469,6 +469,10 @@ class configElement: self.notifierList = [ ] self.enabled = True self.loadData() + + def getConfigPath(self): + return self.configPath + def addNotifier(self, notifier): self.notifierList.append(notifier); notifier(self); diff --git a/lib/python/Screens/TimerEntry.py b/lib/python/Screens/TimerEntry.py index 50df93d3..d0515000 100644 --- a/lib/python/Screens/TimerEntry.py +++ b/lib/python/Screens/TimerEntry.py @@ -63,6 +63,21 @@ class TimerEntry(Screen): # FIXME some service-chooser needed here config.timerentry.service = configElement_nonSave("config.timerentry.service", configSelection, 0, ((str(self.timer.service_ref.getServiceName())),)) + config.timerentry.startdate.addNotifier(self.checkDate) + config.timerentry.enddate.addNotifier(self.checkDate) + + def checkDate(self, configElement): + if (configElement.getConfigPath() == "config.timerentry.startdate"): + if (config.timerentry.enddate.value < config.timerentry.startdate.value): + config.timerentry.enddate.value = config.timerentry.startdate.value + config.timerentry.enddate.change() + #FIXME invalidate the config-entry... for redrawing purposes - HOW? + if (configElement.getConfigPath() == "config.timerentry.enddate"): + if (config.timerentry.enddate.value < config.timerentry.startdate.value): + config.timerentry.startdate.value = config.timerentry.enddate.value + config.timerentry.startdate.change() + #FIXME invalidate the config-entry... for redrawing purposes - HOW? + def createSetup(self): self.list = [] self.list.append(getConfigListEntry("Description", config.timerentry.description)) |
