X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/41c1cbf33fec98ed50973390d0500fe5522d82d6..3c0244c041cbfda462b2c84132410d5ffa3232da:/lib/python/Screens/InfoBarGenerics.py diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index e296038b..9a884449 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -342,6 +342,8 @@ class InfoBarSimpleEventView: class InfoBarEPG: """ EPG - Opens an EPG list when the showEPGList action fires """ def __init__(self): + self.dlg_stack = [ ] + self.bouquetSel = None self["EPGActions"] = HelpableActionMap(self, "InfobarEPGActions", { "showEventInfo": (self.openEventView, _("show EPG...")), @@ -357,8 +359,7 @@ class InfoBarEPG: self.servicelist.setCurrentSelection(service) #select the service in servicelist self.servicelist.zap() - def openBouquetEPG(self, bouquet, withCallback=True): - ptr=eEPGCache.getInstance() + def getBouquetServices(self, bouquet): services = [ ] servicelist = eServiceCenter.getInstance().list(bouquet) if not servicelist is None: @@ -369,16 +370,37 @@ class InfoBarEPG: if service.flags: #ignore non playable services continue services.append(ServiceReference(service)) + return services + + def openBouquetEPG(self, bouquet, withCallback=True): + services = self.getBouquetServices(bouquet) if len(services): self.epg_bouquet = bouquet if withCallback: - self.session.openWithCallback(self.closed, EPGSelection, services, self.zapToService) + self.dlg_stack.append(self.session.openWithCallback(self.closed, EPGSelection, services, self.zapToService, None, self.changeBouquetCB)) else: - self.session.open(EPGSelection, services, self.zapToService) + self.session.open(EPGSelection, services, self.zapToService, None, self.changeBouquetCB) - def closed(self, ret): + def changeBouquetCB(self, direction, epg): + if self.bouquetSel: + if direction > 0: + self.bouquetSel.down() + else: + self.bouquetSel.up() + bouquet = self.bouquetSel.getCurrent() + services = self.getBouquetServices(bouquet) + if len(services): + self.epg_bouquet = bouquet + epg.setServices(services) + + def closed(self, ret=False): + closedScreen = self.dlg_stack.pop() + if self.bouquetSel and closedScreen == self.bouquetSel: + self.bouquetSel = None if ret: - self.close(ret) + dlgs=len(self.dlg_stack) + assert dlgs>0 + self.dlg_stack[dlgs-1].close(dlgs > 1) def openMultiServiceEPG(self, withCallback=True): bouquets = self.servicelist.getBouquetList() @@ -388,16 +410,19 @@ class InfoBarEPG: cnt = len(bouquets) if cnt > 1: # show bouquet list if withCallback: - self.session.openWithCallback(self.closed, BouquetSelector, bouquets, self.openBouquetEPG) + self.bouquetSel = self.session.openWithCallback(self.closed, BouquetSelector, bouquets, self.openBouquetEPG, enableWrapAround=True) + self.dlg_stack.append(self.bouquetSel) else: - self.session.open(BouquetSelector, bouquets, self.openBouquetEPG) + self.bouquetSel = self.session.open(BouquetSelector, bouquets, self.openBouquetEPG, enableWrapAround=True) elif cnt == 1: self.openBouquetEPG(bouquets[0][1], withCallback) def openSingleServiceEPG(self): ref=self.session.nav.getCurrentlyPlayingServiceReference() - ptr=eEPGCache.getInstance() - self.session.openWithCallback(self.closed, EPGSelection, ref) + self.session.open(EPGSelection, ref) + + def openSimilarList(self, eventid, refstr): + self.session.open(EPGSelection, refstr, None, eventid) def openEventView(self): self.epglist = [ ] @@ -419,7 +444,7 @@ class InfoBarEPG: if ptr: self.epglist.append(ptr) if len(self.epglist) > 0: - self.session.open(EventViewEPGSelect, self.epglist[0], ServiceReference(ref), self.eventViewCallback, self.openSingleServiceEPG, self.openMultiServiceEPG) + self.dlg_stack.append(self.session.openWithCallback(self.closed, EventViewEPGSelect, self.epglist[0], ServiceReference(ref), self.eventViewCallback, self.openSingleServiceEPG, self.openMultiServiceEPG, self.openSimilarList)) else: print "no epg for the service avail.. so we show multiepg instead of eventinfo" self.openMultiServiceEPG(False) @@ -561,7 +586,7 @@ class InfoBarSeek: def getSeek(self): service = self.session.nav.getCurrentService() if service is None: - return False + return None seek = service.seek() @@ -857,7 +882,7 @@ class InfoBarTimeshift: def getTimeshift(self): service = self.session.nav.getCurrentService() - return service.timeshift() + return service and service.timeshift() def startTimeshift(self): print "enable timeshift" @@ -993,6 +1018,7 @@ class InfoBarExtensions: elif answer[1] == "pipoff": #self.pip.hide() + self.pipservice = None del self.pip self.pipshown = False @@ -1182,9 +1208,9 @@ class InfoBarAdditionalInfo: self.onLayoutFinish.append(self["ButtonYellowText"].update) self["ButtonBlue"] = PixmapConditional(withTimer = False) - self["ButtonBlue"].setConnect(lambda: False) + self["ButtonBlue"].setConnect(lambda: True) self["ButtonBlueText"] = LabelConditional(text = _("Extensions"), withTimer = False) - self["ButtonBlueText"].setConnect(lambda: False) + self["ButtonBlueText"].setConnect(lambda: True) self.onLayoutFinish.append(self["ButtonBlue"].update) self.onLayoutFinish.append(self["ButtonBlueText"].update)