diff options
| -rwxr-xr-x | data/setup.xml | 1 | ||||
| -rw-r--r-- | lib/python/Components/UsageConfig.py | 2 | ||||
| -rw-r--r-- | lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py | 40 | ||||
| -rw-r--r-- | lib/python/Screens/ChannelSelection.py | 18 | ||||
| -rw-r--r-- | lib/python/Screens/InfoBarGenerics.py | 23 |
5 files changed, 75 insertions, 9 deletions
diff --git a/data/setup.xml b/data/setup.xml index 5f7cbf60..86207094 100755 --- a/data/setup.xml +++ b/data/setup.xml @@ -28,6 +28,7 @@ <item level="2" text="Load Length of Movies in Movielist">config.usage.load_length_of_movies_in_moviellist</item> <item level="1" text="Show positioner movement">config.usage.showdish</item> <item level="1" text="Enable multiple bouquets">config.usage.multibouquet</item> + <item level="1" text="Multi-EPG bouquet selection">config.usage.multiepg_ask_bouquet</item> <item level="1" text="Change bouquets in quickzap">config.usage.quickzap_bouquet_change</item> <item level="1" text="Alternative radio mode">config.usage.e1like_radio_mode</item> <item level="1" text="Action on long powerbutton press">config.usage.on_long_powerpress</item> diff --git a/lib/python/Components/UsageConfig.py b/lib/python/Components/UsageConfig.py index acbc3425..ce56f0f6 100644 --- a/lib/python/Components/UsageConfig.py +++ b/lib/python/Components/UsageConfig.py @@ -9,6 +9,8 @@ def InitUsageConfig(): config.usage = ConfigSubsection(); config.usage.showdish = ConfigYesNo(default = True) config.usage.multibouquet = ConfigYesNo(default = False) + config.usage.multiepg_ask_bouquet = ConfigYesNo(default = False) + config.usage.quickzap_bouquet_change = ConfigYesNo(default = False) config.usage.e1like_radio_mode = ConfigYesNo(default = False) config.usage.infobar_timeout = ConfigSelection(default = "5", choices = [ diff --git a/lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py b/lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py index bcc7b9b2..af14578a 100644 --- a/lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py +++ b/lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py @@ -1,8 +1,9 @@ from Plugins.Plugin import PluginDescriptor from GraphMultiEpg import GraphMultiEPG -from Screens.ChannelSelection import BouquetSelector +from Screens.ChannelSelection import BouquetSelector, SilentBouquetSelector from enigma import eServiceCenter, eServiceReference from ServiceReference import ServiceReference +from Components.config import config Session = None Servicelist = None @@ -73,6 +74,32 @@ def changeBouquetCB(direction, epg): epg_bouquet = bouquet epg.setServices(services) +def openAskBouquet(Session, bouquets, cnt): + if cnt > 1: # show bouquet list + global bouquetSel + bouquetSel = Session.openWithCallback(closed, BouquetSelector, bouquets, openBouquetEPG, enableWrapAround=True) + dlg_stack.append(bouquetSel) + elif cnt == 1: + if not openBouquetEPG(bouquets[0][1]): + cleanup() + +def openSilent(Servicelist, bouquets, cnt): + root = Servicelist.getRoot() + if cnt > 1: # create bouquet list + global bouquetSel + current = 0 + rootstr = root.toCompareString() + for bouquet in bouquets: + if bouquet[1].toCompareString() == rootstr: + break + current += 1 + if current >= cnt: + current = 0 + bouquetSel = SilentBouquetSelector(bouquets, True, current) + if cnt >= 1: # open current bouquet + if not openBouquetEPG(root): + cleanup() + def main(session, servicelist, **kwargs): global Session Session = session @@ -83,13 +110,10 @@ def main(session, servicelist, **kwargs): cnt = 0 else: cnt = len(bouquets) - if cnt > 1: # show bouquet list - global bouquetSel - bouquetSel = Session.openWithCallback(closed, BouquetSelector, bouquets, openBouquetEPG, enableWrapAround=True) - dlg_stack.append(bouquetSel) - elif cnt == 1: - if not openBouquetEPG(bouquets[0][1]): - cleanup() + if config.usage.multiepg_ask_bouquet.value: + openAskBouquet(session, bouquets, cnt) + else: + openSilent(servicelist, bouquets, cnt) def Plugins(**kwargs): name = _("Graphical Multi EPG") diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py index c07e3495..912d6784 100644 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -65,6 +65,24 @@ class BouquetSelector(Screen): def cancelClick(self): self.close(False) +class SilentBouquetSelector: + def __init__(self, bouquets, enableWrapAround=False, current=0): + self.bouquets = [b[1] for b in bouquets] + self.pos = current + self.count = len(bouquets) + self.enableWrapAround = enableWrapAround + + def up(self): + if self.pos > 0 or self.enableWrapAround: + self.pos = (self.pos - 1) % self.count + + def down(self): + if self.pos < (self.count - 1) or self.enableWrapAround: + self.pos = (self.pos + 1) % self.count + + def getCurrent(self): + return self.bouquets[self.pos] + # csel.bouquet_mark_edit values OFF = 0 EDIT_BOUQUET = 1 diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index 2e97b59d..93a47886 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -1,4 +1,4 @@ -from ChannelSelection import ChannelSelection, BouquetSelector +from ChannelSelection import ChannelSelection, BouquetSelector, SilentBouquetSelector from Components.ActionMap import ActionMap, HelpableActionMap from Components.ActionMap import NumberActionMap @@ -559,6 +559,12 @@ class InfoBarEPG: cnt = 0 else: cnt = len(bouquets) + if config.usage.multiepg_ask_bouquet.value: + self.openMultiServiceEPGAskBouquet(bouquets, cnt, withCallback) + else: + self.openMultiServiceEPGSilent(bouquets, cnt, withCallback) + + def openMultiServiceEPGAskBouquet(self, bouquets, cnt, withCallback): if cnt > 1: # show bouquet list if withCallback: self.bouquetSel = self.session.openWithCallback(self.closed, BouquetSelector, bouquets, self.openBouquetEPG, enableWrapAround=True) @@ -568,6 +574,21 @@ class InfoBarEPG: elif cnt == 1: self.openBouquetEPG(bouquets[0][1], withCallback) + def openMultiServiceEPGSilent(self, bouquets, cnt, withCallback): + root = self.servicelist.getRoot() + rootstr = root.toCompareString() + current = 0 + for bouquet in bouquets: + if bouquet[1].toCompareString() == rootstr: + break + current += 1 + if current >= cnt: + current = 0 + if cnt > 1: # create bouquet list for bouq+/- + self.bouquetSel = SilentBouquetSelector(bouquets, True, self.servicelist.getBouquetNumOffset(root)) + if cnt >= 1: + self.openBouquetEPG(root, withCallback) + def changeServiceCB(self, direction, epg): if self.serviceSel: if direction > 0: |
