1 from HTMLComponent import *
2 from GUIComponent import *
4 from Tools.FuzzyDate import FuzzyTime
6 from enigma import eListboxPythonMultiContent, eListbox, gFont
7 from timer import TimerEntry
22 # | <Service> <Name of the Timer> |
23 # | <start, end> <state> |
25 def TimerEntryComponent(timer, processed):
29 res.append((0, 0, 400, 30, 0, RT_HALIGN_LEFT, timer.service_ref.getServiceName()))
30 res.append((0, 30, 200, 20, 1, RT_HALIGN_LEFT, "%s, %s ... %s" % (FuzzyTime(timer.begin) + FuzzyTime(timer.end)[1:])))
32 res.append((300, 0, 200, 20, 1, RT_HALIGN_RIGHT, timer.description))
35 if timer.state == TimerEntry.StateWait:
37 elif timer.state == TimerEntry.StatePrepare:
38 state = "about to start"
39 elif timer.state == TimerEntry.StateRunning:
40 state = "recording..."
46 res.append((300, 30, 200, 20, 1, RT_HALIGN_RIGHT, state))
50 class TimerList(HTMLComponent, GUIComponent):
51 def __init__(self, list):
52 GUIComponent.__init__(self)
53 self.l = eListboxPythonMultiContent()
55 self.l.setFont(0, gFont("Arial", 20))
56 self.l.setFont(1, gFont("Arial", 18))
59 return self.l.getCurrentSelection()
61 def GUIcreate(self, parent):
62 self.instance = eListbox(parent)
63 self.instance.setContent(self.l)
64 self.instance.setItemHeight(50)
67 self.instance.setContent(None)