only show pip option in contextmenu when the hardware can handle pip
[enigma2.git] / lib / python / Screens / ChannelSelection.py
index e8bbce156e964fad10987bc5c7d63c4babf06cd9..5fbfd5919c258916a802d3caf72e88a6b9519a7d 100644 (file)
@@ -22,6 +22,7 @@ from Components.Input import Input
 profile("ChannelSelection.py 3")
 from Components.ParentalControl import parentalControl
 from Components.ChoiceList import ChoiceList, ChoiceEntryComponent
+from Components.SystemInfo import SystemInfo
 from Screens.InputBox import InputBox, PinInput
 from Screens.MessageBox import MessageBox
 from Screens.ServiceInfo import ServiceInfo
@@ -126,7 +127,7 @@ class ChannelContextMenu(Screen):
                                        append_when_current_valid(current, menu, (_("remove entry"), self.removeCurrentService), level = 0)
                                if current_root and current_root.getPath().find("flags == %d" %(FLAG_SERVICE_NEW_FOUND)) != -1:
                                        append_when_current_valid(current, menu, (_("remove new found flag"), self.removeNewFoundFlag), level = 0)
-                               if isPlayable:
+                               if isPlayable and SystemInfo.get("NumVideoDecoders", 1) > 1:
                                        append_when_current_valid(current, menu, (_("Activate Picture in Picture"), self.showServiceInPiP), level = 0, key = "blue")
                                        self.pipAvailable = True
                        else:
@@ -208,7 +209,7 @@ class ChannelContextMenu(Screen):
                if self.session.pip.playService(newservice):
                        self.session.pipshown = True
                        self.session.pip.servicePath = self.csel.getCurrentServicePath()
-                       self.close()
+                       self.close(True)
                else:
                        self.session.pipshown = False
                        del self.session.pip
@@ -672,7 +673,11 @@ class ChannelSelectionEdit:
                        self.entry_marked = True
 
        def doContext(self):
-               self.session.open(ChannelContextMenu, self)
+               self.session.openWithCallback(self.exitContext, ChannelContextMenu, self)
+               
+       def exitContext(self, close = False):
+               if close:
+                       self.cancel()
 
 MODE_TV = 0
 MODE_RADIO = 1