<key id="KEY_YELLOW" mapto="yellow" flags="mr" />
<key id="KEY_BLUE" mapto="blue" flags="mr" />
<key id="KEY_INFO" mapto="info" flags="m" />
+ <key id="KEY_MENU" mapto="input_date_time" flags="m" />
</map>
<map context="EventViewActions">
<widget name="timeshift" position="0,30" size="150,30" font="Regular;25" halign="center"
backgroundColor="transpBlack" foregroundColor="white" />
</screen>
+ <screen name="TimeDateInput" position="150,150" size="400,200" title="Time/Date Input">
+ <widget name="config" position="5,10" size="380,150" />
+ <widget name="ok" position="110,165" size="53,30" pixmap="ok.png" />
+ <widget name="oktext" position="110,165" size="53,30" valign="center" halign="center" zPosition="2" font="Regular;20" transparent="1" />
+ <widget name="cancel" position="210,165" size="100,30" pixmap="cancel.png" />
+ <widget name="canceltext" position="210,165" size="100,30" valign="center" halign="center" zPosition="2" font="Regular;20" transparent="1" />
+ </screen>
+
<screen name="MessageBox" position="60,300" size="600,10" title="Message">
<widget name="text" position="60,10" size="520,0" font="Regular;22" />
<widget name="ErrorPixmap" pixmap="error.png" position="0,0" zPosition="3" size="53,53" alphatest="on" transparent="1" />
return self.epgcache.lookupEvent(list)
return [ ]
- def fillMultiEPG(self, services):
+ def fillMultiEPG(self, services, stime=-1):
t = time()
test = [ '0RIBDTCN' ]
for service in services:
- tuple = ( service.ref.toString(), 0 )
+ tuple = (service.ref.toString(), 0, stime)
test.append( tuple )
self.list = self.queryEPG(test)
self.l.setList(self.list)
from Components.ActionMap import ActionMap
from Components.ScrollLabel import ScrollLabel
from Screens.EventView import EventViewSimple
+from TimeDateInput import TimeDateInput
from enigma import eServiceReference, eServiceEventPtr
from Screens.FixedMenu import FixedMenu
from RecordTimer import RecordTimerEntry, parseEvent
class EPGSelection(Screen):
def __init__(self, session, service, zapFunc=None, eventid=None):
Screen.__init__(self, session)
+ self.asked_specific_time = False
self["key_red"] = Button("")
self.closeRecursive = False
if isinstance(service, str) and eventid != None:
"yellow": self.yellowButtonPressed,
"blue": self.blueButtonPressed,
"info": self.infoKeyPressed,
- "zapTo": self.zapTo
+ "zapTo": self.zapTo,
+ "input_date_time": self.enterDateTime
})
self["actions"].csel = self
self.onLayoutFinish.append(self.onCreate)
+ def enterDateTime(self):
+ self.session.openWithCallback(self.onDateTimeInputClosed, TimeDateInput)
+
+ def onDateTimeInputClosed(self, ret):
+ if len(ret) > 1:
+ if ret[0]:
+ self.asked_specific_time=True
+ self["list"].fillMultiEPG(self.services, ret[1])
+
def closeScreen(self):
self.close(self.closeRecursive)
self["list"].moveDown()
def applyButtonState(self, state):
- if state == 1:
- self["now_button_sel"].show()
+ if state == 0:
self["now_button"].hide()
- else:
- self["now_button"].show()
self["now_button_sel"].hide()
-
- if state == 2:
- self["next_button_sel"].show()
self["next_button"].hide()
- else:
- self["next_button"].show()
self["next_button_sel"].hide()
-
- if state == 3:
- self["more_button_sel"].show()
self["more_button"].hide()
- else:
- self["more_button"].show()
self["more_button_sel"].hide()
+ self["now_text"].hide()
+ self["next_text"].hide()
+ self["more_text"].hide()
+ else:
+ if state == 1:
+ self["now_button_sel"].show()
+ self["now_button"].hide()
+ else:
+ self["now_button"].show()
+ self["now_button_sel"].hide()
+
+ if state == 2:
+ self["next_button_sel"].show()
+ self["next_button"].hide()
+ else:
+ self["next_button"].show()
+ self["next_button_sel"].hide()
+
+ if state == 3:
+ self["more_button_sel"].show()
+ self["more_button"].hide()
+ else:
+ self["more_button"].show()
+ self["more_button_sel"].hide()
def onSelectionChanged(self):
if self.type == EPG_TYPE_MULTI:
count = self["list"].getCurrentChangeCount()
- if count > 1:
+ if self.asked_specific_time:
+ self.applyButtonState(0)
+ elif count > 1:
self.applyButtonState(3)
elif count > 0:
self.applyButtonState(2)
Dish.py SubserviceSelection.py LanguageSelection.py StartWizard.py \
TutorialWizard.py PluginBrowser.py MinuteInput.py Scart.py PVRState.py \
Console.py InputBox.py ChoiceBox.py SimpleSummary.py ImageWizard.py \
- MediaPlayer.py TimerSelection.py PictureInPicture.py
+ MediaPlayer.py TimerSelection.py PictureInPicture.py TimeDateInput.py
--- /dev/null
+from Screen import Screen
+from Components.config import *
+from Components.ActionMap import ActionMap, NumberActionMap
+from Components.ConfigList import ConfigList
+from Components.Button import Button
+from Components.Label import Label
+from Components.Pixmap import Pixmap
+import time
+import datetime
+
+class TimeDateInput(Screen):
+ def __init__(self, session):
+ Screen.__init__(self, session)
+
+ self["oktext"] = Label(_("OK"))
+ self["canceltext"] = Label(_("Cancel"))
+ self["ok"] = Pixmap()
+ self["cancel"] = Pixmap()
+
+ self.createConfig()
+
+ self["actions"] = NumberActionMap(["SetupActions", "TextEntryActions"],
+ {
+ "ok": self.keySelect,
+ "save": self.keyGo,
+ "cancel": self.keyCancel,
+ "left": self.keyLeft,
+ "right": self.keyRight,
+ "delete": self.keyDelete,
+ "1": self.keyNumberGlobal,
+ "2": self.keyNumberGlobal,
+ "3": self.keyNumberGlobal,
+ "4": self.keyNumberGlobal,
+ "5": self.keyNumberGlobal,
+ "6": self.keyNumberGlobal,
+ "7": self.keyNumberGlobal,
+ "8": self.keyNumberGlobal,
+ "9": self.keyNumberGlobal,
+ "0": self.keyNumberGlobal
+ }, -1)
+
+ self.list = []
+ self["config"] = ConfigList(self.list)
+ self.createSetup(self["config"])
+
+ def createConfig(self):
+ config.timeinput = ConfigSubsection()
+ nowtime = time.time()
+ config.timeinput.date = configElement_nonSave("config.timeinput.date", configDateTime, nowtime, (_("%d.%B %Y"), 86400))
+ config.timeinput.time = configElement_nonSave("config.timeinput.time", configSequence, [int(time.strftime("%H", time.localtime(nowtime))), int(time.strftime("%M", time.localtime(nowtime)))], configsequencearg.get("CLOCK"))
+
+ def createSetup(self, configlist):
+ self.list = []
+ self.list.append(getConfigListEntry(_("Date"), config.timeinput.date))
+ self.list.append(getConfigListEntry(_("Time"), config.timeinput.time))
+ configlist.list = self.list
+ configlist.l.setList(self.list)
+
+ def keyLeft(self):
+ self["config"].handleKey(config.key["prevElement"])
+
+ def keyDelete(self):
+ self["config"].handleKey(config.key["delete"])
+
+ def keyRightCallback(self, configPath):
+ currentConfigPath = self["config"].getCurrent()[1].parent.getConfigPath()
+ # check if we are still on the same config entry
+ if (currentConfigPath == configPath):
+ self.keyRight()
+
+ def keyRight(self):
+ self["config"].handleKey(config.key["nextElement"])
+
+ def keySelect(self):
+ self.keyGo()
+
+ def keyNumberGlobal(self, number):
+ print "You pressed number " + str(number)
+ if (self["config"].getCurrent()[1].parent.enabled == True):
+ self["config"].handleKey(config.key[str(number)])
+
+ def getTimestamp(self, date, mytime):
+ d = time.localtime(date)
+ dt = datetime.datetime(d.tm_year, d.tm_mon, d.tm_mday, mytime[0], mytime[1])
+ return int(mktime(dt.timetuple()))
+
+ def keyGo(self):
+ time = self.getTimestamp(config.timeinput.date.value, config.timeinput.time.value)
+ self.close((True, time))
+
+ def keyCancel(self):
+ self.close((False,))