diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-04-27 09:22:18 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-04-27 09:22:18 +0000 |
| commit | c803490aec2d7c7f13966e1a2e926cac018dea2e (patch) | |
| tree | f50fbd414676fb98851254030d535dd15a7c7c72 /lib/python/Screens/InfoBarGenerics.py | |
| parent | 59cee6bc80d4697bec7bebb8dd65312bddec34ad (diff) | |
| download | enigma2-c803490aec2d7c7f13966e1a2e926cac018dea2e.tar.gz enigma2-c803490aec2d7c7f13966e1a2e926cac018dea2e.zip | |
make bouquet +/- useable in multiepg to change directly from one to another bouquet epg
Diffstat (limited to 'lib/python/Screens/InfoBarGenerics.py')
| -rw-r--r-- | lib/python/Screens/InfoBarGenerics.py | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index d826dedf..9daea0b9 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -343,6 +343,7 @@ 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...")), @@ -358,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: @@ -370,15 +370,33 @@ 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.dlg_stack.append(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, None, self.changeBouquetCB) + + def changeBouquetCB(self, direction, epg): + if self.bouquetSel: + if direction > 0: + self.bouquetSel.down() else: - self.session.open(EPGSelection, services, self.zapToService) + 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): - self.dlg_stack.pop() + closedScreen = self.dlg_stack.pop() + if self.bouquetSel and closedScreen == self.bouquetSel: + self.bouquetSel = None if ret: dlgs=len(self.dlg_stack) assert dlgs>0 @@ -392,9 +410,10 @@ class InfoBarEPG: cnt = len(bouquets) if cnt > 1: # show bouquet list if withCallback: - self.dlg_stack.append(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) |
