long keypress on INFO key either brings up single servie EPG view screen like right...
authorFraxinas <andreas.frisch@multimedia-labs.de>
Mon, 10 Nov 2008 09:12:53 +0000 (10:12 +0100)
committerFraxinas <andreas.frisch@multimedia-labs.de>
Mon, 10 Nov 2008 09:12:53 +0000 (10:12 +0100)
data/keymap.xml
lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py
lib/python/Plugins/Plugin.py
lib/python/Screens/InfoBarGenerics.py

index 5e73490e4e89421a2434ed826117488bce320220..6b8b583dfca65cba73c357832301ab75c93e4624 100644 (file)
@@ -77,8 +77,8 @@
        </map>
 
        <map context="InfobarEPGActions">
-               <key id="KEY_INFO" mapto="showEventInfo" flags="b" />
-               <key id="KEY_INFO" mapto="showSingleServiceEPG" flags="l" />
+               <key id="KEY_INFO" mapto="showEventView" flags="b" />
+               <key id="KEY_INFO" mapto="showEventInfoPlugin" flags="l" />
        </map>
        
        <map context="InfobarInstantRecord">
index 7afbe14aa7e01bd75daa3897a265d9fc355bb863..21d1bfe8bf72585e3c6549603a7c5a7e075fb488 100644 (file)
@@ -93,4 +93,4 @@ def main(session, servicelist, **kwargs):
 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_EXTENSIONSMENU, fnc=main) ]
+       return [ PluginDescriptor(name=name, description=descr, where = PluginDescriptor.WHERE_EVENTINFO, fnc=main) ]
index a0db1d6637ae93d24015f2e073a1e28db4624fab..6df4fce74a87b075819c93ff65d72404594e5fc2 100644 (file)
@@ -45,6 +45,10 @@ class PluginDescriptor:
        # or return a function which is called with session and the interface name for extended setup of this interface
        WHERE_NETWORKSETUP = 10
        
+       # show up this plugin (or a choicebox with all of them) for long INFO keypress
+       # or return a function which is called with session and the interface name for extended setup of this interface
+       WHERE_EVENTINFO = 11
+
        def __init__(self, name = "Plugin", where = [ ], description = "", icon = None, fnc = None, wakeupfnc = None, internal = False):
                self.name = name
                self.internal = internal
index aab2b6491727aed6385cd3cdf1e71b1db6366f27..cdaa2c1e6c035615fd1a49c2c111c948b6155fb4 100644 (file)
@@ -403,8 +403,8 @@ class InfoBarEPG:
                self.eventView = None
                self["EPGActions"] = HelpableActionMap(self, "InfobarEPGActions",
                        {
-                               "showEventInfo": (self.openEventView, _("show EPG...")),
-                               "showSingleServiceEPG": (self.openSingleServiceEPG, _("show single service EPG...")),
+                               "showEventView": (self.openEventView, _("show EPG...")),
+                               "showEventInfoPlugin": (self.showEventInfoPlugins, _("show single service EPG...")),
                                "showInfobarOrEpgWhenInfobarAlreadyVisible": self.showEventInfoWhenNotVisible,
                        })
 
@@ -489,6 +489,23 @@ class InfoBarEPG:
                ref=self.session.nav.getCurrentlyPlayingServiceReference()
                self.session.open(EPGSelection, ref)
 
+       def showEventInfoPlugins(self):
+               list = []
+               for p in plugins.getPlugins(where = PluginDescriptor.WHERE_EVENTINFO):
+                       list.append((p.name, boundFunction(self.runPlugin, p)))
+               if len(list):
+                       list.append((_("show single service EPG..."), self.openSingleServiceEPG))
+                       self.session.openWithCallback(self.EventInfoPluginChosen, ChoiceBox, title=_("Please choose an extension..."), list = list)
+               else:
+                       self.openSingleServiceEPG()
+                       
+       def runPlugin(self, plugin):
+               plugin(session = self.session, servicelist = self.servicelist)
+               
+       def EventInfoPluginChosen(self, answer):
+               if answer is not None:
+                       answer[1]()
+
        def openSimilarList(self, eventid, refstr):
                self.session.open(EPGSelection, refstr, None, eventid)
 
@@ -1258,7 +1275,6 @@ class InfoBarExtensions:
 from Tools.BoundFunction import boundFunction
 
 # depends on InfoBarExtensions
-from Components.PluginComponent import plugins
 
 class InfoBarPlugins:
        def __init__(self):