X-Git-Url: http://code.vuplus.com/gitweb/?a=blobdiff_plain;f=lib%2Fpython%2FScreens%2FTimeDateInput.py;h=d8e1f8a16971009f75173108cb59c8b21d8297da;hb=6d7673190e7fec573aed8e15e98d470cd4189d52;hp=4ea67b74619e60adc143ba55d7c4e1bdf7470a2f;hpb=7466abeda3437afb71ce9ab8c0917cd8ea14482c;p=vuplus_dvbapp diff --git a/lib/python/Screens/TimeDateInput.py b/lib/python/Screens/TimeDateInput.py index 4ea67b7..d8e1f8a 100644 --- a/lib/python/Screens/TimeDateInput.py +++ b/lib/python/Screens/TimeDateInput.py @@ -1,14 +1,14 @@ from Screen import Screen from Components.config import * from Components.ActionMap import ActionMap, NumberActionMap -from Components.ConfigList import ConfigList +from Components.ConfigList import ConfigList, ConfigListScreen from Components.Button import Button from Components.Label import Label from Components.Pixmap import Pixmap import time import datetime -class TimeDateInput(Screen): +class TimeDateInput(Screen, ConfigListScreen): def __init__(self, session): Screen.__init__(self, session) @@ -19,35 +19,22 @@ class TimeDateInput(Screen): self.createConfig() - self["actions"] = NumberActionMap(["SetupActions", "TextEntryActions"], + self["actions"] = NumberActionMap(["SetupActions"], { "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) + }, -2) self.list = [] - self["config"] = ConfigList(self.list) + ConfigListScreen.__init__(self, 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")) + nowtime = time.time() + self.timeinput_date = ConfigDateTime(default = nowtime, formatstring = (_("%d.%B %Y"), 86400)) +# self.timeinput_time = ConfigSequence(default = [int(time.strftime("%H", time.localtime(nowtime))), int(time.strftime("%M", time.localtime(nowtime)))] + assert False, "fixme" def createSetup(self, configlist): self.list = [] @@ -56,29 +43,15 @@ class TimeDateInput(Screen): 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])