aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2007-07-22 17:37:10 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2007-07-22 17:37:10 +0000
commite69fde464582ffb74d03510f7ba45542af17d730 (patch)
tree1cc8ede757795f12edc5e1c0e16a6dce09e08e93 /lib/python
parent59e77ff12a3733a6d9c18fbefa4fd20af657d134 (diff)
downloadenigma2-e69fde464582ffb74d03510f7ba45542af17d730.tar.gz
enigma2-e69fde464582ffb74d03510f7ba45542af17d730.zip
show single service epg on long info keypress
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/Sources/ServiceEvent.py30
-rw-r--r--lib/python/Screens/InfoBarGenerics.py1
2 files changed, 31 insertions, 0 deletions
diff --git a/lib/python/Components/Sources/ServiceEvent.py b/lib/python/Components/Sources/ServiceEvent.py
new file mode 100644
index 00000000..8a1c7ffe
--- /dev/null
+++ b/lib/python/Components/Sources/ServiceEvent.py
@@ -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,))
diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py
index 8aeb7677..ca697ae8 100644
--- a/lib/python/Screens/InfoBarGenerics.py
+++ b/lib/python/Screens/InfoBarGenerics.py
@@ -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,
})