diff options
| author | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2006-01-25 00:17:26 +0000 |
|---|---|---|
| committer | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2006-01-25 00:17:26 +0000 |
| commit | 6f09a61cf36eb3918574a74588bbeec6a829b084 (patch) | |
| tree | adeab7990ec6538a6dd68967b3542f47fb0f42ec /lib/python/Screens | |
| parent | db2f1b7b345f68095dfeac660fda2105efb485a7 (diff) | |
| download | enigma2-6f09a61cf36eb3918574a74588bbeec6a829b084.tar.gz enigma2-6f09a61cf36eb3918574a74588bbeec6a829b084.zip | |
added ability to diable timers (yellow button in the timer list)
FIXME: we need transparency for pixmaps in an eListboxPythonMultiContent
Diffstat (limited to 'lib/python/Screens')
| -rw-r--r-- | lib/python/Screens/TimerEdit.py | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/lib/python/Screens/TimerEdit.py b/lib/python/Screens/TimerEdit.py index 99939bd8..263af69f 100644 --- a/lib/python/Screens/TimerEdit.py +++ b/lib/python/Screens/TimerEdit.py @@ -26,16 +26,50 @@ class TimerEditList(Screen): self["key_yellow"] = Button("") self["key_blue"] = Button(_("Cleanup")) - self["actions"] = ActionMap(["OkCancelActions", "ShortcutActions", "TimerEditActions"], + self["actions"] = ActionMap(["OkCancelActions", "DirectionActions", "ShortcutActions", "TimerEditActions"], { "ok": self.openEdit, "cancel": self.leave, "red": self.removeTimer, "green": self.addCurrentTimer, "blue": self.cleanupQuestion, - "log": self.showLog - }) + "yellow": self.toggleDisabledState, + "log": self.showLog, + "left": self.left, + "right": self.right, + "up": self.up, + "down": self.down + }, -1) self.session.nav.RecordTimer.on_state_change.append(self.onStateChange) + self.onShown.append(self.updateState) + + def up(self): + self["timerlist"].instance.moveSelection(self["timerlist"].instance.moveUp) + self.updateState() + + def down(self): + self["timerlist"].instance.moveSelection(self["timerlist"].instance.moveDown) + self.updateState() + + def left(self): + self["timerlist"].instance.moveSelection(self["timerlist"].instance.pageUp) + self.updateState() + + def right(self): + self["timerlist"].instance.moveSelection(self["timerlist"].instance.pageDown) + self.updateState() + + def toggleDisabledState(self): + self["timerlist"].getCurrent()[0].disabled = not self["timerlist"].getCurrent()[0].disabled + self.updateState() + self.refill() + + def updateState(self): + if self["timerlist"].getCurrent()[0].disabled: + self["key_yellow"].setText(_("disable")) + else: + self["key_yellow"].setText(_("enable")) + self["key_yellow"].instance.invalidate() def fillTimerList(self): del self.list[:] |
