add seek
[enigma2.git] / lib / python / Screens / ChannelSelection.py
index c8bfb2cb4021a43cef90e2a10eb219d4b8c3167d..61c670389fcba38c9637b0e9e82a08a647564dd4 100644 (file)
@@ -2,8 +2,8 @@ from Screen import Screen
 from Components.Button import Button
 from Components.ServiceList import ServiceList
 from Components.ActionMap import ActionMap
-
-from enigma import eServiceReference
+from EpgSelection import EPGSelection
+from enigma import eServiceReference, eEPGCache, eEPGCachePtr
 
 from Screens.FixedMenu import FixedMenu
 
@@ -71,22 +71,30 @@ class ChannelSelection(Screen):
                                if action[:7] == "bouquet":
                                        l = self.csel["list"]
                                        l.setMode(l.MODE_NORMAL)
-                                       l.setRoot(eServiceReference("1:0:1:0:0:0:0:0:0:0:" + action[8:]))
+                                       l.setRoot(eServiceReference("1:7:1:0:0:0:0:0:0:0:" + action[8:]))
                                else:
                                        ActionMap.action(self, contexts, action)
 
-               self["actions"] = ChannelActionMap(["ChannelSelectActions", "OkCancelActions"], 
+               self["actions"] = ChannelActionMap(["ChannelSelectActions", "OkCancelActions", "ContextMenuActions"], 
                        {
                                "cancel": self.close,
                                "ok": self.channelSelected,
                                "mark": self.doMark,
                                "contextMenu": self.doContext,
-                               "showFavourites": self.showFavourites
+                               "showFavourites": self.showFavourites,
+                               "showEPGList": self.showEPGList
                        })
                self["actions"].csel = self
 
+       def showEPGList(self):
+               ref=self["list"].getCurrent()
+               ptr=eEPGCache.getInstance()
+               if ptr.startTimeQuery(ref) != -1:
+                       self.session.open(EPGSelection, ref)
+               else:
+                       print 'no epg for service', ref.toString()
+
        #  marked edit mode
-       
        def startMarkedEdit(self):
                self.bouquet_mark_edit = True
                self.clearMarks()
@@ -155,9 +163,6 @@ class ChannelSelection(Screen):
                else:
                        self.movemode = True
 
-       def getCurrent(self):
-               return self["list"].getCurrent()
-
        def showFavourites(self):
                l = self["list" ]
                l.setRoot(eServiceReference('1:0:1:0:0:0:0:0:0:0:(provider == "fav")'))