diff options
| author | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2007-01-06 02:03:12 +0000 |
|---|---|---|
| committer | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2007-01-06 02:03:12 +0000 |
| commit | aad6753bde1688c05fbd3984b0e60eeda0e67034 (patch) | |
| tree | 9d27d53df95e72d4f18fb38a40d15cc39b5ccb0c /lib/python/Screens/TimerEdit.py | |
| parent | 2efda3eaac59699bc8e4f790d93bf182077f7bd3 (diff) | |
| download | enigma2-aad6753bde1688c05fbd3984b0e60eeda0e67034.tar.gz enigma2-aad6753bde1688c05fbd3984b0e60eeda0e67034.zip | |
add ability to stop currently running repeated timer when disabling it
Diffstat (limited to 'lib/python/Screens/TimerEdit.py')
| -rw-r--r-- | lib/python/Screens/TimerEdit.py | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/lib/python/Screens/TimerEdit.py b/lib/python/Screens/TimerEdit.py index 5532dc83..babf28fe 100644 --- a/lib/python/Screens/TimerEdit.py +++ b/lib/python/Screens/TimerEdit.py @@ -1,15 +1,17 @@ -from Screen import Screen -from Components.TimerList import TimerList, TimerEntryComponent -from Components.MenuList import MenuList from Components.ActionMap import ActionMap -from Components.Label import Label from Components.Button import Button +from Components.Label import Label +from Components.MenuList import MenuList +from Components.TimerList import TimerList, TimerEntryComponent +from Components.TimerSanityCheck import TimerSanityCheck +from RecordTimer import RecordTimerEntry, parseEvent, AFTEREVENT +from Screen import Screen +from Screens.ChoiceBox import ChoiceBox from Screens.MessageBox import MessageBox +from ServiceReference import ServiceReference from TimerEntry import TimerEntry, TimerLog -from RecordTimer import RecordTimerEntry, parseEvent, AFTEREVENT +from Tools.BoundFunction import boundFunction from time import * -from ServiceReference import ServiceReference -from Components.TimerSanityCheck import TimerSanityCheck class TimerEditList(Screen): def __init__(self, session): @@ -66,10 +68,31 @@ class TimerEditList(Screen): if t.disabled: t.enable() + self.session.nav.RecordTimer.timeChanged(t) + else: - t.disable() + if t.isRunning() and t.repeated: + list = [] + list.append((_("Stop current event but not coming events"), "stoponlycurrent")) + list.append((_("Stop current event and disable coming events"), "stopall")) + list.append((_("Don't stop current event but disable coming events"), "stoponlycoming")) + self.session.openWithCallback(boundFunction(self.runningEventCallback, t), ChoiceBox, title=_("Repeating event currently recording... What do you want to do?"), list = list) + else: + t.disable() + self.session.nav.RecordTimer.timeChanged(t) + self.updateState() + self.refill() + def runningEventCallback(self, t, result): + if result is not None: + if result[1] == "stoponlycurrent" or result[1] == "stopall": + t.enable() + t.processRepeated(findRunningEvent = False) + self.session.nav.RecordTimer.doActivate(t) + if result[1] == "stoponlycoming" or result[1] == "stopall": + t.disable() self.session.nav.RecordTimer.timeChanged(t) + self.updateState() self.refill() |
