aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Screens/EpgSelection.py22
-rw-r--r--lib/python/Screens/EventView.py53
-rw-r--r--lib/python/Screens/Makefile.am2
-rw-r--r--lib/python/Screens/__init__.py2
4 files changed, 69 insertions, 10 deletions
diff --git a/lib/python/Screens/EpgSelection.py b/lib/python/Screens/EpgSelection.py
index 915cc60e..440df528 100644
--- a/lib/python/Screens/EpgSelection.py
+++ b/lib/python/Screens/EpgSelection.py
@@ -2,9 +2,8 @@ from Screen import Screen
from Components.Button import Button
from Components.EpgList import EPGList
from Components.ActionMap import ActionMap
-
-from enigma import eServiceReference
-
+from Screens.EventView import EventView
+from enigma import eServiceReference, eServiceEventPtr
from Screens.FixedMenu import FixedMenu
import xml.dom.minidom
@@ -14,13 +13,12 @@ class EPGSelection(Screen):
Screen.__init__(self, session)
self["list"] = EPGList()
-# self["list"].setRoot(root)
class ChannelActionMap(ActionMap):
def action(self, contexts, action):
ActionMap.action(self, contexts, action)
- self["actions"] = ChannelActionMap(["ChannelSelectActions", "OkCancelActions"],
+ self["actions"] = ChannelActionMap(["EPGSelectActions", "OkCancelActions"],
{
"cancel": self.close,
"ok": self.eventSelected,
@@ -28,10 +26,18 @@ class EPGSelection(Screen):
self["actions"].csel = self
self.setRoot(root)
+ def eventViewCallback(self, setEvent, val):
+ if val == -1:
+ self.moveUp()
+ setEvent(self["list"].getCurrent())
+ elif val == +1:
+ self.moveDown()
+ setEvent(self["list"].getCurrent())
+
def eventSelected(self):
- ref = self["list"].getCurrent()
-# open eventdetail view... not finished yet
- self.close()
+ event = self["list"].getCurrent()
+ self.session.open(EventView, event, self.eventViewCallback)
+# self.close()
def setRoot(self, root):
self["list"].setRoot(root)
diff --git a/lib/python/Screens/EventView.py b/lib/python/Screens/EventView.py
new file mode 100644
index 00000000..48d85bf7
--- /dev/null
+++ b/lib/python/Screens/EventView.py
@@ -0,0 +1,53 @@
+from Screen import Screen
+from Components.ActionMap import ActionMap
+from Components.Label import Label
+from Components.ProgressBar import ProgressBar
+from enigma import eWidget, eServiceEventPtr, eLabel
+
+class EventView(Screen):
+ def __init__(self, session, Event, callback):
+ Screen.__init__(self, session)
+
+ self.cbFunc = callback
+ print self.cbFunc
+
+ self["epg_description"] = Label()
+ self["datetime"] = Label()
+ self["channel"] = Label()
+ self["scrollbar"] = ProgressBar()
+ self["duration"] = Label()
+
+ self["actions"] = ActionMap(["OkCancelActions", "EventViewActions"],
+ {
+ "cancel": self.close,
+ "ok": self.close,
+ "scrollUp": self.scrollUp,
+ "scrollDown": self.scrollDown,
+ "prevEvent": self.prevEvent,
+ "nextEvent": self.nextEvent
+ })
+ self.setEvent(Event)
+
+ def prevEvent(self):
+ if self.cbFunc is not None:
+ self.cbFunc(self.setEvent, -1)
+
+ def nextEvent(self):
+ if self.cbFunc is not None:
+ self.cbFunc(self.setEvent, +1)
+
+ def setEvent(self, event):
+ text = event.getShortDescription()
+ if len(text) > 0:
+ text = text + '\n\n'
+ text = text + event.getExtendedDescription()
+ self["epg_description"].setText(text)
+ self["datetime"].setText(event.getBeginTimeString())
+ self["channel"].setText("Unknown Service")
+ self["duration"].setText("%d min"%(event.getDuration()/60))
+
+ def scrollUp(self):
+ print "scrollUp"
+
+ def scrollDown(self):
+ print "scrollDown"
diff --git a/lib/python/Screens/Makefile.am b/lib/python/Screens/Makefile.am
index 30e8f540..97e202f2 100644
--- a/lib/python/Screens/Makefile.am
+++ b/lib/python/Screens/Makefile.am
@@ -5,4 +5,4 @@ install_PYTHON = \
MessageBox.py ScartLoopThrough.py Screen.py ServiceScan.py TimerEdit.py \
MovieSelection.py Setup.py About.py HarddiskSetup.py FixedMenu.py \
Satconfig.py ScanSetup.py NetworkSetup.py Ci.py TimerEntry.py Volume.py \
- EpgSelection.py Mute.py __init__.py
+ EpgSelection.py EventView.py Mute.py __init__.py
diff --git a/lib/python/Screens/__init__.py b/lib/python/Screens/__init__.py
index ed5c07e6..fd7b40c0 100644
--- a/lib/python/Screens/__init__.py
+++ b/lib/python/Screens/__init__.py
@@ -3,4 +3,4 @@ __all__ = ["ChannelSelection", "ClockDisplay", "ConfigMenu",
"ScartLoopThrough", "Screen", "ServiceScan", "About",
"TimerEdit", "Setup", "HarddiskSetup", "FixedMenu",
"Satconfig", "Scanconfig", "Ci.py", "Volume.py", "Mute.py",
- "EpgSelection"]
+ "EpgSelection", "EventView"]