Esempio n. 1
0
 def __init__(self, event, ref, callback=None, similarEPGCB=None):
     self.similarEPGCB = similarEPGCB
     self.cbFunc = callback
     self.currentService = ref
     self.isRecording = (
         not ref.ref.flags & eServiceReference.isGroup
     ) and ref.ref.getPath() and ref.ref.getPath()[0] == '/'
     self.event = event
     self["Service"] = ServiceEvent()
     self["Event"] = Event()
     self["epg_eventname"] = ScrollLabel()
     self["epg_description"] = ScrollLabel()
     self["FullDescription"] = ScrollLabel()
     self["summary_description"] = StaticText()
     self["datetime"] = Label()
     self["channel"] = Label()
     self["duration"] = Label()
     if similarEPGCB is not None:
         self["key_red"] = Button("")
         self.SimilarBroadcastTimer = eTimer()
         self.SimilarBroadcastTimer.callback.append(self.getSimilarEvents)
     else:
         self.SimilarBroadcastTimer = None
     self["actions"] = ActionMap(
         ["OkCancelActions", "EventViewActions"], {
             "cancel": self.close,
             "ok": self.close,
             "pageUp": self.pageUp,
             "pageDown": self.pageDown,
             "prevEvent": self.prevEvent,
             "nextEvent": self.nextEvent,
             "contextMenu": self.doContext,
         })
     self['dialogactions'] = ActionMap(['WizardActions'], {
         'back': self.closeChoiceBoxDialog,
     }, -1)
     self['dialogactions'].csel = self
     self["dialogactions"].setEnabled(False)
     self.onLayoutFinish.append(self.onCreate)
Esempio n. 2
0
	def __init__(self, event, Ref, callback=None, similarEPGCB=None):
		self.similarEPGCB = similarEPGCB
		self.cbFunc = callback
		self.currentService=Ref
		self.isRecording = (not Ref.ref.flags & eServiceReference.isGroup) and Ref.ref.getPath()
		self.event = event
		self["Service"] = ServiceEvent()
		self["Event"] = Event()
		self["epg_description"] = ScrollLabel()
		self["FullDescription"] = ScrollLabel()
		self["datetime"] = Label()
		self["channel"] = Label()
		self["duration"] = Label()
		self["key_red"] = Button("")
		if similarEPGCB is not None:
			self.SimilarBroadcastTimer = eTimer()
			self.SimilarBroadcastTimer.callback.append(self.getSimilarEvents)
		else:
			self.SimilarBroadcastTimer = None
		self.key_green_choice = self.ADD_TIMER
		if self.isRecording:
			self["key_green"] = Button("")
		else:
			self["key_green"] = Button(_("Add timer"))
		self["key_yellow"] = Button("")
		self["key_blue"] = Button("")
		self["actions"] = ActionMap(["OkCancelActions", "EventViewActions"],
			{
				"cancel": self.close,
				"ok": self.close,
				"pageUp": self.pageUp,
				"pageDown": self.pageDown,
				"prevEvent": self.prevEvent,
				"nextEvent": self.nextEvent,
				"timerAdd": self.timerAdd,
				"openSimilarList": self.openSimilarList,
				"contextMenu": self.doContext,
			})
		self.onShown.append(self.onCreate)
Esempio n. 3
0
 def __init__(self, event, ref, callback=None, similarEPGCB=None):
     self.similarEPGCB = similarEPGCB
     self.cbFunc = callback
     self.currentService = ref
     self.isRecording = not ref.ref.flags & eServiceReference.isGroup and ref.ref.getPath(
     )
     self.event = event
     self['Service'] = ServiceEvent()
     self['Event'] = Event()
     self['epg_description'] = ScrollLabel()
     self['FullDescription'] = ScrollLabel()
     self['summary_description'] = StaticText()
     self['datetime'] = Label()
     self['channel'] = Label()
     self['duration'] = Label()
     if similarEPGCB is not None:
         self['key_red'] = Button('')
         self.SimilarBroadcastTimer = eTimer()
         self.SimilarBroadcastTimer.callback.append(self.getSimilarEvents)
     else:
         self.SimilarBroadcastTimer = None
     self['actions'] = ActionMap(
         ['OkCancelActions', 'EventViewActions'], {
             'cancel': self.close,
             'ok': self.close,
             'info': self.close,
             'pageUp': self.pageUp,
             'pageDown': self.pageDown,
             'prevEvent': self.prevEvent,
             'nextEvent': self.nextEvent,
             'contextMenu': self.doContext
         })
     self['dialogactions'] = ActionMap(['WizardActions'],
                                       {'back': self.closeChoiceBoxDialog},
                                       -1)
     self['dialogactions'].csel = self
     self['dialogactions'].setEnabled(False)
     self.onLayoutFinish.append(self.onCreate)
Esempio n. 4
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.skinName = "TimerEditList"
		Screen.setTitle(self, _("PowerTimer List"))

		self.onChangedEntry = []
		list = []
		self.list = list
		self.fillTimerList()

		self["timerlist"] = PowerTimerList(list)

		self.key_red_choice = self.EMPTY
		self.key_yellow_choice = self.EMPTY
		self.key_blue_choice = self.EMPTY

		self["key_red"] = Button(" ")
		self["key_green"] = Button(_("Add"))
		self["key_yellow"] = Button(" ")
		self["key_blue"] = Button(" ")

		self["description"] = Label()
		self["ServiceEvent"] = ServiceEvent()

		self["actions"] = ActionMap(["OkCancelActions", "DirectionActions", "ShortcutActions", "TimerEditActions"],
			{
				"ok": self.openEdit,
				"cancel": self.leave,
				"green": self.addCurrentTimer,
				"log": self.showLog,
				"left": self.left,
				"right": self.right,
				"up": self.up,
				"down": self.down
			}, -1)
		self.setTitle(_("PowerTimer Overview"))
		self.session.nav.PowerTimer.on_state_change.append(self.onStateChange)
		self.onShown.append(self.updateState)
