def __init__(self, session, zapFunc, startBouquet, startRef, bouquets): EPGSelectionGrid.__init__(self, session, zapFunc, startBouquet, startRef, bouquets, None, True) self.skinName = ["InfoBarGridEPG", "GraphicalInfoBarEPG"] self.__openedPip = False self.pipServiceRelation = getRelationDict( ) if plugin_PiPServiceRelation_installed else {}
def __init__(self, session, epgConfig, startBouquet=None, startRef=None, bouquets=None): Screen.__init__(self, session) HelpableScreen.__init__(self) self.epgConfig = epgConfig self.bouquets = bouquets self.startBouquet = startBouquet self.startRef = startRef self.popupDialog = None self.closeRecursive = False self.eventviewDialog = None self.eventviewWasShown = False self.session.pipshown = False self.pipServiceRelation = getRelationDict() if plugin_PiPServiceRelation_installed else {} self["Service"] = ServiceEvent() self["Event"] = Event() self["lab1"] = Label(_("Please wait while gathering EPG data...")) self["lab1"].hide() self["key_red"] = Button(_("IMDb Search")) self["key_green"] = Button(_("Add Timer")) self["key_yellow"] = Button(_("EPG Search")) self["key_blue"] = Button(_("Add AutoTimer")) self["key_menu"] = StaticText(_("MENU")) self["key_info"] = StaticText(_("INFO")) helpDescription = _("EPG Commands") self["okactions"] = HelpableActionMap(self, "OkCancelActions", { "cancel": (self.closeScreen, _("Exit EPG")), "OK": (self.helpKeyAction("ok")), "OKLong": (self.helpKeyAction("oklong")) }, prio=-1, description=helpDescription) self["colouractions"] = HelpableActionMap(self, "ColorActions", { "red": self.helpKeyAction("red"), "redlong": self.helpKeyAction("redlong"), "green": self.helpKeyAction("green"), "greenlong": self.helpKeyAction("greenlong"), "yellow": self.helpKeyAction("yellow"), "yellowlong": self.helpKeyAction("yellowlong"), "blue": self.helpKeyAction("blue"), "bluelong": self.helpKeyAction("bluelong") }, prio=-1, description="EPG Commands") self._updateButtonText() self["recordingactions"] = HelpableActionMap(self, "InfobarInstantRecord", { "ShortRecord": self.helpKeyAction("rec"), "LongRecord": self.helpKeyAction("reclong") }, prio=-1, description=helpDescription) self["epgactions"] = HelpableActionMap(self, "EPGSelectActions", {}, -1) self.noAutotimer = _("The AutoTimer plugin is not installed!\nPlease install it.") self.noEPGSearch = _("The EPGSearch plugin is not installed!\nPlease install it.") self.noIMDb = _("The IMDb plugin is not installed!\nPlease install it.") self.refreshTimer = eTimer() self.refreshTimer.timeout.get().append(self.refreshList) self.onLayoutFinish.append(self.onCreate)
def __init__(self, type): Converter.__init__(self, type) self.pipservice = None self.shown = False # check if we can use the PipServiceRelation plugin try: from Plugins.SystemPlugins.PiPServiceRelation.plugin import getRelationDict self.pipServiceRelation = getRelationDict() except ImportError: self.pipServiceRelation = None
def __init__(self, type): Converter.__init__(self, type) self.pipservice = None self.currentRunningService = None self.shown = False # check if we can use the PipServiceRelation plugin try: from Plugins.SystemPlugins.PiPServiceRelation.plugin import getRelationDict self.pipServiceRelation = getRelationDict() except ImportError: self.pipServiceRelation = None
def __init__(self, session, currService, closePlayerCallBack): self.session = session self["video"] = VideoWindow(fb_width=getDesktop(0).size().width(), fb_height=getDesktop(0).size().height()) self["numberActions"] = NumberActionMap( ["NumberActions"], { "1": self.keyNumberGlobal, "2": self.keyNumberGlobal, "3": self.keyNumberGlobal, "4": self.keyNumberGlobal, "5": self.keyNumberGlobal, "6": self.keyNumberGlobal, "7": self.keyNumberGlobal, "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, }, -1) self["numberActions"].setEnabled(False) self["zapActions"] = ActionMap( [ "OkCancelActions", "DirectionActions", "ChannelSelectBaseActions", "ChannelSelectEPGActions" ], { "cancel": self.disablePiPPlayer, "ok": self.disablePiPPlayer, "right": self.nextService, "left": self.prevService, "nextBouquet": self.nextBouquet, "prevBouquet": self.prevBouquet, "showEPGList": self.openEventView, }, -1) self["zapActions"].setEnabled(False) self.currService = currService from Screens.InfoBar import InfoBar # late binding self.servicelist = InfoBar.instance.servicelist self.closePlayerCallBack = closePlayerCallBack self.epgcache = eEPGCache.getInstance() # if PiPServiceRelation is installed, get relation dict if plugin_PiPServiceRelation_installed: self.pipServiceRelation = getRelationDict() else: self.pipServiceRelation = {}
def __init__(self, session, currService, closePlayerCallBack): self.session = session self["video"] = VideoWindow(fb_width = getDesktop(0).size().width(), fb_height = getDesktop(0).size().height()) self["numberActions"] = NumberActionMap(["NumberActions"], { "1": self.keyNumberGlobal, "2": self.keyNumberGlobal, "3": self.keyNumberGlobal, "4": self.keyNumberGlobal, "5": self.keyNumberGlobal, "6": self.keyNumberGlobal, "7": self.keyNumberGlobal, "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, }, -1) self["numberActions"].setEnabled(False) self["zapActions"] = ActionMap(["OkCancelActions", "DirectionActions", "ChannelSelectBaseActions", "ChannelSelectEPGActions"], { "cancel": self.disablePiPPlayer, "ok": self.disablePiPPlayer, "right": self.nextService, "left": self.prevService, "nextBouquet": self.nextBouquet, "prevBouquet": self.prevBouquet, "showEPGList": self.openEventView, }, -1) self["zapActions"].setEnabled(False) self.currService = currService from Screens.InfoBar import InfoBar # late binding self.servicelist = InfoBar.instance.servicelist self.closePlayerCallBack = closePlayerCallBack self.epgcache = eEPGCache.getInstance() # if PiPServiceRelation is installed, get relation dict if plugin_PiPServiceRelation_installed: self.pipServiceRelation = getRelationDict() else: self.pipServiceRelation = {}
def __init__(self, session, servicelist=None): Screen.__init__(self, session) self.session = session if SystemInfo.get( "NumVideoDecoders", 1 ) > 1 and config.plugins.virtualzap.usepip.value and config.plugins.virtualzap.showpipininfobar.value: self.skinName = "VirtualZap" self.pipAvailable = True else: self.skinName = "VirtualZapNoPiP" self.pipAvailable = ( SystemInfo.get("NumVideoDecoders", 1) > 1 ) and config.plugins.virtualzap.usepip.value and not config.plugins.virtualzap.showpipininfobar.value self.epgcache = eEPGCache.getInstance() self.CheckForEPG = eTimer() self.CheckForEPG.callback.append(self.CheckItNow) self["NowChannel"] = Label() self["NowEPG"] = Label() self["NextEPG"] = Label() self["NowTime"] = Label() self["NextTime"] = Label() self["actions"] = ActionMap( [ "OkCancelActions", "DirectionActions", "ChannelSelectBaseActions", "ChannelSelectEPGActions", "ColorActions" ], { "ok": self.ok, "cancel": self.closing, "right": self.nextService, "left": self.prevService, "nextBouquet": self.showFavourites, "prevBouquet": self.openServiceList, "showEPGList": self.openEventView, "blue": self.standardPiP, "yellow": self.switchAndStandardPiP, "down": self.switchChannelDown, "up": self.switchChannelUp, }, -2) self["actions2"] = NumberActionMap( ["NumberActions"], { "0": self.swap, "1": self.keyNumberGlobal, "2": self.keyNumberGlobal, "3": self.keyNumberGlobal, "4": self.keyNumberGlobal, "5": self.keyNumberGlobal, "6": self.keyNumberGlobal, "7": self.keyNumberGlobal, "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, }, -1) self.onLayoutFinish.append(self.onLayoutReady) # PiP if self.pipAvailable: # activate PiP support if config.plugins.virtualzap.usepip.value and not config.plugins.virtualzap.showpipininfobar.value: # activate standard PiP self["video"] = VideoWindow() else: # show PiP in Infobar self["video"] = VideoWindow( fb_width=getDesktop(0).size().width(), fb_height=getDesktop(0).size().height()) self.currentPiP = "" else: # no PiP self["video"] = Label() # this is the servicelist from ChannelSelectionBase self.servicelist = servicelist # save orig. method of zap in servicelist self.servicelist_orig_zap = self.servicelist.zap # when displaying ChannelSelection, do not zap when pressing "ok", so new method is needed self.servicelist.zap = self.servicelist_overwrite_zap # overwrite the actionmap of ChannelSelection self.servicelist["actions"] = ActionMap( ["OkCancelActions"], { "cancel": self.cancelChannelSelection, "ok": self.servicelist.channelSelected, }) # temp. vars, needed when pressing cancel in ChannelSelection self.curSelectedRef = None self.curSelectedBouquet = None # needed, because if we won't zap, we have to go back to the current bouquet and service self.curRef = ServiceReference(self.servicelist.getCurrentSelection()) self.curBouquet = self.servicelist.getRoot() # start with last used service if config.plugins.virtualzap.saveLastService.value: # get service and bouquet ref ref = eServiceReference(config.plugins.virtualzap.curref.value) bouquet = eServiceReference( config.plugins.virtualzap.curbouquet.value) if ref.valid() and bouquet.valid(): # select bouquet and ref in servicelist self.setServicelistSelection(bouquet, ref) # prepare exitTimer self.exitTimer = eTimer() self.exitTimer.timeout.get().append(self.standardPiP) # reverse changes of ChannelSelection when closing plugin self.onClose.append(self.__onClose) # if PiPServiceRelation is installed, get relation dict if plugin_PiPServiceRelation_installed: self.pipServiceRelation = getRelationDict() else: self.pipServiceRelation = {}
def __init__(self, session, service, zapFunc = None, eventid = None, bouquetChangeCB = None, serviceChangeCB = None, EPGtype = None, StartBouquet = None, StartRef = None, bouquetname = ''): Screen.__init__(self, session) HelpableScreen.__init__(self) self.longbuttonpressed = False self.zapFunc = zapFunc self.bouquetChangeCB = bouquetChangeCB self.serviceChangeCB = serviceChangeCB graphic = False if EPGtype == 'single': self.type = EPG_TYPE_SINGLE elif EPGtype == 'infobar': self.type = EPG_TYPE_INFOBAR elif EPGtype == 'enhanced': self.type = EPG_TYPE_ENHANCED elif EPGtype == 'graph': self.type = EPG_TYPE_GRAPH if config.epgselection.graph_type_mode.getValue() == "graphics": graphic = True elif EPGtype == 'infobargraph': self.type = EPG_TYPE_INFOBARGRAPH if config.epgselection.infobar_type_mode.getValue() == "graphics": graphic = True elif EPGtype == 'multi': self.type = EPG_TYPE_MULTI else: self.type = EPG_TYPE_SIMILAR if not self.type == EPG_TYPE_SINGLE: self.StartBouquet = StartBouquet self.StartRef = StartRef self.bouquetname = bouquetname self.servicelist = None self.ask_time = -1 self.closeRecursive = False self.eventviewDialog = None self.eventviewWasShown = False self.currch = None self.session.pipshown = False if plugin_PiPServiceRelation_installed: self.pipServiceRelation = getRelationDict() else: self.pipServiceRelation = {} self['Service'] = ServiceEvent() self['Event'] = Event() self.key_green_choice = self.EMPTY self['key_red'] = Button(_('IMDb Search')) self['key_green'] = Button(_('Add Timer')) self['key_yellow'] = Button(_('EPG Search')) self['key_blue'] = Button(_('Add AutoTimer')) self['okactions'] = HelpableActionMap(self, 'OkCancelActions', { 'cancel': (self.closeScreen, _('Exit EPG')), 'OK': (self.OK, _('Zap to channel (setup in menu)')), 'OKLong': (self.OKLong, _('Zap to channel and close (setup in menu)')) }, -1) self['okactions'].csel = self self['colouractions'] = HelpableActionMap(self, 'ColorActions', { 'red': (self.redButtonPressed, _('IMDB search for current event')), 'redlong': (self.redlongButtonPressed, _('Sort EPG List')), 'green': (self.greenButtonPressed, _('Add/Remove timer for current event')), 'yellow': (self.yellowButtonPressed, _('Search for similar events')), 'greenlong': (self.showTimerList, _('Show Timer List')), 'blue': (self.blueButtonPressed, _('Add a auto timer for current event')), 'bluelong': (self.bluelongButtonPressed, _('Show AutoTimer List')) }, -1) self['colouractions'].csel = self self['recordingactions'] = HelpableActionMap(self, 'InfobarInstantRecord', { 'ShortRecord': (self.doRecordTimer, _('Add a record timer for current event')), 'LongRecord': (self.doZapTimer, _('Add a zap timer for current event')) }, -1) self['recordingactions'].csel = self if self.type == EPG_TYPE_SIMILAR: self.currentService = service self.eventid = eventid self['epgactions'] = HelpableActionMap(self, 'EPGSelectActions', { 'info': (self.Info, _('Show detailed event info')), 'infolong': (self.InfoLong, _('Show single epg for current channel')), 'menu': (self.createSetup, _('Setup menu')) }, -1) self['epgactions'].csel = self elif self.type == EPG_TYPE_SINGLE: self.currentService = ServiceReference(service) self['epgactions'] = HelpableActionMap(self, 'EPGSelectActions', { 'info': (self.Info, _('Show detailed event info')), 'epg': (self.Info, _('Show detailed event info')), 'menu': (self.createSetup, _('Setup menu')) }, -1) self['epgactions'].csel = self self['cursoractions'] = HelpableActionMap(self, 'DirectionActions', { 'left': (self.prevPage, _('Move up a page')), 'right': (self.nextPage, _('Move down a page')), 'up': (self.moveUp, _('Goto previous channel')), 'down': (self.moveDown, _('Goto next channel')) }, -1) self['cursoractions'].csel = self elif self.type == EPG_TYPE_INFOBAR or self.type == EPG_TYPE_ENHANCED: if self.type == EPG_TYPE_INFOBAR: self.skinName = 'QuickEPG' self['epgactions'] = HelpableActionMap(self, 'EPGSelectActions', { 'nextBouquet': (self.nextBouquet, _('Goto next bouquet')), 'prevBouquet': (self.prevBouquet, _('Goto previous bouquet')), 'nextService': (self.nextPage, _('Move down a page')), 'prevService': (self.prevPage, _('Move up a page')), 'input_date_time': (self.enterDateTime, _('Goto specific data/time')), 'info': (self.Info, _('Show detailed event info')), 'infolong': (self.InfoLong, _('Show single epg for current channel')), 'menu': (self.createSetup, _('Setup menu')) }, -1) self['epgactions'].csel = self self['cursoractions'] = HelpableActionMap(self, 'DirectionActions', { 'left': (self.prevService, _('Goto previous channel')), 'right': (self.nextService, _('Goto next channel')), 'up': (self.moveUp, _('Goto previous channel')), 'down': (self.moveDown, _('Goto next channel')) }, -1) self['cursoractions'].csel = self elif self.type == EPG_TYPE_ENHANCED: self['epgactions'] = HelpableActionMap(self, 'EPGSelectActions', { 'nextBouquet': (self.nextBouquet, _('Goto next bouquet')), 'prevBouquet': (self.prevBouquet, _('Goto previous bouquet')), 'nextService': (self.nextService, _('Goto next channel')), 'prevService': (self.prevService, _('Goto previous channel')), 'input_date_time': (self.enterDateTime, _('Goto specific data/time')), 'info': (self.Info, _('Show detailed event info')), 'infolong': (self.InfoLong, _('Show single epg for current channel')), 'menu': (self.createSetup, _('Setup menu')) }, -1) self['epgactions'].csel = self self['cursoractions'] = HelpableActionMap(self, 'DirectionActions', { 'left': (self.prevPage, _('Move up a page')), 'right': (self.nextPage, _('Move down a page')), 'up': (self.moveUp, _('Goto previous channel')), 'down': (self.moveDown, _('Goto next channel')) }, -1) self['cursoractions'].csel = self self['inputactions'] = HelpableNumberActionMap(self, 'NumberActions', { '1': (self.keyNumberGlobal, _('enter number to jump to channel.')), '2': (self.keyNumberGlobal, _('enter number to jump to channel.')), '3': (self.keyNumberGlobal, _('enter number to jump to channel.')), '4': (self.keyNumberGlobal, _('enter number to jump to channel.')), '5': (self.keyNumberGlobal, _('enter number to jump to channel.')), '6': (self.keyNumberGlobal, _('enter number to jump to channel.')), '7': (self.keyNumberGlobal, _('enter number to jump to channel.')), '8': (self.keyNumberGlobal, _('enter number to jump to channel.')), '9': (self.keyNumberGlobal, _('enter number to jump to channel.')) }, -1) self['inputactions'].csel = self self.list = [] self.servicelist = service self.currentService = self.session.nav.getCurrentlyPlayingServiceOrGroup() elif self.type == EPG_TYPE_GRAPH or self.type == EPG_TYPE_INFOBARGRAPH: if self.type == EPG_TYPE_GRAPH: if not config.epgselection.graph_pig.getValue(): self.skinName = 'GraphicalEPG' else: self.skinName = 'GraphicalEPGPIG' elif self.type == EPG_TYPE_INFOBARGRAPH: self.skinName = 'GraphicalInfoBarEPG' now = time() - int(config.epg.histminutes.getValue()) * 60 if self.type == EPG_TYPE_GRAPH: self.ask_time = self.ask_time = now - now % (int(config.epgselection.graph_roundto.getValue()) * 60) elif self.type == EPG_TYPE_INFOBARGRAPH: self.ask_time = self.ask_time = now - now % (int(config.epgselection.infobar_roundto.getValue()) * 60) self.closeRecursive = False self['lab1'] = Label(_('Wait please while gathering data...')) self['timeline_text'] = TimelineText(type=self.type,graphic=graphic) self['Event'] = Event() self['primetime'] = Label(_('PRIMETIME')) self['change_bouquet'] = Label(_('CHANGE BOUQUET')) self['jump'] = Label(_('JUMP 24 HOURS')) self['page'] = Label(_('PAGE UP/DOWN')) self.time_lines = [] for x in range(0, MAX_TIMELINES): pm = Pixmap() self.time_lines.append(pm) self['timeline%d' % x] = pm self['timeline_now'] = Pixmap() self.services = service self.curBouquet = bouquetChangeCB self.updateTimelineTimer = eTimer() self.updateTimelineTimer.callback.append(self.moveTimeLines) self.updateTimelineTimer.start(60000) self['epgactions'] = HelpableActionMap(self, 'EPGSelectActions', { 'nextService': (self.nextService, _('Jump forward 24 hours')), 'prevService': (self.prevService, _('Jump back 24 hours')), 'nextBouquet': (self.nextBouquet, _('Goto next bouquet')), 'prevBouquet': (self.prevBouquet, _('Goto previous bouquet')), 'input_date_time': (self.enterDateTime, _('Goto specific data/time')), 'info': (self.Info, _('Show detailed event info')), 'infolong': (self.InfoLong, _('Show single epg for current channel')), 'tv': (self.togglePIG, _('Toggle Picture In Graphics')), 'menu': (self.createSetup, _('Setup menu')) }, -1) self['epgactions'].csel = self self['cursoractions'] = HelpableActionMap(self, 'DirectionActions', { 'left': (self.leftPressed, _('Goto previous event')), 'right': (self.rightPressed, _('Goto next event')), 'up': (self.moveUp, _('Goto previous channel')), 'down': (self.moveDown, _('Goto next channel')) }, -1) self['cursoractions'].csel = self self['input_actions'] = HelpableNumberActionMap(self, 'NumberActions', { '1': (self.keyNumberGlobal, _('Reduce time scale')), '2': (self.keyNumberGlobal, _('Page up')), '3': (self.keyNumberGlobal, _('Increase time scale')), '4': (self.keyNumberGlobal, _('page left')), '5': (self.keyNumberGlobal, _('Jump to current time')), '6': (self.keyNumberGlobal, _('Page right')), '7': (self.keyNumberGlobal, _('No of items switch (increase or reduced)')), '8': (self.keyNumberGlobal, _('Page down')), '9': (self.keyNumberGlobal, _('Jump to prime time')), '0': (self.keyNumberGlobal, _('Move to home of list')) }, -1) self['input_actions'].csel = self elif self.type == EPG_TYPE_MULTI: self.skinName = 'EPGSelectionMulti' self['now_button'] = Pixmap() self['next_button'] = Pixmap() self['more_button'] = Pixmap() self['now_button_sel'] = Pixmap() self['next_button_sel'] = Pixmap() self['more_button_sel'] = Pixmap() self['now_text'] = Label() self['next_text'] = Label() self['more_text'] = Label() self['date'] = Label() self.services = service self.curBouquet = bouquetChangeCB self['epgactions'] = HelpableActionMap(self, 'EPGSelectActions', { 'nextService': (self.nextPage, _('Move down a page')), 'prevService': (self.prevPage, _('Move up a page')), 'nextBouquet': (self.nextBouquet, _('Goto next bouquet')), 'prevBouquet': (self.prevBouquet, _('Goto previous bouquet')), 'input_date_time': (self.enterDateTime, _('Goto specific data/time')), 'info': (self.Info, _('Show detailed event info')), 'infolong': (self.InfoLong, _('Show single epg for current channel')), 'menu': (self.createSetup, _('Setup menu')) }, -1) self['epgactions'].csel = self self['cursoractions'] = HelpableActionMap(self, 'DirectionActions', { 'left': (self.leftPressed, _('Move up a page')), 'right': (self.rightPressed, _('Move down a page')), 'up': (self.moveUp, _('Goto previous channel')), 'down': (self.moveDown, _('Goto next channel')) }, -1) self['cursoractions'].csel = self if self.type == EPG_TYPE_GRAPH: time_epoch=config.epgselection.graph_prevtimeperiod.getValue() elif self.type == EPG_TYPE_INFOBARGRAPH: time_epoch=config.epgselection.infobar_prevtimeperiod.getValue() else: time_epoch=None self['list'] = EPGList(type=self.type, selChangedCB=self.onSelectionChanged, timer=session.nav.RecordTimer, time_epoch=time_epoch, overjump_empty=config.epgselection.overjump.getValue(), graphic=graphic) self.refreshTimer = eTimer() self.refreshTimer.timeout.get().append(self.refreshData) self.listTimer = eTimer() self.listTimer.timeout.get().append(self.hidewaitingtext) self.onLayoutFinish.append(self.onCreate)
def __init__(self, session, servicelist = None): Screen.__init__(self, session) self.session = session if SystemInfo.get("NumVideoDecoders", 1) > 1 and config.plugins.virtualzap.usepip.value and config.plugins.virtualzap.showpipininfobar.value: self.skinName = "VirtualZap" self.pipAvailable = True else: self.skinName = "VirtualZapNoPiP" self.pipAvailable = (SystemInfo.get("NumVideoDecoders", 1) > 1) and config.plugins.virtualzap.usepip.value and not config.plugins.virtualzap.showpipininfobar.value self.epgcache = eEPGCache.getInstance() self.CheckForEPG = eTimer() self.CheckForEPG.callback.append(self.CheckItNow) self["NowChannel"] = Label() self["NowEPG"] = Label() self["NextEPG"] = Label() self["NowTime"] = Label() self["NextTime"] = Label() self["actions"] = ActionMap(["OkCancelActions", "DirectionActions", "ChannelSelectBaseActions", "ChannelSelectEPGActions", "ColorActions"], { "ok": self.ok, "cancel": self.closing, "right": self.nextService, "left": self.prevService, "nextBouquet": self.showFavourites, "prevBouquet": self.openServiceList, "showEPGList": self.openEventView, "blue": self.standardPiP, "yellow": self.switchAndStandardPiP, "down": self.switchChannelDown, "up": self.switchChannelUp, },-2) self["actions2"] = NumberActionMap(["NumberActions"], { "0": self.swap, "1": self.keyNumberGlobal, "2": self.keyNumberGlobal, "3": self.keyNumberGlobal, "4": self.keyNumberGlobal, "5": self.keyNumberGlobal, "6": self.keyNumberGlobal, "7": self.keyNumberGlobal, "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, }, -1) self.onLayoutFinish.append(self.onLayoutReady) # PiP if self.pipAvailable: # activate PiP support if config.plugins.virtualzap.usepip.value and not config.plugins.virtualzap.showpipininfobar.value: # activate standard PiP self["video"] = VideoWindow() else: # show PiP in Infobar self["video"] = VideoWindow(fb_width = getDesktop(0).size().width(), fb_height = getDesktop(0).size().height()) self.currentPiP = "" else: # no PiP self["video"] = Label() # this is the servicelist from ChannelSelectionBase self.servicelist = servicelist # save orig. method of zap in servicelist self.servicelist_orig_zap = self.servicelist.zap # when displaying ChannelSelection, do not zap when pressing "ok", so new method is needed self.servicelist.zap = self.servicelist_overwrite_zap # overwrite the actionmap of ChannelSelection self.servicelist["actions"] = ActionMap(["OkCancelActions"], { "cancel": self.cancelChannelSelection, "ok": self.servicelist.channelSelected, }) # temp. vars, needed when pressing cancel in ChannelSelection self.curSelectedRef = None self.curSelectedBouquet = None # needed, because if we won't zap, we have to go back to the current bouquet and service self.curRef = ServiceReference(self.servicelist.getCurrentSelection()) self.curBouquet = self.servicelist.getRoot() # start with last used service if config.plugins.virtualzap.saveLastService.value: # get service and bouquet ref ref = eServiceReference(config.plugins.virtualzap.curref.value) bouquet = eServiceReference(config.plugins.virtualzap.curbouquet.value) if ref.valid() and bouquet.valid(): # select bouquet and ref in servicelist self.setServicelistSelection(bouquet, ref) # prepare exitTimer self.exitTimer = eTimer() self.exitTimer.timeout.get().append(self.standardPiP) # reverse changes of ChannelSelection when closing plugin self.onClose.append(self.__onClose) # if PiPServiceRelation is installed, get relation dict if plugin_PiPServiceRelation_installed: self.pipServiceRelation = getRelationDict() else: self.pipServiceRelation = {}
def __init__(self, session, epgConfig, startBouquet=None, startRef=None, bouquets=None): Screen.__init__(self, session) HelpableScreen.__init__(self) self.epgConfig = epgConfig self.bouquets = bouquets self.originalPlayingServiceOrGroup = self.session.nav.getCurrentlyPlayingServiceOrGroup( ) self.startBouquet = startBouquet self.startRef = startRef self.choiceBoxDialog = None self.closeRecursive = False self.eventviewDialog = None self.eventviewWasShown = False self.session.pipshown = False self.pipServiceRelation = getRelationDict( ) if plugin_PiPServiceRelation_installed else {} self["Service"] = ServiceEvent() self["Event"] = Event() self["lab1"] = Label(_("Please wait while gathering EPG data...")) self["lab1"].hide() self["key_red"] = Button(_("IMDb Search")) self["key_green"] = Button(_("Add Timer")) self["key_yellow"] = Button(_("EPG Search")) self["key_blue"] = Button(_("Add AutoTimer")) helpDescription = _("EPG Commands") self["dialogactions"] = HelpableActionMap( self, "WizardActions", { "back": (self.closeChoiceBoxDialog, _("Close dialog box")), }, prio=-1, description=helpDescription) self["dialogactions"].setEnabled(False) self["okactions"] = HelpableActionMap( self, "OkCancelActions", { "cancel": (self.closeScreen, _("Exit EPG")), "OK": (ignoreLongKeyPress(self.OK), _("Zap to channel/service")), "OKLong": (self.OKLong, _("Zap to channel/service and close")) }, prio=-1, description=helpDescription) self["colouractions"] = HelpableActionMap( self, "ColorActions", { "red": (ignoreLongKeyPress( self.openIMDb), _("IMDB search for current event")), "redlong": (self.sortEPG, _("Sort the EPG list")), "green": (ignoreLongKeyPress(self.addEditTimer), _("Add/Remove timer for current event")), "greenlong": (self.openTimerList, _("Show timer list")), "yellow": (ignoreLongKeyPress( self.openEPGSearch), _("Search for similar events")), "blue": (ignoreLongKeyPress(self.addAutoTimer), _("Add an autotimer for current event")), "bluelong": (self.openAutoTimerList, _("Show autotimer list")) }, prio=-1, description=helpDescription) self["recordingactions"] = HelpableActionMap( self, "InfobarInstantRecord", { "ShortRecord": (self.recordTimerQuestion, _("Add a record timer for current event")), "LongRecord": (self.doZapTimer, _("Add a zap timer for current event")) }, prio=-1, description=helpDescription) self["epgactions"] = HelpableActionMap(self, "EPGSelectActions", {}, -1) self.noAutotimer = _( "The AutoTimer plugin is not installed!\nPlease install it.") self.noEPGSearch = _( "The EPGSearch plugin is not installed!\nPlease install it.") self.noIMDb = _( "The IMDb plugin is not installed!\nPlease install it.") self.refreshTimer = eTimer() self.refreshTimer.timeout.get().append(self.refreshList) self.onLayoutFinish.append(self.onCreate)