From: Stefan Pluecken Date: Sun, 13 Nov 2005 10:10:57 +0000 (+0000) Subject: sanity checks for the timer X-Git-Tag: 2.6.0~5269 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/425399841b2657846be038cd0ba8fe449a528691 sanity checks for the timer --- 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))