X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/34c1ccf6eaef6f2e8535cb3c0cbe6390835086ef..804ad88e6679853bd2db717fc542263d48075631:/lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py diff --git a/lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py b/lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py index 0ebcafca..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 @@ -69,9 +70,36 @@ def changeBouquetCB(direction, epg): bouquet = bouquetSel.getCurrent() services = getBouquetServices(bouquet) if len(services): + global epg_bouquet 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 @@ -82,16 +110,13 @@ 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") descr = _("A graphical EPG for all services of an specific bouquet") - return [ PluginDescriptor(name=name, description=descr, where = PluginDescriptor.WHERE_EVENTINFO, fnc=main), - PluginDescriptor(name=name, description=descr, where = PluginDescriptor.WHERE_EXTENSIONSMENU, fnc=main) ] + return [PluginDescriptor(name=name, description=descr, where = PluginDescriptor.WHERE_EVENTINFO, needsRestart = False, fnc=main), + PluginDescriptor(name=name, description=descr, where = PluginDescriptor.WHERE_EXTENSIONSMENU, needsRestart = False, fnc=main)]