Esempio n. 5
0
	def __init__(self, session, getServiceByNumber, callback, number):
		Screen.__init__(self, session)
		self.skinName = "EPGServiceNumberSelection"
		self.getServiceByNumber = getServiceByNumber
		self.callback = callback

		helpDescription = _("EPG Commands")
		helpMsg = _("Enter a number to jump to a service/channel")
		self["actions"] = HelpableNumberActionMap(self, "NumberActions",
			dict([(str(i), (self.keyNumber, helpMsg)) for i in range(0, 10)]),
			prio=-1, description=helpDescription)
		self["cancelaction"] = HelpableActionMap(self, "OkCancelActions", {
			"cancel": (self.__cancel, _("Exit channel selection")),
			"OK": (self.__OK, _("Select EPG channel"))
		}, prio=-1, description=helpDescription)

		self["number"] = Label()
		self["service"] = ServiceEvent()
		self["service"].newService(None)

		self.timer = eTimer()
		self.timer.callback.append(self.__OK)
		self.number = ""
		self.keyNumber(number)
 def __init__(self, servicecenter):
     ServiceEvent.__init__(self)
     self.servicecenter = servicecenter
Esempio n. 7
0
    def __init__(self, session, *args):
        Screen.__init__(self, session)
        self.skinName = ["EPGSearch", "EPGSelection"]

        self.searchargs = args
        self.currSearch = ""
        self.longbuttonpressed = False

        # XXX: we lose sort begin/end here
        self["key_yellow"] = Button(_("New Search"))
        self["key_blue"] = Button(_("Add AutoTimer"))

        # begin stripped copy of EPGSelection.__init__
        self.ChoiceBoxDialog = None
        self.bouquetChangeCB = None
        self.serviceChangeCB = None
        self.ask_time = -1  #now
        self.closeRecursive = False
        self.saved_title = None
        self["Service"] = ServiceEvent()
        self["Event"] = Event()
        self["number"] = Label()
        self["number"].hide()
        self.type = EPG_TYPE_SINGLE
        self.currentService = None
        self.zapFunc = None
        self.currch = None
        self.sort_type = 0
        self.eventviewDialog = None
        self["key_red"] = Button(_("IMDb Search"))
        self["key_green"] = Button(_("Add timer"))
        self.key_green_choice = self.ADD_TIMER
        self.key_red_choice = self.EMPTY
        self["list"] = EPGSearchList(type=self.type,
                                     selChangedCB=self.onSelectionChanged,
                                     timer=session.nav.RecordTimer)

        self['dialogactions'] = HelpableActionMap(self, 'WizardActions', {
            'back': (self.closeChoiceBoxDialog, _('Close dialog')),
        }, -1)
        self['dialogactions'].csel = self
        self["dialogactions"].setEnabled(False)

        self['okactions'] = HelpableActionMap(
            self, 'OkCancelActions', {
                'cancel': (self.closeScreen, _('Exit EPG')),
                'OK': (self.epgsearchOK, _('Zap to channel (setup in menu)')),
                'OKLong': (self.epgsearchOKLong,
                           _('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')),
                'green':
                (self.timerAdd, _('Add/Remove timer for current event')),
                'yellow':
                (self.yellowButtonPressed, _('Search for similar events')),
                'blue': (self.exportAutoTimer,
                         _('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

        self['epgactions'] = HelpableActionMap(
            self, 'EPGSelectActions', {
                'nextBouquet': (self.nextBouquet, _('Goto next bouquet')),
                'prevBouquet': (self.prevBouquet, _('Goto previous bouquet')),
                'nextService': (self.nextService, _('Move down a page')),
                'prevService': (self.prevService, _('Move up a page')),
                'epg': (self.Info, _('Show detailed event info')),
                'info': (self.Info, _('Show detailed event info')),
                'infolong': (self.infoKeyPressed,
                             _('Show single epg for current channel')),
                'menu': (self.menu, _('Setup menu'))
            }, -1)
        self['epgactions'].csel = self

        self['epgcursoractions'] = 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['epgcursoractions'].csel = self

        self.onLayoutFinish.append(self.onCreate)
        # end stripped copy of EPGSelection.__init__

        # Partnerbox
        if PartnerBoxIconsEnabled:
            EPGSelection.PartnerboxInit(self, False)

        self.refreshTimer = eTimer()
        self.refreshTimer.timeout.get().append(self.refreshlist)

        # Hook up actions for yttrailer if installed
        try:
            from Plugins.Extensions.YTTrailer.plugin import baseEPGSelection__init__
        except ImportError as ie:
            pass
        else:
            if baseEPGSelection__init__ is not None:
                self["trailerActions"] = ActionMap(
                    ["InfobarActions", "InfobarTeletextActions"], {
                        "showTv": self.showTrailer,
                        "showRadio": self.showTrailerList,
                        "startTeletext": self.showConfig
                    })
Esempio n. 8
0
    def __init__(self,
                 session,
                 service,
                 zapFunc=None,
                 eventid=None,
                 bouquetChangeCB=None,
                 serviceChangeCB=None,
                 parent=None):
        Screen.__init__(self, session)
        self.bouquetChangeCB = bouquetChangeCB
        self.serviceChangeCB = serviceChangeCB
        self.ask_time = -1  #now
        self["key_red"] = StaticText("")
        self.closeRecursive = False
        self.saved_title = None
        self["Service"] = ServiceEvent()
        self["Event"] = Event()
        self.session = session
        self.Console = Console()
        if isinstance(service, str) and eventid is not None:
            self.type = EPG_TYPE_SIMILAR
            self.setTitle(_("Similar EPG"))
            self["key_yellow"] = StaticText()
            self["key_blue"] = StaticText()
            self["key_red"] = StaticText()
            self.currentService = service
            self.eventid = eventid
            self.zapFunc = None
        elif isinstance(service, eServiceReference) or isinstance(
                service, str):
            self.setTitle(_("Single EPG"))
            self.type = EPG_TYPE_SINGLE
            self["key_yellow"] = StaticText()
            self["key_blue"] = StaticText(_("Select Channel"))
            self.currentService = ServiceReference(service)
            self.zapFunc = zapFunc
            self.sort_type = 0
            self.setSortDescription()
        else:
            self.setTitle(_("Multi EPG"))
            self.skinName = "EPGSelectionMulti"
            self.type = EPG_TYPE_MULTI
            if self.bouquetChangeCB == StaticText:
                self["key_yellow"] = StaticText(
                    pgettext("button label, 'previous screen'", "Prev"))
                self["key_blue"] = StaticText(
                    pgettext("button label, 'next screen'", "Next"))
            else:
                self["key_yellow"] = Button(
                    pgettext("button label, 'previous screen'", "Prev"))
                self["key_blue"] = Button(
                    pgettext("button label, 'next screen'", "Next"))
            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.zapFunc = zapFunc
        self.parent = parent
        if self.bouquetChangeCB == StaticText:
            self["key_green"] = StaticText(_("Add timer"))
        else:
            self["key_green"] = Button(_("Add timer"))
        self.key_green_choice = self.ADD_TIMER
        self.key_red_choice = self.EMPTY
        self["list"] = EPGList(type=self.type,
                               selChangedCB=self.onSelectionChanged,
                               timer=session.nav.RecordTimer)

        self["actions"] = ActionMap(
            ["EPGSelectActions", "OkCancelActions"],
            {
                "cancel": self.closeScreen,
                "ok": self.eventSelected,
                "timerAdd": self.timerAdd,
                "yellow": self.yellowButtonPressed,
                "blue": self.blueButtonPressed,
                "info": self.infoKeyPressed,
                "menu": self.furtherOptions,
                "nextBouquet": self.nextBouquet,  # just used in multi epg yet
                "prevBouquet": self.prevBouquet,  # just used in multi epg yet
                "nextService": self.nextService,  # just used in single epg yet
                "prevService": self.prevService,  # just used in single epg yet
                "preview": self.eventPreview,
            })

        self['colouractions'] = HelpableActionMap(
            self, 'ColorActions',
            {"red": (self.GoToTmbd, _("Search event in TMBD"))})

        self.isTMBD = fileExists(
            resolveFilename(SCOPE_PLUGINS, "Extensions/TMBD/plugin.pyo"))
        if self.isTMBD:
            self["key_red"] = Button(_("Search TMBD"))
            self.select = True
        if not self.isTMBD:
            self["key_red"] = Button(_("TMBD Not Installed"))
            self.select = False
        try:
            from Plugins.Extensions.YTTrailer.plugin import baseEPGSelection__init__
            description = _("Search yt-trailer for event")
        except ImportError as ie:
            pass
        else:
            if baseEPGSelection__init__ is not None:
                self["trailerActions"] = ActionMap(
                    ["InfobarActions", "InfobarTeletextActions"], {
                        "showTv": self.showTrailer,
                        "showRadio": self.showTrailerList,
                        "startTeletext": self.showConfig
                    })
        self["actions"].csel = self
        if parent and hasattr(parent, "fallbackTimer"):
            self.fallbackTimer = parent.fallbackTimer
            self.onLayoutFinish.append(self.onCreate)
        else:
            self.fallbackTimer = FallbackTimerList(self, self.onCreate)
Esempio n. 9
0
	def __init__(self, session, *args):
		Screen.__init__(self, session)
		self.skinName = ["EPGSearch", "EPGSelection"]

		self.searchargs = args
		self.currSearch = ""

		# XXX: we lose sort begin/end here
		self["key_yellow"] = Button(_("New Search"))
		self["key_blue"] = Button(_("History"))

# begin stripped copy of EPGSelection.__init__
		self.bouquetChangeCB = None
		self.serviceChangeCB = None
		self.ask_time = -1 #now
		self["key_red"] = Button("")
		self.closeRecursive = False
		self.saved_title = None
		self["Service"] = ServiceEvent()
		self["Event"] = Event()
		self.type = EPG_TYPE_SINGLE
		self.currentService=None
		self.zapFunc = None
		self.sort_type = 0
		self["key_green"] = Button(_("Add timer"))
		self.key_green_choice = self.ADD_TIMER
		self.key_red_choice = self.EMPTY
		self["list"] = EPGSearchList(type = self.type, selChangedCB = self.onSelectionChanged, timer = session.nav.RecordTimer)
		self["actions"] = ActionMap(["EPGSelectActions", "OkCancelActions", "MenuActions"],
			{
				"menu": self.menu,
				"cancel": self.closeScreen,
				"ok": self.eventSelected,
				"timerAdd": self.timerAdd,
				"yellow": self.yellowButtonPressed,
				"blue": self.blueButtonPressed,
				"info": self.infoKeyPressed,
				"red": self.zapToselect, # needed --> Partnerbox
				"nextBouquet": self.nextBouquet, # just used in multi epg yet
				"prevBouquet": self.prevBouquet, # just used in multi epg yet
				"nextService": self.nextService, # just used in single epg yet
				"prevService": self.prevService, # just used in single epg yet
			})

		self["actions"].csel = self
		self.onLayoutFinish.append(self.onCreate)
		# end stripped copy of EPGSelection.__init__
		self.select = False
		self.do_filter = None
		self.eventid = None
		self.isTMBD = fileExists("/usr/lib/enigma2/python/Plugins/Extensions/TMBD/plugin.pyo")
		# Partnerbox
		if PartnerBoxIconsEnabled:
			EPGSelection.PartnerboxInit(self, False)
			if self.isTMBD:
				self["key_red"].setText(_("Choice list"))
				self.select = True
		else:
			if self.isTMBD:
				self["key_red"].setText(_("Lookup in TMBD"))

		# Hook up actions for yttrailer if installed
		try:
			from Plugins.Extensions.YTTrailer.plugin import baseEPGSelection__init__
		except ImportError as ie:
			pass
		else:
			if baseEPGSelection__init__ is not None:
				self["trailerActions"] = ActionMap(["InfobarActions", "InfobarTeletextActions"],
				{
					"showTv": self.showTrailer,
					"showRadio": self.showTrailerList,
					"startTeletext": self.showConfig
				})
Esempio n. 10
0
 def __init__(self):
     self["Service"] = ServiceEvent()
     self.list.connectSelChanged(self.__selectionChanged)
     self.timer = eTimer()
     self.timer.callback.append(self.updateEventInfo)
     self.onShown.append(self.__selectionChanged)
Esempio n. 11
0
    def __init__(self, session, *args):
        Screen.__init__(self, session)
        self.skinName = ["EPGSearch", "EPGSelection"]

        self.searchargs = args
        self.currSearch = ""
        self.longbuttonpressed = False

        # XXX: we lose sort begin/end here
        self["key_yellow"] = Button(_("New Search"))
        self["key_blue"] = Button(_("Add AutoTimer"))

        # begin stripped copy of EPGSelection.__init__
        self.bouquetChangeCB = None
        self.serviceChangeCB = None
        self.ask_time = -1  #now
        self.closeRecursive = False
        self.saved_title = None
        self["Service"] = ServiceEvent()
        self["Event"] = Event()
        self.type = EPG_TYPE_SINGLE
        self.currentService = None
        self.zapFunc = None
        self.sort_type = 0
        self["key_red"] = Button(_("IMDb Search"))
        self["key_green"] = Button(_("Add timer"))
        self.key_green_choice = self.ADD_TIMER
        self.key_red_choice = self.EMPTY
        self["list"] = EPGSearchList(type=self.type,
                                     selChangedCB=self.onSelectionChanged,
                                     timer=session.nav.RecordTimer)
        self["actions"] = ActionMap(
            [
                "EPGSelectActions", "OkCancelActions", "MenuActions",
                'ColorActions', 'InfobarInstantRecord'
            ],
            {
                "menu": self.menu,
                "cancel": self.closeScreen,
                "OK": self.epgsearchOK,
                "OKLong": self.epgsearchOKLong,
                "epg": self.Info,
                "info": self.Info,
                "timerAdd": self.timerAdd,
                "yellow": self.yellowButtonPressed,
                "yellowlong": self.showHistory,
                "blue": self.exportAutoTimer,
                "info": self.infoKeyPressed,
                "red": self.redButtonPressed,
                "nextBouquet": self.nextBouquet,  # just used in multi epg yet
                "prevBouquet": self.prevBouquet,  # just used in multi epg yet
                "nextService": self.nextService,  # just used in single epg yet
                "prevService": self.prevService,  # just used in single epg yet
                "ShortRecord": self.doRecordTimer,
                "LongRecord": self.doZapTimer,
            })

        self["actions"].csel = self
        self.onLayoutFinish.append(self.onCreate)
        # end stripped copy of EPGSelection.__init__

        # Partnerbox
        if PartnerBoxIconsEnabled:
            EPGSelection.PartnerboxInit(self, False)

        self.refreshTimer = eTimer()
        self.refreshTimer.timeout.get().append(self.refreshData)

        # Hook up actions for yttrailer if installed
        try:
            from Plugins.Extensions.YTTrailer.plugin import baseEPGSelection__init__
        except ImportError as ie:
            pass
        else:
            if baseEPGSelection__init__ is not None:
                self["trailerActions"] = ActionMap(
                    ["InfobarActions", "InfobarTeletextActions"], {
                        "showTv": self.showTrailer,
                        "showRadio": self.showTrailerList,
                        "startTeletext": self.showConfig
                    })
Esempio n. 12
0
    def __init__(self, session, *args, **kwargs):
        Screen.__init__(self, session)
        self.skinName = ["EPGSearch", "EPGSelection"]

        self.searchargs = args
        self.searchkwargs = kwargs
        self.currSearch = ""

        self.currSearchSave = False
        self.currSearchDescription = False

        # XXX: we lose sort begin/end here
        self["key_yellow"] = Button(_("New Search"))
        self["key_blue"] = Button(self.getBlueButtonText())

        # begin stripped copy of EPGSelection.__init__
        self.bouquetChangeCB = None
        self.serviceChangeCB = None
        self.ask_time = -1  #now
        self["key_red"] = Button("")
        self.closeRecursive = False
        self.saved_title = None
        self["Service"] = ServiceEvent()
        self["Event"] = Event()
        self.type = EPG_TYPE_SINGLE
        self.currentService = None
        self.zapFunc = None
        self.sort_type = 0
        self["key_green"] = Button(_("Add timer"))
        self.key_green_choice = self.ADD_TIMER
        self.key_red_choice = self.EMPTY
        self["list"] = EPGSearchList(type=self.type,
                                     selChangedCB=self.onSelectionChanged,
                                     timer=session.nav.RecordTimer)
        self["actions"] = ActionMap(
            [
                "EPGSelectActions", "OkCancelActions", "MenuActions",
                "InputActions", "InfobarAudioSelectionActions"
            ],
            {
                "menu": self.menu,
                "cancel": self.closeScreen,
                "ok": self.eventSelected,
                "timerAdd": self.timerAdd,
                "yellow": self.yellowButtonPressed,
                "blue": self.blueButtonPressed,
                "info": self.infoKeyPressed,
                "red": self.zapTo,  # needed --> Partnerbox
                "nextBouquet": self.nextBouquet,  # just used in multi epg yet
                "prevBouquet": self.prevBouquet,  # just used in multi epg yet
                "nextService": self.nextService,  # just used in single epg yet
                "prevService": self.prevService,  # just used in single epg yet
                "1": self.importFromTimer,
                "2": self.importFromEPG,
                "3": self.importFromAutoTimer,
                "4": self.addAutoTimer,
                "5": self.exportAutoTimer,
                "6": self.openSPInfoScreen,
                "7": self.openImdb,
                "8": self.openTMDb,
                "9": self.openTMDbSerie,
                "0": self.setup,
                "audioSelection": self.searchNoNumber,
            })

        if autoTimerAvailable:
            self["EPGSeachFilterActions"] = ActionMap(
                ["WizardActions"], {
                    "video": self.openSearchFilterList,
                })

        self["actions"].csel = self
        self["list"].mostSearchService = ""
        self.onLayoutFinish.append(self.onCreate)
        # end stripped copy of EPGSelection.__init__

        # Partnerbox
        if PartnerBoxIconsEnabled:
            EPGSelection.PartnerboxInit(self, False)

        self.pluginList = [(p.name, p) for p in plugins.getPlugins(where=[
            PluginDescriptor.WHERE_EPG_SELECTION_SINGLE_BLUE,
            PluginDescriptor.WHERE_CHANNEL_SELECTION_RED
        ])]
        self.was_history_start = False
        if self.searchkwargs and self.searchkwargs.has_key(
                "startWithHistory") and self.searchkwargs["startWithHistory"]:
            self.onShown.append(self.__onShownStartHistory)
Esempio n. 13
0
	def __init__(self, session, services, zapFunc=None, bouquetChangeCB=None, bouquetname=""):
		Screen.__init__(self, session)
		self.bouquetChangeCB = bouquetChangeCB
		now = time() - config.epg.histminutes.value * 60
		self.ask_time = now - now % int(config.misc.graph_mepg.roundTo.value)
		self["key_red"] = Button("")
		self["key_green"] = Button("")

		global listscreen
		if listscreen:
			self["key_yellow"] = Button(_("Normal mode"))
			self.skinName="GraphMultiEPGList"
		else:
			self["key_yellow"] = Button(_("List mode"))

		self["key_blue"] = Button(_("Goto"))

		self.key_green_choice = self.EMPTY
		self.key_red_choice = self.EMPTY
		self["timeline_text"] = TimelineText()
		self["Service"] = ServiceEvent()
		self["Event"] = Event()
		self.time_lines = [ ]
		for x in list(range(0, MAX_TIMELINES)):
			pm = Pixmap()
			self.time_lines.append(pm)
			self["timeline%d"%(x)] = pm
		self["timeline_now"] = Pixmap()
		self.services = services
		self.zapFunc = zapFunc
		if bouquetname != "":
			Screen.setTitle(self, bouquetname)

		self["list"] = EPGList( selChangedCB = self.onSelectionChanged,
					timer = self.session.nav.RecordTimer,
					time_epoch = config.misc.graph_mepg.prev_time_period.value,
					overjump_empty = config.misc.graph_mepg.overjump.value)

		HelpableScreen.__init__(self)
		self["okactions"] = HelpableActionMap(self, "OkCancelActions",
			{
				"cancel": (self.closeScreen,   _("Exit EPG")),
				"ok":	  (self.eventSelected, _("Zap to selected channel, or show detailed event info (depends on configuration)"))
			}, -1)
		self["okactions"].csel = self
		self["epgactions"] = HelpableActionMap(self, "EPGSelectActions",
			{
				"timerAdd":    (self.timerAdd,       _("Add/remove change timer for current event")),
				"info":        (self.infoKeyPressed, _("Show detailed event info")),
				"red":         (self.zapTo,          _("Zap to selected channel")),
				"yellow":      (self.swapMode,       _("Switch between normal mode and list mode")),	
				"blue":        (self.enterDateTime,  _("Goto specific data/time")),
				"menu":        (self.showSetup,      _("Setup menu")),
				"nextBouquet": (self.nextBouquet,    _("Show bouquet selection menu")),
				"prevBouquet": (self.prevBouquet,    _("Show bouquet selection menu")),
				"nextService": (self.nextPressed,    _("Goto next page of events")),
				"prevService": (self.prevPressed,    _("Goto previous page of events")),
				"preview":     (self.preview,        _("Preview selected channel")),
				"nextDay":     (self.nextDay,        _("Goto next day of events")),
				"prevDay":     (self.prevDay,        _("Goto previous day of events"))
			}, -1)
		self["epgactions"].csel = self

		self["inputactions"] = HelpableActionMap(self, "InputActions",
			{
				"left":  (self.leftPressed,  _("Go to previous event")),
				"right": (self.rightPressed, _("Go to next event")),
				"1":     (self.key1,         _("Set time window to 1 hour")),
				"2":     (self.key2,         _("Set time window to 2 hours")),
				"3":     (self.key3,         _("Set time window to 3 hours")),
				"4":     (self.key4,         _("Set time window to 4 hours")),
				"5":     (self.key5,         _("Set time window to 5 hours")),
				"6":     (self.key6,         _("Set time window to 6 hours")),
				"7":     (self.prevPage,     _("Go to previous page of service")),
				"9":     (self.nextPage,     _("Go to next page of service")),
				"8":     (self.toTop,        _("Go to first service")),
				"0":     (self.toEnd,        _("Go to last service"))
			}, -1)
		self["inputactions"].csel = self

		self.updateTimelineTimer = eTimer()
		self.updateTimelineTimer.callback.append(self.moveTimeLines)
		self.updateTimelineTimer.start(60 * 1000)
		self.onLayoutFinish.append(self.onCreate)
		self.previousref = self.session.nav.getCurrentlyPlayingServiceOrGroup()
Esempio n. 14
0
    def __init__(self,
                 session,
                 service,
                 zapFunc=None,
                 eventid=None,
                 bouquetChangeCB=None,
                 serviceChangeCB=None):
        Screen.__init__(self, session)
        self.bouquetChangeCB = bouquetChangeCB
        self.serviceChangeCB = serviceChangeCB
        self.ask_time = -1  #now
        self["key_red"] = Button("")
        self.closeRecursive = False
        self.saved_title = None
        self["Service"] = ServiceEvent()
        self["Event"] = Event()
        self.session = session
        if isinstance(service, str) and eventid != None:
            self.type = EPG_TYPE_SIMILAR
            self["key_yellow"] = Button()
            self["key_blue"] = Button()
            self["key_red"] = Button()
            self.currentService = service
            self.eventid = eventid
            self.zapFunc = None
        elif isinstance(service, eServiceReference) or isinstance(
                service, str):
            self.type = EPG_TYPE_SINGLE
            self["key_yellow"] = Button()
            self["key_blue"] = Button()
            self.currentService = ServiceReference(service)
            self.zapFunc = zapFunc
            self.sort_type = 0
            self.setSortDescription()
        else:
            self.skinName = "EPGSelectionMulti"
            self.type = EPG_TYPE_MULTI
            self["key_yellow"] = Button(
                pgettext("button label, 'previous screen'", "Prev"))
            self["key_blue"] = Button(
                pgettext("button label, 'next screen'", "Next"))
            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.zapFunc = zapFunc

        self["key_green"] = Button(_("Add timer"))
        self.key_green_choice = self.ADD_TIMER
        self.key_red_choice = self.EMPTY
        self["list"] = EPGList(type=self.type,
                               selChangedCB=self.onSelectionChanged,
                               timer=session.nav.RecordTimer)

        self["actions"] = ActionMap(
            ["EPGSelectActions", "OkCancelActions"],
            {
                "cancel": self.closeScreen,
                "ok": self.eventSelected,
                "timerAdd": self.timerAdd,
                "yellow": self.yellowButtonPressed,
                "blue": self.blueButtonPressed,
                "info": self.infoKeyPressed,
                "red": self.zapTo,
                "menu": self.furtherOptions,
                "nextBouquet": self.nextBouquet,  # just used in multi epg yet
                "prevBouquet": self.prevBouquet,  # just used in multi epg yet
                "nextService": self.nextService,  # just used in single epg yet
                "prevService": self.prevService,  # just used in single epg yet
                "preview": self.eventPreview,
            })
        self["actions"].csel = self
        self.onLayoutFinish.append(self.onCreate)
Esempio n. 15
0
    def __init__(self, session, *args):
        Screen.__init__(self, session)
        self.skinName = ["EPGSearch", "EPGSelection"]

        self.searchargs = args
        self.currSearch = ""

        # XXX: we lose sort begin/end here
        self["key_yellow"] = Button(_("New Search"))
        self["key_blue"] = Button(_("History"))

        # begin stripped copy of EPGSelection.__init__
        self.bouquetChangeCB = None
        self.serviceChangeCB = None
        self.ask_time = -1  #now
        self["key_red"] = Button("")
        self.closeRecursive = False
        self.saved_title = None
        self["Service"] = ServiceEvent()
        self["Event"] = Event()
        self.type = EPG_TYPE_SINGLE
        self.currentService = None
        self.zapFunc = None
        self.sort_type = 0
        self["key_green"] = Button(_("Add timer"))
        self.key_green_choice = self.ADD_TIMER
        self.key_red_choice = self.EMPTY
        self["list"] = EPGSearchList(type=self.type,
                                     selChangedCB=self.onSelectionChanged,
                                     timer=session.nav.RecordTimer)
        self["actions"] = ActionMap(
            [
                "EPGSelectActions", "OkCancelActions", "MenuActions",
                "InputActions", "InfobarAudioSelectionActions"
            ],
            {
                "menu": self.menu,
                "cancel": self.closeScreen,
                "ok": self.eventSelected,
                "timerAdd": self.timerAdd,
                "yellow": self.yellowButtonPressed,
                "blue": self.blueButtonPressed,
                "info": self.infoKeyPressed,
                "red": self.zapTo,  # needed --> Partnerbox
                "nextBouquet": self.nextBouquet,  # just used in multi epg yet
                "prevBouquet": self.prevBouquet,  # just used in multi epg yet
                "nextService": self.nextService,  # just used in single epg yet
                "prevService": self.prevService,  # just used in single epg yet
                "1": self.importFromTimer,
                "2": self.importFromEPG,
                "3": self.importFromAutoTimer,
                "4": self.addAutoTimer,
                "5": self.exportAutoTimer,
                "6": self.openSPInfoScreen,
                "7": self.openImdb,
                "8": self.openTMDb,
                "9": self.openTMDbSerie,
                "0": self.setup,
                "audioSelection": self.searchNoNumber,
            })

        self["actions"].csel = self
        self["list"].mostSearchService = ""
        self.onLayoutFinish.append(self.onCreate)
        # end stripped copy of EPGSelection.__init__

        # Partnerbox
        if PartnerBoxIconsEnabled:
            EPGSelection.PartnerboxInit(self, False)

        # Hook up actions for yttrailer if installed
        try:
            from Plugins.Extensions.YTTrailer.plugin import baseEPGSelection__init__
        except ImportError as ie:
            pass
        else:
            if baseEPGSelection__init__ is not None:
                self["trailerActions"] = ActionMap(
                    ["InfobarActions", "InfobarTeletextActions"], {
                        "showTv": self.showTrailer,
                        "showRadio": self.showTrailerList,
                        "startTeletext": self.showConfig
                    })
Esempio n. 16
0
    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)
Esempio n. 17
0
 def __init__(self):
     eServiceEvent.__init__(self)
Esempio n. 18
0
    def __init__(self, session, *args, **kwargs):
        Screen.__init__(self, session)
        if not isinstance(self.skinName, list):
            self.skinName = [self.skinName]
        self.skinName.append("EPGSelection")
        if isinstance(self, HelpableScreen):
            HelpableScreen.__init__(self)

        self.searchargs = args
        self.currSearch = ""
        self.longbuttonpressed = False

        # XXX: we lose sort begin/end here
        self["key_yellow"] = Button(_("New Search"))
        self["key_blue"] = Button(_("Add AutoTimer"))

        # begin stripped copy of EPGSelection.__init__
        self.ChoiceBoxDialog = None
        self.bouquetChangeCB = None
        self.serviceChangeCB = None
        self.ask_time = -1  # now
        self.closeRecursive = False
        self.saved_title = None
        self.lastAsk = None
        self["Service"] = ServiceEvent()
        self["Event"] = Event()
        self["number"] = Label()
        self["number"].hide()
        self.type = EPG_TYPE_SINGLE
        self.currentService = None
        self.zapFunc = None
        self.currch = None
        self.sort_type = 0
        self.eventviewDialog = None
        self["key_red"] = Button(_("IMDb Search"))
        self["key_green"] = Button(_("Add Timer"))
        self.key_green_choice = self.ADD_TIMER
        self.key_red_choice = self.EMPTY
        self["list"] = EPGSearchList(type=self.type,
                                     selChangedCB=self.onSelectionChanged,
                                     timer=session.nav.RecordTimer)

        self["dialogactions"] = HelpableActionMap(self, "WizardActions", {
            "back": (self.closeChoiceBoxDialog, _("Close dialog")),
        }, -1)
        self["dialogactions"].csel = self
        self["dialogactions"].setEnabled(False)

        self["okactions"] = HelpableActionMap(
            self, "OkCancelActions", {
                "cancel": (self.closeScreen, _("Exit EPG Search")),
                "OK": (self.epgsearchOK, _("Zap to channel")),
                "OKLong":
                (self.epgsearchOKLong, _("Show detailed event information"))
            }, -1)
        self["okactions"].csel = self

        self["colouractions"] = HelpableActionMap(
            self, "ColorActions", {
                "red": (self.redButtonPressed,
                        _("IMDB search for highlighted event")),
                "green": (self.timerAdd,
                          _("Add/remove/edit timer for highlighted event")),
                "yellow": (self.yellowButtonPressed, _("Enter new search")),
                "yellowlong": (self.showHistory, _("Show search history")),
                "blue": (self.exportAutoTimer,
                         _("Add an AutoTimer for highlighted event")),
                "bluelong":
                (self.blueButtonPressedLong, _("Show AutoTimer list"))
            }, -1)
        self["colouractions"].csel = self

        self["recordingactions"] = HelpableActionMap(
            self, "InfobarInstantRecord", {
                "ShortRecord": (self.doRecordTimer,
                                _("Add a record timer for highlighted event")),
                "LongRecord":
                (self.doZapTimer, _("Add a zap timer for highlighted event"))
            }, -1)
        self["recordingactions"].csel = self

        self["epgactions"] = HelpableActionMap(
            self, "EPGSelectActions", {
                "nextBouquet": (self.nextPage, _("Move down a page")),
                "prevBouquet": (self.prevPage, _("Move up a page")),
                "nextService": (self.prevPage, _("Move up a page")),
                "prevService": (self.nextPage, _("Move down a page")),
                "epg": (self.Info, _("Show detailed event information")),
                "info": (self.Info, _("Show detailed event information")),
                "infolong":
                (self.infoKeyPressed, _("Show detailed event information")),
                "menu": (self.menu, _("Setup menu"))
            }, -1)
        self["epgactions"].csel = self

        self["epgcursoractions"] = HelpableActionMap(
            self, "DirectionActions", {
                "left": (self.prevPage, _("Move up a page")),
                "right": (self.nextPage, _("Move down a page")),
                "up": (self.moveUp, _("Move up")),
                "down": (self.moveDown, _("Move down"))
            }, -1)
        self["epgcursoractions"].csel = self

        self.openHistory = kwargs.get("openHistory", False)

        self.onLayoutFinish.append(self.onCreate)
        # end stripped copy of EPGSelection.__init__

        # Partnerbox
        if PartnerBoxIconsEnabled:
            EPGSelection.PartnerboxInit(self, False)

        self.refreshTimer = eTimer()
        self.refreshTimer.callback.append(self.refreshlist)

        self.startTimer = eTimer()
        self.startTimer.callback.append(self.startUp)
        self.startTimer.start(10, 1)

        self.searchStartTimer = eTimer()

        # Hook up actions for yttrailer if installed
        try:
            from Plugins.Extensions.YTTrailer.plugin import baseEPGSelection__init__
        except ImportError as ie:
            pass
        else:
            if baseEPGSelection__init__ is not None:
                self["trailerActions"] = ActionMap(
                    ["InfobarActions", "InfobarTeletextActions"], {
                        "showTv": self.showTrailer,
                        "showRadio": self.showTrailerList,
                        "startTeletext": self.showConfig
                    })
Esempio n. 19
0
 def __init__(self):
     self["DescriptionBorder"] = Pixmap()
     self["Service"] = ServiceEvent()
     self["FileSize"] = Label("")
     self.prev_descdis = not config.suomipoeka.movie_descdis.value
Esempio n. 20
0
    def __init__(self,
                 session,
                 service,
                 zapFunc=None,
                 eventid=None,
                 bouquetChangeCB=None,
                 serviceChangeCB=None,
                 isEPGBar=None,
                 switchBouquet=None,
                 EPGNumberZap=None,
                 togglePiP=None):
        Screen.__init__(self, session)
        self.screentitle = _("EPG Selection")
        self.bouquetChangeCB = bouquetChangeCB
        self.serviceChangeCB = serviceChangeCB
        self.switchBouquet = switchBouquet
        self.EPGNumberZap = EPGNumberZap
        self.togglePiP = None
        self.ask_time = -1  #now
        self["key_red"] = Button("")
        self.closeRecursive = False
        self.saved_title = None
        self["Service"] = ServiceEvent()
        self["Event"] = Event()
        if isinstance(service, str) and eventid != None:
            self.type = EPG_TYPE_SIMILAR
            self["key_yellow"] = Button()
            self["key_blue"] = Button()
            self["key_red"] = Button()
            self.currentService = service
            self.eventid = eventid
            self.zapFunc = None
        elif isEPGBar and (isinstance(service, eServiceReference)
                           or isinstance(service, str)):
            self.skinName = ["EPGSelectionEPGBar_SD"]
            if session.desktop.size().width() > 720:
                self.skinName = ["EPGSelectionEPGBar_HD"]
            self.type = EPG_TYPE_EPGBAR
            self["key_yellow"] = Button()
            self["key_blue"] = Button()
            self.currentService = ServiceReference(service)
            self.zapFunc = zapFunc
            self.togglePiP = togglePiP
            self.sort_type = 0
            self.setSortDescription()

            self["EPGBarActions"] = ActionMap(
                ["DirectionActions", "OkCancelActions", "InfobarSeekActions"],
                {
                    "cancel": self.closeScreen,
                    "ok": self.zapTo,
                    "left": self.prevService,
                    "right": self.nextService,
                    "playpauseService": self.setPiPService,
                }, -1)

            self["EPGBarActions"].csel = self

        elif isinstance(service, eServiceReference) or isinstance(
                service, str):
            self.type = EPG_TYPE_SINGLE
            self["key_yellow"] = Button()
            self["key_blue"] = Button()
            self.currentService = ServiceReference(service)
            self.zapFunc = zapFunc
            self.sort_type = 0
            self.setSortDescription()
        else:
            self.skinName = "EPGSelectionMulti"
            self.type = EPG_TYPE_MULTI
            self["key_yellow"] = Button(_("Prev"))
            self["key_blue"] = Button(_("Next"))
            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.zapFunc = zapFunc

        self["key_green"] = Button(_("Add timer"))
        self.key_green_choice = self.ADD_TIMER
        self.key_red_choice = self.EMPTY
        self["list"] = EPGList(type=self.type,
                               selChangedCB=self.onSelectionChanged,
                               timer=session.nav.RecordTimer)

        self["actions"] = ActionMap(
            ["EPGSelectActions", "OkCancelActions"],
            {
                "cancel": self.closeScreen,
                "ok": self.eventSelected,
                "timerAdd": self.timerAdd,
                "timerEnableDisable": self.timerEnableDisable,
                "instantToggleTimerState": self.instantToggleTimerState,
                "instantTimer": self.addInstantTimer,
                "yellow": self.yellowButtonPressed,
                "blue": self.blueButtonPressed,
                "info": self.infoKeyPressed,
                "red": self.zapTo,
                "input_date_time": self.enterDateTime,
                "nextBouquet": self.nextBouquet,  # just used in multi epg yet
                "prevBouquet": self.prevBouquet,  # just used in multi epg yet
                "nextService": self.nextService,  # just used in single epg yet
                "prevService": self.prevService,  # just used in single epg yet
            })
        self["actions"].csel = self

        if EPGNumberZap:
            self["EPGBarNumberActions"] = 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,
                })

        self.onLayoutFinish.append(self.onCreate)
Esempio n. 21
0
 def __init__(self,
              session,
              service,
              zapFunc=None,
              eventid=None,
              bouquetChangeCB=None,
              serviceChangeCB=None,
              parent=None):
     Screen.__init__(self, session)
     self.bouquetChangeCB = bouquetChangeCB
     self.serviceChangeCB = serviceChangeCB
     self.ask_time = -1
     self['key_red'] = Button('')
     self.closeRecursive = False
     self.saved_title = None
     self['Service'] = ServiceEvent()
     self['Event'] = Event()
     self.session = session
     if isinstance(service, str) and eventid != None:
         self.type = EPG_TYPE_SIMILAR
         self.setTitle(_('Similar EPG'))
         self['key_yellow'] = Button()
         self['key_blue'] = Button()
         self['key_red'] = Button()
         self.currentService = service
         self.eventid = eventid
         self.zapFunc = None
     elif isinstance(service, eServiceReference) or isinstance(
             service, str):
         self.setTitle(_('Single EPG'))
         self.type = EPG_TYPE_SINGLE
         self['key_yellow'] = Button()
         self['key_blue'] = Button(_('Select Channel'))
         self.currentService = ServiceReference(service)
         self.zapFunc = zapFunc
         self.sort_type = 0
         self.setSortDescription()
     else:
         self.setTitle(_('Multi EPG'))
         self.skinName = 'EPGSelectionMulti'
         self.type = EPG_TYPE_MULTI
         self['key_yellow'] = Button(
             pgettext("button label, 'previous screen'", 'Prev'))
         self['key_blue'] = Button(
             pgettext("button label, 'next screen'", 'Next'))
         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.zapFunc = zapFunc
     self.parent = parent
     self['key_green'] = Button(_('Add timer'))
     self.key_green_choice = self.ADD_TIMER
     self.key_red_choice = self.EMPTY
     self['list'] = EPGList(type=self.type,
                            selChangedCB=self.onSelectionChanged,
                            timer=session.nav.RecordTimer)
     self['actions'] = ActionMap(
         ['EPGSelectActions', 'OkCancelActions'], {
             'cancel': self.closeScreen,
             'ok': self.eventSelected,
             'timerAdd': self.timerAdd,
             'yellow': self.yellowButtonPressed,
             'blue': self.blueButtonPressed,
             'info': self.infoKeyPressed,
             'red': self.zapTo,
             'menu': self.furtherOptions,
             'nextBouquet': self.nextBouquet,
             'prevBouquet': self.prevBouquet,
             'nextService': self.nextService,
             'prevService': self.prevService,
             'preview': self.eventPreview
         })
     self['actions'].csel = self
     self.onLayoutFinish.append(self.onCreate)
	def __init__(self, servicecenter):
		ServiceEvent.__init__(self)
		self.servicecenter = servicecenter
Esempio n. 23
0
    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"))

        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)
