dont open epglist when no epg is avail
[enigma2.git] / lib / python / Screens / ChannelSelection.py
index 6abb52d9351a1241876d7a9346fffab2b4540917..c31b794906604284a7e0f559ca408d46d149807c 100644 (file)
@@ -3,7 +3,7 @@ from Components.Button import Button
 from Components.ServiceList import ServiceList
 from Components.ActionMap import ActionMap
 from EpgSelection import EPGSelection
-from enigma import eServiceReference
+from enigma import eServiceReference, eEPGCache, eEPGCachePtr
 
 from Screens.FixedMenu import FixedMenu
 
@@ -75,7 +75,7 @@ class ChannelSelection(Screen):
                                else:
                                        ActionMap.action(self, contexts, action)
 
-               self["actions"] = ChannelActionMap(["ChannelSelectActions", "OkCancelActions"], 
+               self["actions"] = ChannelActionMap(["ChannelSelectActions", "OkCancelActions", "ContextMenuActions"], 
                        {
                                "cancel": self.close,
                                "ok": self.channelSelected,
@@ -87,7 +87,12 @@ class ChannelSelection(Screen):
                self["actions"].csel = self
 
        def showEPGList(self):
-               self.session.open(EPGSelection, self["list"].getCurrent())
+               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):