add Event detail viewer
[enigma2.git] / lib / python / Screens / EpgSelection.py
index 915cc60..440df52 100644 (file)
@@ -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)