Esempio n. 24
0
 def __init__(self):
     self["ServiceEvent"] = ServiceEvent()
     self["ShortDesc"] = Label("")
     self.timer = eTimer()
     self.timer.callback.append(self.updateEventInfo)
     self.onShow.append(self.__selectionChanged)
Esempio n. 25
0
 def __init__(self,
              event,
              serviceRef,
              callback=None,
              similarEPGCB=None,
              parent=None,
              windowTitle=None):
     self.event = event
     self.serviceRef = serviceRef
     self.callbackMethod = callback
     if similarEPGCB is None:
         self.similarBroadcastTimer = None
     else:
         self.similarBroadcastTimer = eTimer()
         self.similarBroadcastTimer.callback.append(self.getSimilarEvents)
     self.similarEPGCB = similarEPGCB
     if parent and hasattr(parent, "fallbackTimer"):
         self.fallbackTimer = parent.fallbackTimer
         self.onLayoutFinish.append(self.layoutFinished)
     else:
         self.fallbackTimer = FallbackTimerList(self, self.layoutFinished)
     self.windowTitle = windowTitle
     self.isRecording = (
         not serviceRef.ref.flags
         & eServiceReference.isGroup) and serviceRef.ref.getPath()
     self["channel"] = Label()
     self["datetime"] = Label()
     self["duration"] = Label()
     self["Service"] = ServiceEvent()
     self["Event"] = Event()
     self["epg_eventname"] = ScrollLabel()
     self["epg_description"] = ScrollLabel()
     self["FullDescription"] = ScrollLabel()
     self["key_red"] = StaticText("")
     self["key_green"] = StaticText(
         "" if self.isRecording else _("Add Timer"))
     self.keyGreenAction = self.ADD_TIMER
     self["key_menu"] = StaticText(_("MENU"))
     self["key_info"] = StaticText(_("INFO"))
     self["actions"] = HelpableActionMap(
         self, ["OkCancelActions", "EventViewActions"], {
             "cancel": (self.close, _("Close Event View screen")),
             "ok": (self.close, _("Close Event View screen")),
             "contextMenu": (self.doContext, _("Open context menu")),
             "timerAdd":
             (self.addTimer, _("Add a timer for the current event")),
             "pageUp":
             (self.pageUp, _("Show previous page of description")),
             "pageDown": (self.pageDown, _("Show next page of description"))
         },
         prio=0,
         description=_("Event View Actions"))
     self["eventActions"] = HelpableActionMap(
         self, ["EventViewActions"], {
             "prevEvent": (self.prevEvent, _("Show previous event")),
             "nextEvent": (self.nextEvent, _("Show next event"))
         },
         prio=0,
         description=_("Event View Actions"))
     self["eventActions"].setEnabled(callback is not None)
     self["similarActions"] = HelpableActionMap(
         self, ["EventViewActions"], {
             "openSimilarList":
             (self.openSimilarList, _("Find similar events in the EPG"))
         },
         prio=0,
         description=_("Event View Actions"))
     self["similarActions"].setEnabled(False)