show single service epg on long info keypress
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Sun, 22 Jul 2007 17:37:10 +0000 (17:37 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Sun, 22 Jul 2007 17:37:10 +0000 (17:37 +0000)
data/border_eventinfo-fs8.png [new file with mode: 0644]
data/keymap.xml
lib/python/Components/Sources/ServiceEvent.py [new file with mode: 0644]
lib/python/Screens/InfoBarGenerics.py

diff --git a/data/border_eventinfo-fs8.png b/data/border_eventinfo-fs8.png
new file mode 100644 (file)
index 0000000..e69de29
index 808ed41771ccd35ed0fc9c6abfb117b7ce109bc8..3b2185daca378789afe29d2d234d5af619e20c2e 100644 (file)
@@ -67,7 +67,8 @@
        </map>
 
        <map context="InfobarEPGActions">
-               <key id="KEY_INFO" mapto="showEventInfo" flags="m" />
+               <key id="KEY_INFO" mapto="showEventInfo" flags="b" />
+               <key id="KEY_INFO" mapto="showSingleServiceEPG" flags="l" />
        </map>
        
        <map context="InfobarInstantRecord">
diff --git a/lib/python/Components/Sources/ServiceEvent.py b/lib/python/Components/Sources/ServiceEvent.py
new file mode 100644 (file)
index 0000000..8a1c7ff
--- /dev/null
@@ -0,0 +1,30 @@
+from Components.VariableText import VariableText
+from Components.Element import cached
+from Components.GUIComponent import GUIComponent
+from enigma import eEPGCache, eServiceReference as Ref, eLabel
+from Source import Source
+
+class ServiceEvent(VariableText, GUIComponent, Source, object):
+       def __init__(self):
+               Source.__init__(self)
+               GUIComponent.__init__(self)
+               VariableText.__init__(self)
+               self.cur_ref = None
+
+       GUI_WIDGET = eLabel
+
+#TODO Add a timer to get every minute the actual event..
+#but this just make sense when the Servicelist do the same thing..
+       @cached
+       def getCurrentEvent(self):
+               epg = eEPGCache.getInstance()
+               return epg and self.cur_ref and epg.startTimeQuery(self.cur_ref) != -1 and epg.getNextTimeEntry() or None
+
+       event = property(getCurrentEvent)
+
+       def newService(self, ref):
+               self.cur_ref = ref
+               if not ref or (ref.flags & Ref.flagDirectory) == Ref.flagDirectory or ref.flags & Ref.isMarker:
+                       self.changed((self.CHANGED_CLEAR,))
+               else:
+                       self.changed((self.CHANGED_ALL,))
index 8aeb767718b9cde2e81e084b845a89d9d62bc69c..ca697ae81bbd58e2c55364264f7c72ab376b4d00 100644 (file)
@@ -405,6 +405,7 @@ class InfoBarEPG:
                self["EPGActions"] = HelpableActionMap(self, "InfobarEPGActions", 
                        {
                                "showEventInfo": (self.openEventView, _("show EPG...")),
+                               "showSingleServiceEPG": (self.openSingleServiceEPG, _("show single service EPG...")),
                                "showInfobarOrEpgWhenInfobarAlreadyVisible": self.showEventInfoWhenNotVisible,
                        })