add possibility to change services in single service epg with bouquet +/- key
[enigma2.git] / lib / python / Screens / ChannelSelection.py
index bae8f7ded05f19ee1b4b35b16e45483d4dfcbcbf..0ff4042bf0562b20706835ab0ce7ae84567bf95b 100644 (file)
@@ -317,11 +317,24 @@ class ChannelSelectionEPG:
 
        def showEPGList(self):
                ref=self.getCurrentSelection()
 
        def showEPGList(self):
                ref=self.getCurrentSelection()
-               ptr=eEPGCache.getInstance()
-               if ptr.startTimeQuery(ref) != -1:
-                       self.session.open(EPGSelection, ref)
-               else:
-                       print 'no epg for service', ref.toString()
+               if ref:
+                       self.savedService = ref
+                       self.session.openWithCallback(self.SingleServiceEPGClosed, EPGSelection, ref, serviceChangeCB=self.changeServiceCB)
+
+       def SingleServiceEPGClosed(self, ret=False):
+               self.setCurrentSelection(self.savedService)
+
+       def changeServiceCB(self, direction, epg):
+               beg = self.getCurrentSelection()
+               while True:
+                       if direction > 0:
+                               self.moveDown()
+                       else:
+                               self.moveUp()
+                       cur = self.getCurrentSelection()
+                       if cur == beg or not (cur.flags & eServiceReference.isMarker):
+                               break
+               epg.setService(ServiceReference(self.getCurrentSelection()))
 
 class ChannelSelectionEdit:
        def __init__(self):
 
 class ChannelSelectionEdit:
        def __init__(self):