from Components.Input import Input
profile("ChannelSelection.py 3")
from Components.ParentalControl import parentalControl
from Components.Input import Input
profile("ChannelSelection.py 3")
from Components.ParentalControl import parentalControl
from Screens.InputBox import InputBox, PinInput
from Screens.MessageBox import MessageBox
from Screens.ServiceInfo import ServiceInfo
from Screens.InputBox import InputBox, PinInput
from Screens.MessageBox import MessageBox
from Screens.ServiceInfo import ServiceInfo
-def append_when_current_valid(current, menu, args, level = 0):
+def append_when_current_valid(current, menu, args, level = 0, key = ""):
class ChannelContextMenu(Screen):
def __init__(self, session, csel):
class ChannelContextMenu(Screen):
def __init__(self, session, csel):
current = csel.getCurrentSelection()
current_root = csel.getRoot()
current_sel_path = current.getPath()
current = csel.getCurrentSelection()
current_root = csel.getRoot()
current_sel_path = current.getPath()
if not inBouquetRootList:
isPlayable = not (current_sel_flags & (eServiceReference.isMarker|eServiceReference.isDirectory))
if isPlayable:
if not inBouquetRootList:
isPlayable = not (current_sel_flags & (eServiceReference.isMarker|eServiceReference.isDirectory))
if isPlayable:
if config.ParentalControl.configured.value:
if parentalControl.getProtectionLevel(csel.getCurrentSelection().toCompareString()) == -1:
append_when_current_valid(current, menu, (_("add to parental protection"), boundFunction(self.addParentalProtection, csel.getCurrentSelection())), level = 0)
if config.ParentalControl.configured.value:
if parentalControl.getProtectionLevel(csel.getCurrentSelection().toCompareString()) == -1:
append_when_current_valid(current, menu, (_("add to parental protection"), boundFunction(self.addParentalProtection, csel.getCurrentSelection())), level = 0)
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)
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 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
append_when_current_valid(current, menu, (_("remove entry"), self.removeBouquet), level = 0)
if inBouquet: # current list is editable?
append_when_current_valid(current, menu, (_("remove entry"), self.removeBouquet), level = 0)
if inBouquet: # current list is editable?
if not csel.movemode:
append_when_current_valid(current, menu, (_("enable move mode"), self.toggleMoveMode), level = 1)
if not inBouquetRootList and current_root and not (current_root.flags & eServiceReference.isGroup):
if not csel.movemode:
append_when_current_valid(current, menu, (_("enable move mode"), self.toggleMoveMode), level = 1)
if not inBouquetRootList and current_root and not (current_root.flags & eServiceReference.isGroup):
if haveBouquets:
append_when_current_valid(current, menu, (_("enable bouquet edit"), self.bouquetMarkStart), level = 0)
else:
if haveBouquets:
append_when_current_valid(current, menu, (_("enable bouquet edit"), self.bouquetMarkStart), level = 0)
else:
append_when_current_valid(current, menu, (_("end alternatives edit"), self.bouquetMarkEnd), level = 0)
append_when_current_valid(current, menu, (_("abort alternatives edit"), self.bouquetMarkAbort), level = 0)
append_when_current_valid(current, menu, (_("end alternatives edit"), self.bouquetMarkEnd), level = 0)
append_when_current_valid(current, menu, (_("abort alternatives edit"), self.bouquetMarkAbort), level = 0)
- menu.append((_("back"), self.cancelClick))
- self["menu"] = MenuList(menu)
+ menu.append(ChoiceEntryComponent(text = (_("back"), self.cancelClick)))
+ self["menu"] = ChoiceList(menu)
self.session.openWithCallback(self.close, MessageBox, _("The pin code you entered is wrong."), MessageBox.TYPE_ERROR)
def showServiceInPiP(self):
self.session.openWithCallback(self.close, MessageBox, _("The pin code you entered is wrong."), MessageBox.TYPE_ERROR)
def showServiceInPiP(self):
if self.session.pip.playService(newservice):
self.session.pipshown = True
self.session.pip.servicePath = self.csel.getCurrentServicePath()
if self.session.pip.playService(newservice):
self.session.pipshown = True
self.session.pip.servicePath = self.csel.getCurrentServicePath()
- self.session.open(ChannelContextMenu, self)
+ self.session.openWithCallback(self.exitContext, ChannelContextMenu, self)
+
+ def exitContext(self, close = False):
+ if close:
+ self.cancel()