aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/TimerList.py7
-rw-r--r--lib/python/Screens/TimerEdit.py40
2 files changed, 43 insertions, 4 deletions
diff --git a/lib/python/Components/TimerList.py b/lib/python/Components/TimerList.py
index 8bb6a0d9..2750c7a7 100644
--- a/lib/python/Components/TimerList.py
+++ b/lib/python/Components/TimerList.py
@@ -4,8 +4,9 @@ from GUIComponent import *
from Tools.FuzzyDate import FuzzyTime
import time
-from enigma import eListboxPythonMultiContent, eListbox, gFont
+from enigma import eListboxPythonMultiContent, eListbox, gFont, loadPNG
from timer import TimerEntry
+from Tools.Directories import resolveFilename, SCOPE_SKIN_IMAGE
RT_HALIGN_LEFT = 0
RT_HALIGN_RIGHT = 1
@@ -58,6 +59,10 @@ def TimerEntryComponent(timer, processed):
state = "done!"
res.append((eListboxPythonMultiContent.TYPE_TEXT, 320, 50, 240, 20, 1, RT_HALIGN_RIGHT|RT_VALIGN_CENTER, state))
+
+ if timer.disabled:
+ png = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "/redx.png"))
+ res.append((eListboxPythonMultiContent.TYPE_PIXMAP, 490, 5, 40, 40, png))
return res
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[:]