change eventinfo hook: allow to search for different than currently running event...
authorMoritz Venn <ritzmo@users.schwerkraft.elitedvb.net>
Tue, 24 Feb 2009 11:04:02 +0000 (11:04 +0000)
committerMoritz Venn <ritzmo@users.schwerkraft.elitedvb.net>
Tue, 24 Feb 2009 11:04:02 +0000 (11:04 +0000)
epgsearch/src/EPGSearch.py
epgsearch/src/plugin.py

index dd9a6fb..2ee0519 100644 (file)
@@ -196,7 +196,8 @@ class EPGSearchChannelSelection(SimpleChannelSelection):
                        self.session.openWithCallback(
                                self.epgClosed,
                                EPGSearchEPGSelection,
-                               ref
+                               ref,
+                               False
                        )
 
        def epgClosed(self, ret = None):
@@ -204,10 +205,11 @@ class EPGSearchChannelSelection(SimpleChannelSelection):
                        self.close(ret)
 
 class EPGSearchEPGSelection(EPGSelection):
-       def __init__(self, session, ref):
+       def __init__(self, session, ref, openPlugin):
                EPGSelection.__init__(self, session, ref)
                self.skinName = "EPGSelection"
                self["key_green"].setText(_("Search"))
+               self.openPlugin = openPlugin
 
        def infoKeyPressed(self):
                self.timerAdd()
@@ -219,5 +221,11 @@ class EPGSearchEPGSelection(EPGSelection):
                if not evt:
                        return
 
-               self.close(evt.getEventName())
+               if self.openPlugin:
+                       self.session.open(
+                               EPGSearch,
+                               evt.getEventName()
+                       )
+               else:
+                       self.close(evt.getEventName())
 
index 7d4e969..77df8e0 100644 (file)
@@ -12,7 +12,7 @@ config.plugins.epgsearch.history = ConfigSet(choices = [])
 config.plugins.epgsearch.encoding = ConfigText(default = 'ISO8859-15', fixed_size = False)
 
 # Plugin
-from EPGSearch import EPGSearch
+from EPGSearch import EPGSearch, EPGSearchEPGSelection
 
 # Plugin definition
 from Plugins.Plugin import PluginDescriptor
@@ -33,6 +33,11 @@ def movielist(session, service, **kwargs):
 
        session.open(EPGSearch, name)
 
+# Event Info
+def eventinfo(session, *args, **kwargs):
+       ref = session.nav.getCurrentlyPlayingServiceReference()
+       session.open(EPGSearchEPGSelection, ref, True)
+
 def Plugins(**kwargs):
        return [
                PluginDescriptor(
@@ -44,7 +49,7 @@ def Plugins(**kwargs):
                PluginDescriptor(
                        name = _("Search EPG..."),
                        where = PluginDescriptor.WHERE_EVENTINFO,
-                       fnc = main,
+                       fnc = eventinfo,
                ),
                PluginDescriptor(
                        name = "EPGSearch",