diff options
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/Screens/EventView.py | 22 | ||||
| -rw-r--r-- | lib/python/Screens/InfoBar.py | 6 | ||||
| -rw-r--r-- | lib/python/Screens/InfoBarGenerics.py | 43 |
3 files changed, 55 insertions, 16 deletions
diff --git a/lib/python/Screens/EventView.py b/lib/python/Screens/EventView.py index ba4ea57e..01695dfb 100644 --- a/lib/python/Screens/EventView.py +++ b/lib/python/Screens/EventView.py @@ -12,13 +12,17 @@ class EventViewBase: def __init__(self, Event, Ref, callback=None): self.cbFunc = callback self.currentService=Ref + self.isRecording = len(Ref.ref.getPath()) self.event = Event self["epg_description"] = ScrollLabel() self["datetime"] = Label() self["channel"] = Label() self["duration"] = Label() self["key_red"] = Button("") - self["key_green"] = Button(_("Add timer")) + if self.isRecording: + self["key_green"] = Button("") + else: + self["key_green"] = Button(_("Add timer")) self["key_yellow"] = Button("") self["key_blue"] = Button("") self["actions"] = ActionMap(["OkCancelActions", "EventViewActions"], @@ -46,8 +50,9 @@ class EventViewBase: self.cbFunc(self.setEvent, self.setService, +1) def timerAdd(self): - newEntry = RecordTimerEntry(self.currentService, *parseEvent(self.event)) - self.session.openWithCallback(self.timerEditFinished, TimerEntry, newEntry) + if not self.isRecording: + newEntry = RecordTimerEntry(self.currentService, *parseEvent(self.event)) + self.session.openWithCallback(self.timerEditFinished, TimerEntry, newEntry) def timerEditFinished(self, answer): if (answer[0]): @@ -57,11 +62,14 @@ class EventViewBase: def setService(self, service): self.currentService=service - name = self.currentService.getServiceName() - if name is not None: - self["channel"].setText(name) + if self.isRecording: + self["channel"].setText(_("Recording")) else: - self["channel"].setText(_("unknown service")) + name = self.currentService.getServiceName() + if name is not None: + self["channel"].setText(name) + else: + self["channel"].setText(_("unknown service")) def setEvent(self, event): self.event = event diff --git a/lib/python/Screens/InfoBar.py b/lib/python/Screens/InfoBar.py index 66996c6a..cfc35294 100644 --- a/lib/python/Screens/InfoBar.py +++ b/lib/python/Screens/InfoBar.py @@ -16,7 +16,7 @@ from Screens.InfoBarGenerics import InfoBarShowHide, \ InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarSeek, InfoBarInstantRecord, \ InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, \ InfoBarSubserviceSelection, InfoBarTuner, InfoBarShowMovies, InfoBarTimeshift, \ - InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport + InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView from Screens.HelpMenu import HelpableScreen, HelpMenu @@ -66,7 +66,7 @@ class InfoBar(Screen, InfoBarShowHide, InfoBarPowerKey, class MoviePlayer(Screen, InfoBarShowHide, InfoBarPowerKey, \ InfoBarMenu, \ InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications, - InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport): + InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView): def __init__(self, session, service): Screen.__init__(self, session) @@ -78,7 +78,7 @@ class MoviePlayer(Screen, InfoBarShowHide, InfoBarPowerKey, \ for x in HelpableScreen, InfoBarShowHide, InfoBarPowerKey, InfoBarMenu, \ InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, \ - InfoBarAudioSelection, InfoBarNotifications, \ + InfoBarAudioSelection, InfoBarNotifications, InfoBarSimpleEventView, \ InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport: x.__init__(self) diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index 308dcf1e..195f6d0a 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -18,7 +18,7 @@ from EpgSelection import EPGSelection from Screens.MessageBox import MessageBox from Screens.Dish import Dish from Screens.Standby import Standby -from Screens.EventView import EventViewEPGSelect +from Screens.EventView import EventViewEPGSelect, EventViewSimple from Screens.MinuteInput import MinuteInput from Components.Harddisk import harddiskmanager @@ -326,6 +326,35 @@ class InfoBarMenu: assert menu.tagName == "menu", "root element in menu must be 'menu'!" self.session.open(MainMenu, menu, menu.childNodes) +class InfoBarSimpleEventView: + """ Opens the Eventview for now/next """ + def __init__(self): + self["EPGActions"] = HelpableActionMap(self, "InfobarEPGActions", + { + "showEventInfo": (self.openEventView, _("show event details")), + }) + + def openEventView(self): + self.epglist = [ ] + service = self.session.nav.getCurrentService() + ref = self.session.nav.getCurrentlyPlayingServiceReference() + info = service.info() + ptr=info.getEvent(0) + if ptr: + self.epglist.append(ptr) + ptr=info.getEvent(1) + if ptr: + self.epglist.append(ptr) + if len(self.epglist) > 0: + self.session.open(EventViewSimple, self.epglist[0], ServiceReference(ref), self.eventViewCallback) + + def eventViewCallback(self, setEvent, setService, val): #used for now/next displaying + if len(self.epglist) > 1: + tmp = self.epglist[0] + self.epglist[0]=self.epglist[1] + self.epglist[1]=tmp + setEvent(self.epglist[0]) + class InfoBarEPG: """ EPG - Opens an EPG list when the showEPGList action fires """ def __init__(self): @@ -959,17 +988,19 @@ class InfoBarInstantRecord: event = None try: service = self.session.nav.getCurrentService() - info = service.info() - ev = info.getEvent(0) - event = ev + epg = eEPGCache.getInstance() + event = epg.lookupEventTime(serviceref, -1, 0) + if event is None: + info = service.info() + ev = info.getEvent(0) + event = ev except: pass - + if event is not None: data = parseEvent(event) begin = time.time() end = begin + 3600 * 10 - data = (begin, end, data[2], data[3], data[4]) else: data = (time.time(), time.time() + 3600 * 10, "instant record", "", None) |
