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 808ed41..3b2185d 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 8aeb767..ca697ae 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,
                        })