from Screen import Screen
+import ChannelSelection
+from ServiceReference import ServiceReference
from Components.config import *
from Components.ActionMap import NumberActionMap
from Components.ConfigList import ConfigList
from Components.Label import Label
import time
import datetime
-from math import log
class TimerEntry(Screen):
def __init__(self, session, timer):
Screen.__init__(self, session)
self.timer = timer;
+
+ self["ok"] = Label("OK")
+ self["cancel"] = Label("Cancel")
self.createConfig()
self["actions"] = NumberActionMap(["SetupActions"],
{
- "ok": self.keyGo,
+ "ok": self.keySelect,
+ "save": self.keyGo,
"cancel": self.keyCancel,
"left": self.keyLeft,
"right": self.keyRight,
self.list.append(getConfigListEntry("EndDate", config.timerentry.enddate))
self.list.append(getConfigListEntry("EndTime", config.timerentry.endtime))
- self.list.append(getConfigListEntry("Channel", config.timerentry.service))
+ self.list.append(getConfigListEntry(_("Channel"), config.timerentry.service))
self["config"].list = self.list
self["config"].l.setList(self.list)
def keyRight(self):
self["config"].handleKey(config.key["nextElement"])
self.newConfig()
+
+ def keySelect(self):
+ if self["config"].getCurrent()[0] == _("Channel"):
+ self.session.openWithCallback(self.finishedChannelSelection, ChannelSelection.SimpleChannelSelection, _("Select channel to record from"))
+
+ def finishedChannelSelection(self, args):
+ self.timer.service_ref = ServiceReference(args)
+ config.timerentry.service.vals = (str(self.timer.service_ref.getServiceName()),)
+ self["config"].invalidate(config.timerentry.service)
def keyNumberGlobal(self, number):
print "You pressed number " + str(number)