def action(self, contexts, action): if (action in tuple(x[1] for x in getHotkeys()) and self.actions.has_key(action)): res = self.actions[action](action) if res is not None: return res return 1 else: return ActionMap.action(self, contexts, action)
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)
def __init__(self, session, services, zapFunc=None, bouquetChangeCB=None): Screen.__init__(self, session) self.bouquetChangeCB = bouquetChangeCB now = time() tmp = now % 900 self.ask_time = now - tmp self.closeRecursive = False self["key_red"] = Button("") self["key_green"] = Button("") self["key_yellow"] = Button(_("Prime time")) self["key_blue"] = Button(_("Date")) self.key_green_choice = self.EMPTY self.key_red_choice = self.EMPTY self["timeline_text"] = TimelineText() self["Event"] = Event() self.time_lines = [ ] for x in (0,1,2,3,4,5): pm = Pixmap() self.time_lines.append(pm) self["timeline%d"%(x)] = pm self["timeline_now"] = Pixmap() self.services = services self.zapFunc = zapFunc self.prime_mode = self.TIME_NOW self["list"] = EPGList(selChangedCB = self.onSelectionChanged, timer = self.session.nav.RecordTimer, time_epoch = config.misc.graph_mepg_prev_time_period.value ) self["actions"] = ActionMap(["EPGSelectActions", "OkCancelActions"], { "cancel": self.closeScreen, "ok": self.eventSelected, "timerAdd": self.timerAdd, "info": self.infoKeyPressed, "red": self.zapTo, "yellow": self.primeTime, "blue" : self.enterDateTime, "input_date_time": self.configMenu, "nextBouquet": self.nextBouquet, "prevBouquet": self.prevBouquet, }) self["actions"].csel = self self["input_actions"] = ActionMap(["InputActions"], { "left": self.leftPressed, "right": self.rightPressed, "1": self.key1, "2": self.key2, "3": self.key3, "4": self.key4, "5": self.key5, },-1) self.updateTimelineTimer = eTimer() self.updateTimelineTimer_conn = self.updateTimelineTimer.timeout.connect(self.moveTimeLines) self.updateTimelineTimer.start(60*1000) self.onLayoutFinish.append(self.onCreate)
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.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 }, ) self["actions"].csel = self self.onLayoutFinish.append(self.onCreate) # end stripped copy of EPGSelection.__init__ # Partnerbox if PartnerBoxIconsEnabled: EPGSelection.PartnerboxInit(self, False)
def action(self, contexts, action): if action in tuple(x[1] for x in used_keys.getHotkeys()) and action in self.actions: res = self.actions[action](action) if res is not None: return res return 1 else: return ActionMap.action(self, contexts, action)
def action(self, contexts, action): if action == "cancel": self.csel.handleEditCancel() return 0 # fall-trough elif action == "ok": return 0 # fall-trough else: return ActionMap.action(self, contexts, action)
def action(self, contexts, action): if action in tuple(x[1] for x in ButtonSetupKeys) and action in self.actions: res = self.actions[action](action) if res is not None: return res return 1 else: return ActionMap.action(self, contexts, action)
def action(self, contexts, action): quickSelection = ('red','green','yellow','blue','vformat','picasa','shoutcast','youtube','find','f1','f2','f3','f4','sleep','spark','sat','fav','info','epg','file','playmode','usb','tvradio','tvsat','recall') if (action in quickSelection and self.actions.has_key(action)): res = self.actions[action](action) if res is not None: return res return 1 else: return ActionMap.action(self, contexts, action)
def action(self, contexts, action): quickSelection = ("tv","mute","f1","f1_long","f2","f2_long","f3","f3_long","f4","f4_long","flist","glist","fav","aspect","previous","rewind","fforward","next","timeshift","stop","playpause","record","volup","voldown","guide","guide_long","exit","chnup","chndown","info","info_long","audio","audio_long","info","up","left","down","right","menu","menu_long","video","video_long","history","history_long","opt","opt_long","text","text_long","red","red_long","green","green_long","yellow","yellow_long","blue","blue_long") if (action in quickSelection and self.actions.has_key(action)): res = self.actions[action](action) if res is not None: return res return 1 else: return ActionMap.action(self, contexts, action)
def action(self, contexts, action): for x in ButtonSetupKeys: if action in tuple(x[1]): print 'ACTION EXTSTS:' if (action in tuple(x[1] for x in ButtonSetupKeys) and self.actions.has_key(action)): res = self.actions[action](action) if res is not None: return res return 1 else: return ActionMap.action(self, contexts, action)
def action(self, contexts, action): quickSelection = ("guide_long","guide","filelist_long","filelist","red","red_long","green","green_long","yellow","yellow_long","blue","blue_long","pvr","pvr_long","radio","radio_long","text","text_long", \ "subtitle","subtitle_long","info","info_long","list","list_long","playlist","playlist_long","epg","epg_long","cross_up","cross_down","cross_left","cross_right","previous","next","end","end_long","home","home_long", \ "channelup","channeldown","audio","audio_long","ok","exit","play","pause","fastforward","stop","rewind","tv","tv_long","activatePiP","pip_long","timer","timer_long","back","back_long","timeshift","timeshift_long","portal","portal_long","search","search_long","displayHelp","help_long","mainMenu","menu_long","slow","slow_long" "f1","f1_long","f2","f2_long","f3","f3_long","f4","f4_long","favorites","favorites_long","sleep","sleep_long","media","media_long") if (action in quickSelection and self.actions.has_key(action)): res = self.actions[action](action) if res is not None: return res return 1 else: return ActionMap.action(self, contexts, action)
def action(self, contexts, action): quickSelection = ("red", "red_long", "green", "green_long", "yellow", "yellow_long", "blue", "blue_long", "pvr", "pvr_long", "radio", "radio_long", \ "text", "text_long", "help_long", "info", "info_long", "end", "end_long", "home", "home_long", "cross_up", "cross_down", "cross_left", \ "cross_right", "previous", "next", "channelup", "channeldown", "f1", "f2", "f3", "audio", "exit", "ok", "play", "pause", "rewind", \ "fastforward", "stop", "tv", "subtitle", "mqb_volup", "mqb_voldown", "mqb_mute", "mqb_power", "mqb_power_long") if (action in quickSelection and self.actions.has_key(action)): res = self.actions[action](action) if res is not None: return res return 1 else: return ActionMap.action(self, contexts, action)
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)
def action(self, contexts, action): if action[:5] == "seek:": time = int(action[5:]) self.player.seekRelative(time) return 1 elif action[:8] == "seekdef:": key = int(action[8:]) time = [-config.seek.selfdefined_13.value, False, config.seek.selfdefined_13.value, -config.seek.selfdefined_46.value, False, config.seek.selfdefined_46.value, -config.seek.selfdefined_79.value, False, config.seek.selfdefined_79.value][key-1] self.player.seekRelative(time) return 1 else: return ActionMap.action(self, contexts, action)
def action(self, contexts, action): quickSelection = ("red","red_long","green","green_long","yellow","yellow_long","blue","blue_long","pvr","pvr_long","radio","radio_long", \ "text","text_long","epg","epg_long","help","help_long","info","info_long","end","end_long","home","home_long","cross_up","cross_down","cross_left", \ "cross_right","previous","next","channelup","channeldown","f1","f2","f3","audio","exit","ok","play","pause","rewind","fastforward","stop","tv", \ "console","f4","web","mail","m1","m2","fav", "fav_long", "screen", "screen_long", "history", "history_long", \ "subtitle","subtitle_long","filelist","filelist_long","playlist","playlist_long","timer","timer_long", \ "timeshift","timeshift_long","mark","mark_long","search","search_long","slow","slow_long") if (action in quickSelection and self.actions.has_key(action)): res = self.actions[action](action) if res is not None: return res return 1 else: return ActionMap.action(self, contexts, action)
def __init__(self, session, *args): Screen.__init__(self, session) ProtectedScreen.__init__(self) Screen.setTitle(self, _('Software Update')) self['actions'] = ActionMap(['WizardActions'], {'ok': self.exit, 'back': self.exit}, -1) self['actions'].csel = self self['actions'].setEnabled(False) self.sliderPackages = {'ini-dvb-modules': 1, 'enigma2': 2, 'tuxbox-image-info': 3} self.slider = Slider(0, 4) self['slider'] = self.slider self.activityslider = Slider(0, 100) self['activityslider'] = self.activityslider self.status = StaticText(_('Please wait...')) self['status'] = self.status self.package = StaticText(_('Package list update')) self['package'] = self.package self.oktext = _('Press OK on your remote control to continue.') self['tl_off'] = Pixmap() self['tl_red'] = Pixmap() self['tl_yellow'] = Pixmap() self['tl_green'] = Pixmap() self['feedStatusMSG'] = Label() self.channellist_only = 0 self.channellist_name = '' self.SettingsBackupDone = False self.ImageBackupDone = False self.autobackuprunning = False self.updating = False self.packages = 0 self.error = 0 self.processed_packages = [] self.total_packages = None self.onFirstExecBegin.append(self.checkNetworkState) return
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() 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.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 "preview": self.eventPreview, }, ) self["actions"].csel = self self.onLayoutFinish.append(self.onCreate)
def __init__(self, session): Screen.__init__(self, session) self.session = session self.list = [] self.__keys = [] MPaskList = [] self["key_pvr"] = StaticText(" ") self["key_yellow"] = StaticText(" ") self["key_green"] = StaticText(" ") self["key_red"] = StaticText(" ") self["key_blue"] = StaticText(" ") if True: self.__keys.append("movies") MPaskList.append((_("Movies"), "PLAYMOVIES")) if config.plugins.easyMedia.bookmarks.value != "no": self.__keys.append("bookmarks") MPaskList.append((_("Bookmarks"), "BOOKMARKS")) if config.plugins.easyMedia.timers.value != "no": self.__keys.append("timers") MPaskList.append((_("Timer"), "TIMERS")) if config.plugins.easyMedia.videodb.value != "no": self.__keys.append("videodb") MPaskList.append((_("VideoDB"), "VIDEODB")) if config.plugins.easyMedia.pictures.value != "no": self.__keys.append("pictures") MPaskList.append((_("Pictures"), "PICTURES")) if config.plugins.easyMedia.music.value != "no": self.__keys.append("music") MPaskList.append((_("Music"), "MUSIC")) if config.plugins.easyMedia.radio.value != "no": self.__keys.append("radio") if config.usage.e1like_radio_mode.value: MPaskList.append((_("Tv/Radio"), "RADIO")) else: MPaskList.append((_("Radio"), "RADIO")) if config.plugins.easyMedia.dvd.value != "no": self.__keys.append("dvd") MPaskList.append((_("DVD Player"), "DVD")) if config.plugins.easyMedia.weather.value != "no": self.__keys.append("weather") MPaskList.append((_("Weather"), "WEATHER")) if config.plugins.easyMedia.files.value != "no": self.__keys.append("files") MPaskList.append((_("Files"), "FILES")) if config.plugins.easyMedia.iradio.value != "no": self.__keys.append("internetradio") MPaskList.append((_("InternetRadio"), "INTERNETRADIO")) if config.plugins.easyMedia.idream.value != "no": self.__keys.append("idream") MPaskList.append((_("iDream"), "IDREAM")) if config.plugins.easyMedia.mytube.value != "no": self.__keys.append("mytube") MPaskList.append((_("MyTube Player"), "MYTUBE")) if config.plugins.easyMedia.vlc.value != "no": self.__keys.append("vlc") MPaskList.append((_("VLC Player"), "VLC")) if config.plugins.easyMedia.zdfmedia.value != "no": self.__keys.append("zdf") MPaskList.append((_("ZDFmediathek"), "ZDF")) if config.plugins.easyMedia.myvideo.value != "no": self.__keys.append("myvideo") MPaskList.append((_("MyVideo"), "MYVIDEO")) plist = os_listdir("/usr/lib/enigma2/python/Plugins/Extensions/EasyMedia") plist = [x[:-5] for x in plist if x.endswith('.plug')] plist.sort() for onePlug in plist: try: inpf = open(("/usr/lib/enigma2/python/Plugins/Extensions/EasyMedia/" + onePlug + ".plug"), 'rb') binPlug = pickle.load(inpf) inpf.close() self.__keys.append(binPlug.name) MPaskList.append((binPlug.name, ("++++" + binPlug.name))) except: pass pos = 0 for x in MPaskList: strpos = str(self.__keys[pos]) self.list.append(MPanelEntryComponent(key = strpos, text = x, cell = pos)) if pos==0: self["key_pvr"].setText(MPaskList[0][0]) elif pos==1: self["key_red"].setText(MPaskList[1][0]) elif pos==2: self["key_green"].setText(MPaskList[2][0]) elif pos==3: self["key_yellow"].setText(MPaskList[3][0]) elif pos==4: self["key_blue"].setText(MPaskList[4][0]) pos += 1 self["list"] = MPanelList(list = self.list, selection = 0) self["list"].onSelectionChanged.append(self.updateOLED) self["actions"] = ActionMap(["WizardActions", "MenuActions", "InfobarActions", "ColorActions"], { "ok": self.go, "back": self.cancel, "menu": self.emContextMenu, "showMovies": lambda: self.go2(MPaskList,0), "green": lambda: self.go2(MPaskList,2), "red": lambda: self.go2(MPaskList,1), "blue": lambda: self.go2(MPaskList,4), "yellow": lambda: self.go2(MPaskList,3) }, -1)
def __init__(self, session, *args): Screen.__init__(self, session) Screen.setTitle(self, _("Software Panel")) skin = """ <screen name="SoftwarePanel" position="center,center" size="700,600" title="Software Panel"> <widget name="a_off" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/OPDpanel/icons/aoff.png" position="10,10" zPosition="1" size="36,97" alphatest="on" /> <widget name="a_red" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/OPDpanel/icons/ared.png" position="10,10" zPosition="1" size="36,97" alphatest="on" /> <widget name="a_yellow" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/OPDpanel/icons/ayellow.png" position="10,10" zPosition="1" size="36,97" alphatest="on" /> <widget name="a_green" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/OPDpanel/icons/agreen.png" position="10,10" zPosition="1" size="36,97" alphatest="on" /> <widget name="feedstatusRED" position="60,14" size="200,30" zPosition="1" font="Regular;25" halign="left" transparent="1" /> <widget name="feedstatusYELLOW" position="60,46" size="200,30" zPosition="1" font="Regular;25" halign="left" transparent="1" /> <widget name="feedstatusGREEN" position="60,78" size="200,30" zPosition="1" font="Regular;25" halign="left" transparent="1" /> <widget name="packagetext" position="180,50" size="350,30" zPosition="1" font="Regular;25" halign="right" transparent="1" /> <widget name="packagenr" position="511,50" size="50,30" zPosition="1" font="Regular;25" halign="right" transparent="1" /> <widget source="list" render="Listbox" position="10,120" size="630,365" scrollbarMode="showOnDemand"> <convert type="TemplatedMultiContent"> {"template": [ MultiContentEntryText(pos = (5, 1), size = (540, 28), font=0, flags = RT_HALIGN_LEFT, text = 0), # index 0 is the name MultiContentEntryText(pos = (5, 26), size = (540, 20), font=1, flags = RT_HALIGN_LEFT, text = 2), # index 2 is the description MultiContentEntryPixmapAlphaTest(pos = (545, 2), size = (48, 48), png = 4), # index 4 is the status pixmap MultiContentEntryPixmapAlphaTest(pos = (5, 50), size = (610, 2), png = 5), # index 4 is the div pixmap ], "fonts": [gFont("Regular", 22),gFont("Regular", 14)], "itemHeight": 52 } </convert> </widget> <ePixmap pixmap="skin_default/buttons/red.png" position=" 30,570" size="35,27" alphatest="blend" /> <widget name="key_green_pic" pixmap="skin_default/buttons/green.png" position="290,570" size="35,27" alphatest="blend" /> <widget name="key_red" position=" 80,573" size="200,26" zPosition="1" font="Regular;22" halign="left" transparent="1" /> <widget name="key_green" position="340,573" size="200,26" zPosition="1" font="Regular;22" halign="left" transparent="1" /> </screen> """ self.skin = skin self.list = [] self.statuslist = [] self["list"] = List(self.list) self['a_off'] = Pixmap() self['a_red'] = Pixmap() self['a_yellow'] = Pixmap() self['a_green'] = Pixmap() self['key_green_pic'] = Pixmap() self['key_red_pic'] = Pixmap() self['key_red'] = Label(_("Cancel")) self['key_green'] = Label(_("Update")) self['packagetext'] = Label(_("Updates Available:")) self['packagenr'] = Label("0") self['feedstatusRED'] = Label("< " + _("feed status")) self['feedstatusYELLOW'] = Label("< " + _("feed status")) self['feedstatusGREEN'] = Label("< " + _("feed status")) self['key_green'].hide() self['key_green_pic'].hide() self.update = False self.packages = 0 self.ipkg = IpkgComponent() self.ipkg.addCallback(self.ipkgCallback) self["actions"] = ActionMap([ "OkCancelActions", "DirectionActions", "ColorActions", "SetupActions" ], { "cancel": self.Exit, "green": self.Green, "red": self.Exit, }, -2) self.onLayoutFinish.append(self.layoutFinished)
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 })
def __init__(self, session, streamplayer, args=0): self.skin = LastFMScreenMain.skin Screen.__init__(self, session) HelpableScreen.__init__(self) LastFM.__init__(self) self.session = session self.streamplayer = streamplayer #StreamPlayer(session) self.streamplayer.onStateChanged.append( self.onStreamplayerStateChanged) self.imageconverter = ImageConverter(116, 116, self.setCoverArt) Screen.__init__(self, session) self.tabs = [(_("Personal Stations"), self.loadPersonalStations), (_("Global Tags"), self.loadGlobalTags), (_("Top Tracks"), self.loadTopTracks), (_("Recent Tracks"), self.loadRecentTracks), (_("Loved Tracks"), self.loadLovedTracks), (_("Banned Tracks"), self.loadBannedTracks), (_("Friends"), self.loadFriends), (_("Neighbours"), self.loadNeighbours)] tablist = [] for tab in self.tabs: tablist.append((tab[0], tab)) self.tablist = MenuList(tablist) self.tablist.onSelectionChanged.append(self.action_TabChanged) self["artist"] = Label(_("Artist") + ":") self["duration"] = Label("-00:00") self["album"] = Label(_("Album") + ":") self["track"] = Label(_("Track") + ":") self["info_artist"] = Label("N/A") self["info_album"] = Label("N/A") self["info_track"] = Label("N/A") self["info_cover"] = Pixmap() self["tablist"] = self.tablist self["streamlist"] = MenuList([]) self["button_red"] = Label(_("Play")) self["button_green"] = Label(_("Skip")) self["button_yellow"] = Label(_("Love")) self["button_blue"] = Label(_("Ban")) self["infolabel"] = Label("") self["actions"] = ActionMap( [ "InfobarChannelSelection", "WizardActions", "DirectionActions", "MenuActions", "ShortcutActions", "GlobalActions", "HelpActions", "NumberActions" ], { "ok": self.action_ok, "back": self.action_exit, "red": self.action_startstop, "green": self.skipTrack, "yellow": self.love, "blue": self.banTrack, "historyNext": self.action_nextTab, "historyBack": self.action_prevTab, "menu": self.action_menu, }, -1) self.helpList.append((self["actions"], "WizardActions", [("ok", _("Switch to selected Station"))])) self.helpList.append((self["actions"], "InfobarChannelSelection", [("historyNext", _("Select next Tab"))])) self.helpList.append((self["actions"], "InfobarChannelSelection", [("historyBack", _("Select prev Tab"))])) self.helpList.append((self["actions"], "InfobarChannelSelection", [("switchChannelDown", _("Next Selection"))])) self.helpList.append((self["actions"], "InfobarChannelSelection", [("switchChannelUp", _("Previous Selection"))])) self.helpList.append((self["actions"], "InfobarChannelSelection", [("zapDown", _("Page forward Selections"))])) self.helpList.append((self["actions"], "InfobarChannelSelection", [("zapUp", _("Page backward Selections"))])) self.helpList.append((self["actions"], "ShortcutActions", [("red", _("Start/stop streaming"))])) self.helpList.append( (self["actions"], "ShortcutActions", [("green", _("Skip current Track"))])) self.helpList.append( (self["actions"], "ShortcutActions", [("yellow", _("Mark Track as loved"))])) self.helpList.append((self["actions"], "ShortcutActions", [("blue", _("Ban Track, never play"))])) self.helpList.append((self["actions"], "MenuActions", [("menu", _("Open") + " " + _("Setup"))])) self.helpList.append((self["actions"], "WizardActions", [ ("back", _("Quit") + " " + config.plugins.LastFM.name.value) ])) self.onLayoutFinish.append(self.initLastFM) self.onLayoutFinish.append(self.tabchangedtimerFired) self.onLayoutFinish.append(self.setCoverArt) self.guiupdatetimer = eTimer() self.guiupdatetimer.timeout.get().append(self.guiupdatetimerFired) self.guiupdatetimer.start( config.plugins.LastFM.metadatarefreshinterval.value * 1000) self.tabchangetimer = eTimer() self.tabchangetimer.timeout.get().append(self.tabchangedtimerFired) self.infolabelcleartimer = eTimer() self.infolabelcleartimer.timeout.get().append(self.clearInfoLabel) self.screensavertimer = eTimer() self.screensavertimer.timeout.get().append(self.startScreensaver) self.onShown.append(self.startScreensaverTimer)
def __init__(self, session, filelist, index, path): self.textcolor = config.pic.textcolor.value self.bgcolor = config.pic.bgcolor.value space = config.pic.framesize.value self.size_w = getDesktop(0).size().width() self.size_h = getDesktop(0).size().height() (size_w, size_h) = (self.size_w, self.size_h) print ('A:',self.size_w) print ('B:',self.size_h) if config.pic.fullview_resolution.value and (self.size_w, self.size_h) != eval(config.pic.fullview_resolution.value): (size_w, size_h) = eval(config.pic.fullview_resolution.value) print ('C:',size_w) print ('D:',size_h) gMainDC.getInstance().setResolution(size_w, size_h) getDesktop(0).resize(eSize(size_w, size_h)) self.skin = "<screen position=\"0,0\" size=\"" + str(size_w) + "," + str(size_h) + "\" flags=\"wfNoBorder\" > \ <eLabel position=\"0,0\" zPosition=\"0\" size=\""+ str(size_w) + "," + str(size_h) + "\" backgroundColor=\""+ self.bgcolor +"\" /><widget name=\"pic\" position=\"" + str(space) + "," + str(space) + "\" size=\"" + str(size_w-(space*2)) + "," + str(size_h-(space*2)) + "\" zPosition=\"1\" alphatest=\"on\" /> \ <widget name=\"point\" position=\""+ str(space+5) + "," + str(space+2) + "\" size=\"20,20\" zPosition=\"2\" pixmap=\"skin_default/icons/record.png\" alphatest=\"on\" /> \ <widget name=\"play_icon\" position=\""+ str(space+25) + "," + str(space+2) + "\" size=\"20,20\" zPosition=\"2\" pixmap=\"skin_default/icons/ico_mp_play.png\" alphatest=\"on\" /> \ <widget source=\"file\" render=\"Label\" position=\""+ str(space+45) + "," + str(space) + "\" size=\""+ str(size_w-(space*2)-50) + ",25\" font=\"Regular;20\" borderWidth=\"1\" borderColor=\"#000000\" halign=\"left\" foregroundColor=\"" + self.textcolor + "\" zPosition=\"2\" noWrap=\"1\" transparent=\"1\" /></screen>" Screen.__init__(self, session) self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "DirectionActions", "MovieSelectionActions"], { "cancel": self.Exit, "green": self.PlayPause, "yellow": self.PlayPause, "blue": self.nextPic, "red": self.prevPic, "left": self.prevPic, "right": self.nextPic, "showEventInfo": self.StartExif, }, -1) self["point"] = Pixmap() self["pic"] = Pixmap() self["play_icon"] = Pixmap() self["file"] = StaticText(_("please wait, loading picture...")) self.old_index = 0 self.filelist = [] self.lastindex = index self.currPic = [] self.shownow = True self.dirlistcount = 0 for x in filelist: if len(filelist[0]) == 3: #orig. filelist if not x[0][1]: self.filelist.append(path + x[0][0]) else: self.dirlistcount += 1 elif len(filelist[0]) == 2: #scanlist if not x[0][1]: self.filelist.append(x[0][0]) else: self.dirlistcount += 1 else: # thumbnaillist self.filelist.append(x[T_FULL]) self.maxentry = len(self.filelist)-1 self.index = index - self.dirlistcount if self.index < 0: self.index = 0 self.picload = ePicLoad() self.picload.PictureData.get().append(self.finish_decode) self.slideTimer = eTimer() self.slideTimer.callback.append(self.slidePic) if self.maxentry >= 0: # self.onLayoutFinish.append(self.setPicloadConf) if config.pic.fullview_resolution.value and (self.size_w, self.size_h) != eval(config.pic.fullview_resolution.value): self.createTimer = eTimer() self.createTimer.callback.append(self.setPicloadConf) self.onLayoutFinish.append(self.LayoutFinish) else: self.onLayoutFinish.append(self.setPicloadConf)
def __init__(self, session, args=None, picPath=None): self.config_lines = [] Screen.__init__(self, session) self.session = session self.oscamconfigpath = "/usr/keys/" self.oscamuser = (self.oscamconfigpath + "oscam.user") self.oscamuserTMP = (self.oscamuser + ".tmp") self.oscamconf = (self.oscamconfigpath + "oscam.conf") self.oscamconfTMP = (self.oscamconf + ".tmp") self.oscamserver = (self.oscamconfigpath + "oscam.server") self.oscamserverTMP = (self.oscamserver + ".tmp") self.oscamdvbapi = (self.oscamconfigpath + "oscam.dvbapi") self.oscamdvbapiTMP = (self.oscamdvbapi + ".tmp") self.oscamsmartcarddata = "/usr/lib/enigma2/python/Plugins/Extensions/Infopanel/data/" self.picPath = picPath self.Scale = AVSwitch().getFramebufferScale() self.PicLoad = ePicLoad() self["oscamsmartcardhelperimage"] = Pixmap() self["HELPTEXT"] = Label() list = [] list.append( getConfigListEntry( _("Select OScam WebifPort:"), config.plugins.OscamSmartcard.WebifPort, _("INFORMATION: Select OScam WebifPort\n\nOscam Webif will be accessible on the selected port.\ne.g. http:\\IPOFYOURBOX:83" ))) list.append( getConfigListEntry( _("Internal Reader /dev/sci0:"), config.plugins.OscamSmartcard.internalReader0, _("INFORMATION: Internal Reader /dev/sci0\n\nAll STB's having only one cardslot.\nOn STB's having two cardslots it is mostly the lower cardslot." ))) list.append( getConfigListEntry( _("Internal Reader /dev/sci1:"), config.plugins.OscamSmartcard.internalReader1, _("INFORMATION: Internal Reader /dev/sci1\n\nOn STB's having two cardslots it is mostly the upper cardslot." ))) list.append( getConfigListEntry( _("External Reader /dev/ttyUSB0:"), config.plugins.OscamSmartcard.externalReader0, _("INFORMATION: External Reader /dev/ttyUSB0\n\nThis Reader can be used to configure for example a connected easymouse." ))) list.append( getConfigListEntry( _("External Reader /dev/ttyUSB1:"), config.plugins.OscamSmartcard.externalReader1, _("INFORMATION: External Reader /dev/ttyUSB1\n\nThis Reader can be used to configure for example a second connected easymouse." ))) if emuactive == 1: list.append( getConfigListEntry( _("Enable EMU Reader:"), config.plugins.OscamSmartcard.EMU, _("INFORMATION: Enable EMU Reader\n\nEnabling this Reader, OscamSmartcard will use Oscam Dmod as running Oscam (instead of regular OScam SVN XXXX).\nOscamSmartcard does NOT provide the required file SoftCam.Key!" ))) ConfigListScreen.__init__(self, list) self["actions"] = ActionMap( [ "OkCancelActions", "DirectionActions", "InputActions", "ColorActions" ], { "left": self.keyLeft, "down": self.keyDown, "up": self.keyUp, "right": self.keyRight, "red": self.exit, "yellow": self.reboot, "blue": self.showInfo, "green": self.save, "cancel": self.exit }, -1) self.onLayoutFinish.append(self.UpdatePicture) if not self.selectionChanged in self["config"].onSelectionChanged: self["config"].onSelectionChanged.append(self.selectionChanged) self.selectionChanged()
def __init__(self, session): Screen.__init__(self, session) self.setTitle(_("FastScan")) self["actions"] = ActionMap( ["SetupActions", "MenuActions"], { "ok": self.keyGo, "save": self.keySave, "cancel": self.keyCancel, "menu": self.closeRecursive, }, -2) lastConfiguration = eval(config.misc.fastscan.last_configuration.value) def providerChanged(configEntry): if configEntry.value: nimList = [ (str(x), nimmanager.nim_slots[x].friendly_full_description) for x in nimmanager.getNimListForSat(transponders[[ x[1][0] for x in providers if x[0] == configEntry.value ][0]][3]) ] self.scan_nims = ConfigSelection( default=lastConfiguration[0] if lastConfiguration and lastConfiguration[0] in [x[0] for x in nimList] else nimList[0][0], choices=nimList) self.tunerEntry = getConfigListEntry(_("Tuner"), self.scan_nims) providerList = getProviderList() if lastConfiguration and lastConfiguration[1] in providerList: self.scan_provider = ConfigSelection(default=lastConfiguration[1], choices=[(None, _("None"))] + providerList) self.scan_provider.addNotifier(providerChanged) self.scan_hd = ConfigYesNo(default=lastConfiguration[2]) self.scan_keepnumbering = ConfigYesNo(default=lastConfiguration[3]) self.scan_keepsettings = ConfigYesNo(default=lastConfiguration[4]) self.scan_create_radio_bouquet = ConfigYesNo( default=len(lastConfiguration) > 5 and lastConfiguration[5]) else: self.scan_provider = ConfigSelection(default=None, choices=[(None, _("None"))] + providerList) self.scan_provider.addNotifier(providerChanged) self.scan_hd = ConfigYesNo(default=True) self.scan_keepnumbering = ConfigYesNo(default=True) self.scan_keepsettings = ConfigYesNo(default=False) self.scan_create_radio_bouquet = ConfigYesNo(default=False) self.scanProvider = getConfigListEntry(_("Provider"), self.scan_provider) self.scanHD = getConfigListEntry(_("HD list"), self.scan_hd) self.config_autoproviders = {} auto_providers = config.misc.fastscan.autoproviders.value.split(",") for provider in providers: self.config_autoproviders[provider[0]] = ConfigYesNo( default=provider[0] in auto_providers) self.list = [] ConfigListScreen.__init__(self, self.list, session, self.createSetup) self.createSetup() self.finished_cb = None self["introduction"] = Label( _("Select your provider, and press OK to start the scan")) self["key_red"] = Label(_("Cancel")) self["key_green"] = Label(_("Save"))
def __init__(self, session, dvd_device=None, dvd_filelist=None, args=None): if not dvd_filelist: dvd_filelist = [] Screen.__init__(self, session) InfoBarBase.__init__(self) InfoBarNotifications.__init__(self) InfoBarCueSheetSupport.__init__(self, actionmap="MediaPlayerCueSheetActions") InfoBarShowHide.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarSubtitleSupport.__init__(self) HelpableScreen.__init__(self) self.save_infobar_seek_config() self.change_infobar_seek_config() InfoBarSeek.__init__(self) InfoBarPVRState.__init__(self) InfoBarLongKeyDetection.__init__(self) self.oldService = self.session.nav.getCurrentlyPlayingServiceOrGroup() self.session.nav.stopService() self["audioLabel"] = Label("n/a") self["subtitleLabel"] = Label("") self["angleLabel"] = Label("") self["chapterLabel"] = Label("") self["anglePix"] = Pixmap() self["anglePix"].hide() self.last_audioTuple = None self.last_subtitleTuple = None self.last_angleTuple = None self.totalChapters = 0 self.currentChapter = 0 self.totalTitles = 0 self.currentTitle = 0 self.__event_tracker = ServiceEventTracker(screen=self, eventmap={ iPlayableService.evStopped: self.__serviceStopped, iPlayableService.evUser: self.__timeUpdated, iPlayableService.evUser + 1: self.__statePlay, iPlayableService.evUser + 2: self.__statePause, iPlayableService.evUser + 3: self.__osdFFwdInfoAvail, iPlayableService.evUser + 4: self.__osdFBwdInfoAvail, iPlayableService.evUser + 5: self.__osdStringAvail, iPlayableService.evUser + 6: self.__osdAudioInfoAvail, iPlayableService.evUser + 7: self.__osdSubtitleInfoAvail, iPlayableService.evUser + 8: self.__chapterUpdated, iPlayableService.evUser + 9: self.__titleUpdated, iPlayableService.evUser + 11: self.__menuOpened, iPlayableService.evUser + 12: self.__menuClosed, iPlayableService.evUser + 13: self.__osdAngleInfoAvail }) self["DVDPlayerDirectionActions"] = ActionMap(["DirectionActions"], { #MENU KEY DOWN ACTIONS "left": self.keyLeft, "right": self.keyRight, "up": self.keyUp, "down": self.keyDown, #MENU KEY REPEATED ACTIONS "leftRepeated": self.doNothing, "rightRepeated": self.doNothing, "upRepeated": self.doNothing, "downRepeated": self.doNothing, #MENU KEY UP ACTIONS "leftUp": self.doNothing, "rightUp": self.doNothing, "upUp": self.doNothing, "downUp": self.doNothing, }) self["OkCancelActions"] = ActionMap(["OkCancelActions"], { "ok": self.keyOk, "cancel": self.keyCancel, }) self["DVDPlayerPlaybackActions"] = HelpableActionMap(self, "DVDPlayerActions", { #PLAYER ACTIONS "dvdMenu": (self.enterDVDMenu, _("show DVD main menu")), "toggleInfo": (self.toggleInfo, _("toggle time, chapter, audio, subtitle info")), "nextChapter": (self.nextChapter, _("forward to the next chapter")), "prevChapter": (self.prevChapter, _("rewind to the previous chapter")), "nextTitle": (self.nextTitle, _("jump forward to the next title")), "prevTitle": (self.prevTitle, _("jump back to the previous title")), "tv": (self.askLeavePlayer, _("exit DVD player or return to file browser")), "dvdAudioMenu": (self.enterDVDAudioMenu, _("(show optional DVD audio menu)")), "AudioSelection": (self.enterAudioSelection, _("Select audio track")), "nextAudioTrack": (self.nextAudioTrack, _("switch to the next audio track")), "nextSubtitleTrack": (self.nextSubtitleTrack, _("switch to the next subtitle language")), "nextAngle": (self.nextAngle, _("switch to the next angle")), "seekBeginning": self.seekBeginning, }, -2) 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, "0": self.keyNumberGlobal, }) self.onClose.append(self.__onClose) try: from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) except: pass self.autoplay = dvd_device or dvd_filelist if dvd_device: self.physicalDVD = True else: self.scanHotplug() self.dvd_filelist = dvd_filelist self.onFirstExecBegin.append(self.opened) self.service = None self.in_menu = False if fileExists("/proc/stb/fb/dst_left"): self.left = open("/proc/stb/fb/dst_left", "r").read() self.width = open("/proc/stb/fb/dst_width", "r").read() self.top = open("/proc/stb/fb/dst_top", "r").read() self.height = open("/proc/stb/fb/dst_height", "r").read() if self.left != "00000000" or self.top != "00000000" or self.width != "000002d0" or self.height != "0000000240": open("/proc/stb/fb/dst_left", "w").write("00000000") open("/proc/stb/fb/dst_width", "w").write("000002d0") open("/proc/stb/fb/dst_top", "w").write("00000000") open("/proc/stb/fb/dst_height", "w").write("0000000240") self.onClose.append(self.__restoreOSDSize)
def __init__(self, session, exportDir, client, options): self.skin = editExportEntry.skin self.session = session Screen.__init__(self, session) nfsoptions = [\ "ro,sync", "rw,sync", "ro,async", "rw,async", "ro,no_root_squash", "rw,no_root_squash", "ro,no_subtree_check", "rw,no_subtree_check", "ro,insecure", "rw,insecure", "ro,insecure,no_subtree_check", "rw,insecure,no_subtree_check", "ro,sync,no_subtree_check", "rw,sync,no_subtree_check", "ro,async,no_subtree_check", "rw,async,no_subtree_check", "ro,no_root_squash,no_subtree_check", "rw,no_root_squash,no_subtree_check", "ro,no_root_squash,sync", "rw,no_root_squash,sync", "ro,no_root_squash,sync,no_subtree_check", "rw,no_root_squash,sync,no_subtree_check", "ro,no_root_squash,async", "rw,no_root_squash,async", "ro,no_root_squash,async,no_subtree_check", "rw,no_root_squash,async,no_subtree_check"] optionsEntrys = {} for x in nfsoptions: optionsEntrys[x] = x clientIP = [192, 168, 0, 0] self.netmask = '' tmp = client.split('/') if len(tmp) > 1: client = tmp[0] self.netmask = tmp[1] if client == '*': everyIP = True else: everyIP = False theIP = client.split('.') clientIP = [] for x in theIP: clientIP.append(int(x)) self.exportDirConfigEntry = NoSave(ConfigDirectory(exportDir)) self.everyIPConfigEntry = NoSave(ConfigEnableDisable(default = everyIP)) self.clientConfigEntry = NoSave(ConfigIP(clientIP)) self.optionsConfigEntry = NoSave(ConfigSelection(optionsEntrys, options)) ConfigListScreen.__init__(self, []) self.createSetup() self.everyIPConfigEntry.addNotifier(self.toggleEveryIP) self["actions"] = ActionMap(["OkCancelActions", "ColorActions"], { "cancel": self.cancel, "red" : self.cancel, "green" : self.green, "ok" : self.ok }, -2) self["ButtonGreen"] = Pixmap() self["ButtonGreentext"] = Label(_("Save and Close")) self["ButtonRed"] = Pixmap() self["ButtonRedtext"] = Label(_("Close"))
def __init__(self, session, name, path, descr): Screen.__init__(self, session) self.skinName = ["AdvancedCutInput", "Setup"] self["key_green"] = StaticText(_("OK")) self["key_red"] = StaticText(_("Cancel")) if self.baseName(path) == self.baseName(name): title = "" else: title = name dir = self.dirName(path) file = self.baseName(path) + " cut" self.input_replace = ConfigSelection(choices=[("no", _("No")), ("yes", _("Yes"))], default="no") self.input_file = ConfigText(default=file, fixed_size=False, visible_width=45) self.input_title = ConfigText(default=title, fixed_size=False, visible_width=45) self.input_descr = ConfigText(default=descr, fixed_size=False, visible_width=45) tmp = config.movielist.videodirs.value if not dir in tmp: tmp.append(dir) self.input_dir = ConfigSelection(choices=tmp, default=dir) self.input_manual = ConfigSelection(choices=[ ("no", _("Cutlist")), ("yes", _("Manual specification")) ], default="no") self.input_space = ConfigNothing() self.input_manualcuts = ConfigText(default="", fixed_size=False) self.input_manualcuts.setUseableChars(" 0123456789:.") self["actions"] = ActionMap( ["SetupActions"], { "ok": self.keySelectOrGo, "save": self.keyGo, "cancel": self.keyCancel, }, -2) self.list = [] ConfigListScreen.__init__(self, self.list) self.entry_replace = getConfigListEntry(_("Replace original:"), self.input_replace) self.entry_file = getConfigListEntry(_("New filename:"), self.input_file) self.entry_title = getConfigListEntry(_("New title:"), self.input_title) self.entry_descr = getConfigListEntry(_("New description:"), self.input_descr) self.entry_dir = getConfigListEntry(_("New location:"), self.input_dir) self.entry_manual = getConfigListEntry(_("Cut source:"), self.input_manual) self.entry_space = getConfigListEntry( _("Cuts (an IN OUT IN OUT ... sequence of hour:min:sec)"), self.input_space) self.entry_manualcuts = getConfigListEntry(":", self.input_manualcuts) self.createSetup(self["config"]) self.onLayoutFinish.append(self.layoutFinished)
def __init__(self, session, iface, plugin_path): self.skin = setupNfs.skin self.session = session Screen.__init__(self, session) self.container = eConsoleAppContainer() self.container.appClosed.append(self.runFinished) self.container.dataAvail.append(self.dataAvail) if isRunning('portmap') and isRunning('nfsd'): isEnabled = True else: isEnabled = False self.activeConfigEntry = NoSave(ConfigEnableDisable(default = isEnabled)) self["nfsdLabel"] = Label() self["portmapLabel"] = Label() self["ButtonGreen"] = Pixmap() self["ButtonGreentext"] = Button(_("save and start/restart NFS-Server")) self["ButtonRed"] = Pixmap() self["ButtonRedtext"] = Label(_("Close")) self["ButtonYellow"] = Pixmap() self["ButtonYellowtext"] = Label(_("New Entry")) self["ButtonBlue"] = Pixmap() self["ButtonBluetext"] = Label(_("Remove Entry")) self.startingUp = False self.goingDown = False self.cmdlist = [] self.run = 0 self.exportlist = [] data = self.readExports() if data is not None: for line in data: exportDir = line[0] client = line[1] options = line[2] options = options.replace('(', '') options = options.replace(')', '') self.exportlist.append((exportDir, client, options)) else: self.exportlist.append(('/media/hdd', '*', 'rw,no_root_squash,sync')) self["exportlist"] = List(self.exportlist) self.hideList = self["exportlist"].list self.createSetup() ConfigListScreen.__init__(self, self.list, session = session) self.activeConfigEntry.addNotifier(self.toggleServer) self["actions"] = ActionMap(["OkCancelActions", "ColorActions"], { "cancel" : self.cancel, "ok" : self.editExportEntry, "green" : self.green, "red" : self.cancel, "yellow" : self.newExportEntry, "blue" : self.deleteExportEntry }, -2)
def __init__(self, session, menu_path=""): Screen.__init__(self, session) screentitle = _("Memory") if config.usage.show_menupath.value == 'large': menu_path += screentitle title = menu_path self["menu_path_compressed"] = StaticText("") elif config.usage.show_menupath.value == 'small': title = screentitle self["menu_path_compressed"] = StaticText( menu_path + " >" if not menu_path.endswith(' / ') else menu_path[:-3] + " >" or "") else: title = screentitle self["menu_path_compressed"] = StaticText("") Screen.setTitle(self, title) self.skinName = ["SystemMemoryInfo", "About"] self["lab1"] = StaticText(_("Open Black Hole Image")) self["lab2"] = StaticText(_("By Bh Team")) self["lab3"] = StaticText( _("Support at") + " www.vuplus-community.net") self["AboutScrollLabel"] = ScrollLabel() self["key_red"] = Button(_("Close")) self["actions"] = ActionMap(["SetupActions", "ColorActions"], { "cancel": self.close, "ok": self.close, "red": self.close, }) out_lines = file("/proc/meminfo").readlines() self.AboutText = _("RAM") + '\n\n' RamTotal = "-" RamFree = "-" for lidx in range(len(out_lines) - 1): tstLine = out_lines[lidx].split() if "MemTotal:" in tstLine: MemTotal = out_lines[lidx].split() self.AboutText += _( "Total memory:") + "\t" + MemTotal[1] + "\n" if "MemFree:" in tstLine: MemFree = out_lines[lidx].split() self.AboutText += _("Free memory:") + "\t" + MemFree[1] + "\n" if "Buffers:" in tstLine: Buffers = out_lines[lidx].split() self.AboutText += _("Buffers:") + "\t" + Buffers[1] + "\n" if "Cached:" in tstLine: Cached = out_lines[lidx].split() self.AboutText += _("Cached:") + "\t" + Cached[1] + "\n" if "SwapTotal:" in tstLine: SwapTotal = out_lines[lidx].split() self.AboutText += _("Total swap:") + "\t" + SwapTotal[1] + "\n" if "SwapFree:" in tstLine: SwapFree = out_lines[lidx].split() self.AboutText += _("Free swap:") + "\t" + SwapFree[1] + "\n\n" self["actions"].setEnabled(False) self.Console = Console() self.Console.ePopen("df -mh / | grep -v '^Filesystem'", self.Stage1Complete)
def __init__(self, session): Screen.__init__(self, session) self.setTitle(_("About")) hddsplit, = skin.parameters.get("AboutHddSplit", (0, )) AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n" AboutText += _("CPU: ") + about.getCPUInfoString() + "\n" AboutText += _("Image: ") + about.getImageTypeString() + "\n" AboutText += _("Installed: ") + about.getFlashDateString() + "\n" AboutText += _( "Kernel version: ") + about.getKernelVersionString() + "\n" EnigmaVersion = "Enigma: " + about.getEnigmaVersionString() self["EnigmaVersion"] = StaticText(EnigmaVersion) AboutText += EnigmaVersion + "\n" AboutText += _( "Enigma (re)starts: %d\n") % config.misc.startCounter.value GStreamerVersion = "GStreamer: " + about.getGStreamerVersionString( ).replace("GStreamer", "") self["GStreamerVersion"] = StaticText(GStreamerVersion) AboutText += GStreamerVersion + "\n" ImageVersion = _("Last upgrade: ") + about.getImageVersionString() self["ImageVersion"] = StaticText(ImageVersion) AboutText += ImageVersion + "\n" AboutText += _("DVB drivers: ") + about.getDriverInstalledDate() + "\n" AboutText += _( "Python version: ") + about.getPythonVersionString() + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" else: fp_version = _("Frontprocessor version: %d") % fp_version AboutText += fp_version + "\n" self["FPVersion"] = StaticText(fp_version) self["TunerHeader"] = StaticText(_("Detected NIMs:")) AboutText += "\n" + _("Detected NIMs:") + "\n" nims = nimmanager.nimList() for count in range(len(nims)): if count < 4: self["Tuner" + str(count)] = StaticText(nims[count]) else: self["Tuner" + str(count)] = StaticText("") AboutText += nims[count] + "\n" self["HDDHeader"] = StaticText(_("Detected HDD:")) AboutText += "\n" + _("Detected HDD:") + "\n" hddlist = harddiskmanager.HDDList() hddinfo = "" if hddlist: formatstring = hddsplit and "%s:%s, %.1f %sB %s" or "%s\n(%s, %.1f %sB %s)" for count in range(len(hddlist)): if hddinfo: hddinfo += "\n" hdd = hddlist[count][1] if int(hdd.free()) > 1024: hddinfo += formatstring % (hdd.model(), hdd.capacity(), hdd.free() / 1024.0, "G", _("free")) else: hddinfo += formatstring % (hdd.model(), hdd.capacity(), hdd.free(), "M", _("free")) else: hddinfo = _("none") self["hddA"] = StaticText(hddinfo) AboutText += hddinfo self["AboutScrollLabel"] = ScrollLabel(AboutText) self["key_green"] = Button(_("Translations")) self["key_red"] = Button(_("Latest Commits")) self["key_blue"] = Button(_("Memory Info")) self["actions"] = ActionMap( ["ColorActions", "SetupActions", "DirectionActions"], { "cancel": self.close, "ok": self.close, "red": self.showCommits, "green": self.showTranslationInfo, "blue": self.showMemoryInfo, "up": self["AboutScrollLabel"].pageUp, "down": self["AboutScrollLabel"].pageDown })
def __init__(self, session, title = '', text = ''): Screen.__init__(self, session) self.skin = VirtualKeyBoardRUS_FIXED.skin self.keys_list = [] self.shiftkeys_list = [] self.lang = language.getLanguage() self.keys_list = [[u'EXIT', u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'0', u'BACKSPACE'], ['\xd0\x90', '\xd0\x91', '\xd0\x92', '\xd0\x93', '\xd0\x94', '\xd0\x95', '\xd0\x96', '\xd0\x97', '\xd0\x98', '\xd0\x99', '\xd0\x9a', '\xd0\x9b'], ['\xd0\x9c', '\xd0\x9d', '\xd0\x9e', '\xd0\x9f', '\xd0\xa0', '\xd0\xa1', '\xd0\xa2', '\xd0\xa3', '\xd0\xa4', '\xd0\xa5', '\xd0\xa6', '\xd0\xa7'], ['\xd0\xa8', '\xd0\xa9', '\xd0\xaa', '\xd0\xab', '\xd0\xac', '\xd0\xad', '\xd0\xae', '\xd0\xaf', u'.', u',', u'*', u'CLEAR'], [u'SHIFT', u'SPACE', u'OK']] self.shiftkeys_list = [[u'EXIT', u'!', u'"', u'\xa7', u'$', u'%', u'&', u'/', u'(', u')', u'=', u'BACKSPACE'], [u'Q', u'W', u'E', u'R', u'T', u'Z', u'U', u'I', u'O', u'P', u'?', u'#'], [u'A', u'S', u'D', u'F', u'G', u'H', u'J', u'K', u'L', u"'", u';', u':'], [u'>', u'Y', u'X', u'C', u'V', u'B', u'N', u'M', u'<', u'+', u'-', u'CLEAR'], [u'SHIFT', u'SPACE', u'OK']] self.shiftMode = False self.text = text self.selectedKey = 0 self['header'] = Label(title) self['text'] = Label(self.text) self['list'] = VirtualKeyBoardList([]) self['actions'] = ActionMap(['OkCancelActions', 'WizardActions', 'ColorActions'], {'ok': self.okClicked, 'cancel': self.exit, 'left': self.left, 'right': self.right, 'up': self.up, 'down': self.down, 'red': self.exit, 'yellow': self.backClicked, 'green': self.ok, 'blue': self.shiftClicked}, -2) self.onLayoutFinish.append(self.buildVirtualKeyBoard) self.max_key = 47 + len(self.keys_list[4])
def __init__(self, session, key, args=None): Screen.__init__(self, session) self.key = key getHotkeyFunctions() self.setTitle(_("Hotkey Setup") + " " + key[0][0]) self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("Save")) self["key_yellow"] = StaticText("") self["h_prev"] = Pixmap() self["h_next"] = Pixmap() self["description"] = Label() self.mode = "list" self.config = getattr(config.misc.hotkey, key[0][1]) self.expanded = [] self.selected = [] for x in self.config.value.split(','): if x.startswith("ZapPanic"): self.selected.append( ChoiceEntryComponent( '', ((_("Panic to") + " " + ServiceReference( eServiceReference(x.split( "/", 1)[1]).toString()).getServiceName()), x))) elif x.startswith("Zap"): self.selected.append( ChoiceEntryComponent( '', ((_("Zap to") + " " + ServiceReference( eServiceReference(x.split( "/", 1)[1]).toString()).getServiceName()), x))) else: function = next( (function for function in hotkey.functions if function[1] == x), None) if function: self.selected.append( ChoiceEntryComponent('', ((function[0]), function[1]))) text = _( "Press 'OK' for attach next function or 'CH+/-' for edit attached." ) if len(self.selected) else _("Press 'OK' for attach function.") self.prevselected = self.selected[:] if self.prevselected: self["key_yellow"].setText(_("Edit selection")) self["choosen"] = ChoiceList(list=self.selected, selection=0) self["list"] = ChoiceList(list=self.getFunctionList(), selection=0) self["actions"] = ActionMap( [ "OkCancelActions", "ColorActions", "DirectionActions", "KeyboardInputActions", "MenuActions" ], { "ok": self.keyOk, "cancel": self.cancel, "red": self.cancel, "green": self.save, "yellow": self.toggleMode, "up": self.keyUp, "down": self.keyDown, "left": self.keyLeft, "right": self.keyRight, "upRepeated": self.keyUp, "downRepeated": self.keyDown, "leftRepeated": self.keyLeft, "rightRepeated": self.keyRight, "pageUp": self.toggleMode, "pageDown": self.toggleMode, "moveUp": self.moveUp, "moveDown": self.moveDown, "menu": boundFunction(self.close, True), }, -1) self.description(text) self.showPrevNext() self.onLayoutFinish.append(self.__layoutFinished)
from Components.ActionMap import ActionMap globalActionMap = ActionMap(['GlobalActions']) globalActionMap.execBegin()
def __init__(self, session): Screen.__init__(self, session) self.skinName = "Standby" self.avswitch = AVSwitch() print "[Standby] enter standby" if path.exists("/usr/scripts/standby_enter.sh"): Console().ePopen("/usr/scripts/standby_enter.sh") self["actions"] = ActionMap( [ "StandbyActions" ], { "power": self.Power, "discrete_on": self.Power }, -1) globalActionMap.setEnabled(False) from Screens.InfoBar import InfoBar self.infoBarInstance = InfoBar.instance self.standbyStopServiceTimer = eTimer() self.standbyStopServiceTimer.callback.append(self.stopService) self.timeHandler = None self.setMute() if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]: # set LCDminiTV off setLCDMiniTVMode("0") self.paused_service = self.paused_action = False self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup() if Components.ParentalControl.parentalControl.isProtected(self.prev_running_service): self.prev_running_service = eServiceReference(config.tv.lastservice.value) service = self.prev_running_service and self.prev_running_service.toString() if service: if service.rsplit(":", 1)[1].startswith("/"): self.paused_service = hasattr(self.session.current_dialog, "pauseService") and hasattr(self.session.current_dialog, "unPauseService") and self.session.current_dialog or self.infoBarInstance self.paused_action = hasattr(self.paused_service, "seekstate") and hasattr(self.paused_service, "SEEK_STATE_PLAY") and self.paused_service.seekstate == self.paused_service.SEEK_STATE_PLAY self.paused_action and self.paused_service.pauseService() if not self.paused_service: self.timeHandler = eDVBLocalTimeHandler.getInstance() if self.timeHandler.ready(): if self.session.nav.getCurrentlyPlayingServiceOrGroup(): self.stopService() else: self.standbyStopServiceTimer.startLongTimer(5) self.timeHandler = None else: self.timeHandler.m_timeUpdated.get().append(self.stopService) if self.session.pipshown: self.infoBarInstance and hasattr(self.infoBarInstance, "showPiP") and self.infoBarInstance.showPiP() if getBrandOEM() in ('dinobot') or SystemInfo["HasHiSi"]: try: open("/proc/stb/hdmi/output", "w").write("off") except: pass self.onFirstExecBegin.append(self.__onFirstExecBegin) self.onClose.append(self.__onClose)
def __init__(self, session, autotimer, name, begin, end, disabled, sref, afterEvent, justplay, dirname, tags, bmargin=0): Screen.__init__(self, session) # Keep AutoTimer self.autotimer = autotimer # Initialize Buttons self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("OK")) self["key_yellow"] = StaticText() self["key_blue"] = StaticText() entries = [] append = entries.append self["list"] = SelectionList() if disabled is not None: append( SelectionEntryComponent( ': '.join((_("Enabled"), { True: _("disable"), False: _("enable") }[bool(disabled)])), not disabled, 0, True)) if name != "": append( SelectionEntryComponent( _("Match title: %s") % (name), name, 1, True)) append(SelectionEntryComponent(_("Exact match"), True, 8, True)) self.update_weekdays = False if begin and end: self.start = localtime(begin + bmargin) self.begin = localtime(begin) self.update_weekdays = self.start.tm_wday != self.begin.tm_wday end = localtime(end) append( SelectionEntryComponent( _("Match Timespan: %02d:%02d - %02d:%02d") % (self.begin[3], self.begin[4], end[3], end[4]), ((self.begin[3], self.begin[4]), (end[3], end[4])), 2, True)) # append( # SelectionEntryComponent( # _("Only on Weekday: %s") % (weekdays[self.begin.tm_wday][1],), # XXX: the lookup is dirty but works :P # str(self.begin.tm_wday), # 9, # True # )) if sref: append( SelectionEntryComponent( _("Only on Service: %s") % (sref.getServiceName().replace( '\xc2\x86', '').replace('\xc2\x87', '')), str(sref), 3, True)) if afterEvent is not None: append( SelectionEntryComponent( ': '.join((_("After event"), afterevent[afterEvent])), afterEvent, 4, True)) if justplay is not None: append( SelectionEntryComponent( ': '.join((_("Timer type"), { 0: _("record"), 1: _("zap") }[int(justplay)])), int(justplay), 5, True)) if dirname is not None: append( SelectionEntryComponent( ': '.join((_("Location"), dirname or "/hdd/movie/")), dirname, 6, True)) if tags: append( SelectionEntryComponent( ': '.join((_("Tags"), ', '.join(tags))), tags, 7, True)) self["list"] = SelectionList(entries) # Define Actions self["actions"] = ActionMap( ["OkCancelActions", "ColorActions"], { "ok": self.toggleSelection, "cancel": self.cancel, "red": self.cancel, "green": self.accept }, -1) self.onLayoutFinish.append(self.setCustomTitle)
# Embedded file name: /usr/lib/enigma2/python/GlobalActions.py from Components.ActionMap import ActionMap globalActionMap = ActionMap(['GlobalActions']) globalActionMap.execBegin()
def __init__(self, session, args=0): # some default values - be careful if you change this... stone_width = 30 stone_height = 30 stone_space = 4 self.maxslices = 4 self.stonesX = 15 self.stonesY = 10 self.maxstones = self.stonesX * self.stonesY path = "/usr/lib/enigma2/python/Plugins/Extensions/eSame/data/" # Load bitmaps... self.maps = [] for color in ["red", "blue", "green"]: tmp = [] for x in range(self.maxslices): tmp.append(LoadPixmap(path + color + str(x) + ".png")) self.maps.append(tmp) # solve focus coordinates and generate part of skin... self.focuslist = [] skincontent = "" posX = -1 for x in range(self.maxstones): posY = x / self.stonesX posX += 1 if posX >= self.stonesX: posX = 0 absX = stone_space + (posX * (stone_space + stone_width)) absY = stone_space + (posY * (stone_space + stone_height)) self.focuslist.append((absX + 5, absY + 5)) skincontent += "<widget name=\"stone" + str(x) + "\" position=\"" + str(absX + 5) + "," + str(absY + 5) + "\" size=\"" + str(stone_width) + "," + str(stone_height) + "\" zPosition=\"2\" transparent=\"1\" alphatest=\"on\" />" # solve window size... size_w = 5 + stone_width * self.stonesX + stone_space * (self.stonesX - 1) + 5 size_h = 5 + stone_height * self.stonesY + stone_space * (self.stonesY - 1) + 85 # get framebuffer resolution... desk = getDesktop(0) w = int(desk.size().width()) h = int(desk.size().height()) # display window in center... x0 = (w - size_w) / 2 y0 = (h - size_h) / 2 # solve skin... self.skin = "<screen position=\"" + str(x0) + "," + str(y0) + "\" size=\"" + str(size_w) + "," + str(size_h) + "\" title=\"eSame v0.1\" >" +\ "<widget name=\"frame\" position=\"" + str(5 + stone_space) + "," + str(5 + stone_space) + "\" size=\"" + str(stone_width) + "," + str(stone_height) + "\" pixmap=\"" + path + "focus.png\" zPosition=\"1\" alphatest=\"on\" />" +\ "<widget name=\"lbColors\" position=\"5," + str(size_h - 85) + "\" size=\"170,40\" valign=\"center\" font=\"Regular;17\" />" +\ "<widget name=\"lbBoard\" position=\"175," + str(size_h - 85) + "\" size=\"140,40\" valign=\"center\" font=\"Regular;17\" />" +\ "<widget name=\"lbMarked\" position=\"310," + str(size_h - 85) + "\" size=\"100,40\" valign=\"center\" font=\"Regular;17\" />" +\ "<widget name=\"lbScore\" position=\"410," + str(size_h - 85) + "\" size=\"110,40\" valign=\"center\" font=\"Regular;17\" />" +\ "<ePixmap name=\"green\" position=\"5," + str(size_h - 45) + "\" zPosition=\"3\" size=\"140,40\" pixmap=\"skin_default/buttons/green.png\" transparent=\"1\" alphatest=\"on\" /> \n" +\ "<ePixmap name=\"yellow\" position=\"" + str(size_w - 145) + "," + str(size_h - 45) + "\" zPosition=\"3\" size=\"140,40\" pixmap=\"skin_default/buttons/yellow.png\" transparent=\"1\" alphatest=\"on\" /> \n" +\ "<widget name=\"key_green\" position=\"5," + str(size_h - 45) + "\" zPosition=\"4\" size=\"140,40\" valign=\"center\" halign=\"center\" font=\"Regular;18\" transparent=\"1\" foregroundColor=\"white\" shadowColor=\"black\" shadowOffset=\"-1,-1\" /> \n" +\ "<widget name=\"key_yellow\" position=\"" + str(size_w - 145) + "," + str(size_h - 45) + "\" zPosition=\"4\" size=\"140,40\" valign=\"center\" halign=\"center\" font=\"Regular;18\" transparent=\"1\" foregroundColor=\"white\" shadowColor=\"black\" shadowOffset=\"-1,-1\" /> \n" +\ skincontent + "</screen>" Screen.__init__(self, session) self["actions"] = ActionMap(["OkCancelActions", "WizardActions", "ColorActions"], { "cancel": self.Exit, "ok": self.key_ok, "left": self.key_left, "right": self.key_right, "up": self.key_up, "down": self.key_down, "green": self.key_green, "yellow": self.key_yellow, }, -1) self["frame"] = MovingPixmap() self["lbColors"] = Label() self["lbBoard"] = Label() self["lbMarked"] = Label() self["lbScore"] = Label() self["key_green"] = Button("new game") self["key_yellow"] = Button("reset game") for x in range(self.maxstones): self["stone" + str(x)] = Pixmap() self.maxentry = self.maxstones - 1 self.stonefield = StoneField(self.stonesX, self.stonesY, 3, 0) self.onLayoutFinish.append(self.startup)
def __init__(self, csel, contexts = [ ], actions = { }, prio=0): ActionMap.__init__(self, contexts, actions, prio) self.csel = csel
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)
def __init__(self, session, service, cbServiceCommand, chName, chURL, chIcon): Screen.__init__(self, session) InfoBarNotifications.__init__(self) isEmpty = lambda x: x is None or len(x) == 0 or x == 'None' if isEmpty(chName): chName = 'Unknown' if isEmpty(chURL): chURL = 'Unknown' if isEmpty(chIcon): chIcon = 'default.png' chIcon = '%s/icons/%s' % (PLUGIN_PATH, chIcon) self.session = session self.service = service self.cbServiceCommand = cbServiceCommand self["actions"] = ActionMap( [ "OkCancelActions", "InfobarSeekActions", "MediaPlayerActions", "MovieSelectionActions" ], { "ok": self.doInfoAction, "cancel": self.doExit, "stop": self.doExit, "playpauseService": self.playpauseService, }, -2) self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged, iPlayableService.evStart: self.__serviceStarted, iPlayableService.evEOF: self.__evEOF, }) self.hidetimer = eTimer() self.hidetimer.timeout.get().append(self.doInfoAction) self.state = self.PLAYER_PLAYING self.lastseekstate = self.PLAYER_PLAYING self.__seekableStatusChanged() self.onClose.append(self.__onClose) self.doPlay() self['channel_icon'] = Pixmap() self['channel_name'] = Label(chName) self['channel_uri'] = Label(chURL) self.picload = ePicLoad() self.scale = AVSwitch().getFramebufferScale() self.picload.PictureData.get().append(self.cbDrawChannelIcon) print(self.scale[0]) print(self.scale[1]) self.picload.setPara( (35, 35, self.scale[0], self.scale[1], False, 0, "#00000000")) self.picload.startDecode(chIcon) self.bypassExit = False self.cbServiceCommand(('docommand', self.doCommand))
def __init__(self, session): Screen.__init__(self, session) self.session = session skin = skin_path + 'jmx_progress.xml' with open(skin, 'r') as f: self.skin = f.read() Screen.setTitle(self, _('Building Bouquets')) self.bouquet = jglob.current_playlist self.categories = jglob.selectedcategories if self.bouquet['playlist_info']['playlisttype'] != 'xtream' and self.bouquet['playlist_info']['playlisttype'] != 'panel': self.categories = [] self['action'] = Label(_('Building Bouquets...')) self['status'] = Label('') self['progress'] = ProgressBar() self['actions'] = ActionMap(['SetupActions'], {'cancel': self.keyCancel}, -2) self.pause = 5 self.index = 0 self.category_num = 0 self.job_current = 0 self.job_type = '' self.job_category_name = '' self.job_total = len(self.categories) self.progresscurrent = 0 self.progresscount = int(len(self.categories) + 2) if jglob.live: self.progresscount += 1 if jglob.vod: self.progresscount += 1 if jglob.series: self.progresscount += 2 if jglob.epg_rytec_uk: self.progresscount += 1 if self.bouquet['playlist_info']['playlisttype'] != 'xtream' and self.bouquet['playlist_info']['playlisttype'] != 'panel': # 1 delete bouquets, 2 bouquetType, 3 build m3u bouquet file, 4 refresh bouquets self.progresscount = 4 self['progress'].setRange((0, self.progresscount)) self['progress'].setValue(self.progresscurrent) self.m3uValues = [] self.rytec_ref = {} self.epg_alias_names = [] self.firstrun = True self.onFirstExecBegin.append(self.start)
def __init__(self, session, ScreenFile = ''): Screen.__init__(self, session) self.session = session #valid ScreenFile is mandatory if ScreenFile == '': self.close() return elif not path.exists(ScreenFile): self.close() return self.ScreenFile = ScreenFile try: self.root = ET.parse(self.ScreenFile).getroot() self.myScreenName = self.root.find('screen').attrib['name'] self.NumberOfScreens = len(self.root.findall('screen')) self.NumberOfChilds = len(self.root.findall('*')) except: printDEBUG("%s -Is NOT proper xml file - END!!!" % self.ScreenFile) self.close() return printDEBUG("%s has been loaded successfully. :)" % self.ScreenFile) if self.NumberOfChilds != self.NumberOfScreens: iindex = 0 for child in self.root.findall('*'): if child.tag == 'screen': break iindex+= 1 self.currentScreenID = iindex if self.myScreenName == None: myTitle=_("SphereFHD %s - EditScreens") % AtileHDInfo else: if self.NumberOfScreens == 1: myTitle=_("SphereFHD %s - Edit %s screen") % (AtileHDInfo,self.myScreenName) else: myTitle=_("SphereFHD %s - Edit %s screen (1/%d)") % (AtileHDInfo,self.myScreenName,self.NumberOfScreens) self.setTitle(myTitle) self["key_red"] = StaticText(_("Exit")) self["key_green"] = StaticText("") if self.NumberOfScreens == 1: self["key_yellow"] = StaticText("") else: self["key_yellow"] = StaticText(_("Switch screen")) self['key_blue'] = StaticText(_('Actions')) self["PreviewFont"] = Label() self["widgetDetailsTXT"] = Label() self["PixMapPreview"] = Pixmap() self["SkinPicture"] = Pixmap() self["ScreenPixMapPictureInScale"] = Pixmap() self["WigetPixMapPictureInScale"] = Pixmap() self["WigetPixMapPictureInScale1"] = Pixmap() self["WigetPixMapPictureInScale2"] = Pixmap() menu_list = [] self["menu"] = List(menu_list) self["shortcuts"] = ActionMap(["AtileHDActions"], { "ok": self.keyOK, "cancel": self.keyExit, "red": self.keyExit, "green": self.keyGreen, "yellow": self.keyYellow, "blue": self.keyBlue, "keyup": self.channelup, "keydown": self.channeldown, }, -2) self.skin_base_dir = SkinPath #self.screen_dir = "allScreens" self.allScreens_dir = "allScreens" #check if we have preview files isPreview=0 for xpreview in listdir(SkinPath + "allPreviews/"): if len(xpreview) > 4 and xpreview[-4:] == ".png": isPreview += 1 if isPreview >= 2: break self.elabel_png = LoadPixmap(cached=True, path= self.getPicFileNameWithPath("elabel.png")) self.epixmap_png = LoadPixmap(cached=True, path= self.getPicFileNameWithPath("epixmap.png")) self.label_png = LoadPixmap(cached=True, path= self.getPicFileNameWithPath("label.png")) self.pixmap_png = LoadPixmap(cached=True, path= self.getPicFileNameWithPath("pixmap.png")) self.widget_png = LoadPixmap(cached=True, path= self.getPicFileNameWithPath("widget.png")) if not self.selectionChanged in self["menu"].onSelectionChanged: self["menu"].onSelectionChanged.append(self.selectionChanged) self.onLayoutFinish.append(self.LayoutFinished)
def __init__(self, session, artItem, addParams): self.session = session self.artItem = artItem ############################################# # calculate num of rich desc items and pages ############################################# self.richDesc = { 'items_count': 0, 'pages_count': 0, 'page': 0, 'avalable_params': [] } try: if 'custom_items_list' in artItem.richDescParams: self.richDesc['custom_items_list'] = artItem.richDescParams[ 'custom_items_list'] self.richDesc['items_count'] = len( self.richDesc['custom_items_list']) else: for item in ArticleContent.RICH_DESC_PARAMS: if item in artItem.richDescParams: self.richDesc['items_count'] += 1 self.richDesc['avalable_params'].append(item) # yes I know, len(self.richDesc['avalable_params']) == self.richDesc['items_count'] except Exception: printExc() self.richDesc['pages_count'] = self.richDesc[ 'items_count'] / self.MAX_RICH_DESC_ROW_NUM if self.richDesc['items_count'] % self.MAX_RICH_DESC_ROW_NUM > 0: self.richDesc['pages_count'] += 1 if self.richDesc['items_count'] < self.MAX_RICH_DESC_ROW_NUM: self.richDesc['rows_count'] = self.richDesc['items_count'] else: self.richDesc['rows_count'] = self.MAX_RICH_DESC_ROW_NUM ############################################# self.__prepareSkin() Screen.__init__(self, session) for idx in range(self.richDesc['rows_count']): self["dsc_label_{0}".format(idx + 1)] = Label("") self["dsc_text_{0}".format(idx + 1)] = Label("") self["title"] = Label("") self["text"] = ScrollLabel(" ") self["page_marker"] = Cover3() ############################################# # COVER ############################################# self["cover"] = Cover() self.cover = { 'src': '', 'downloader': None, 'files_to_remove': [], 'image_path': '' } try: self.cover['image_path'] = os.path.join( addParams['buffering_path'], '.iptv_buffering.jpg') except Exception: printExc() ############################################# ############################################# # SPINER ############################################# try: for idx in range(5): spinnerName = "spinner" if idx: spinnerName += '_%d' % idx self[spinnerName] = Cover3() except Exception: printExc() self.spinner = {} self.spinner["pixmap"] = [ LoadPixmap(GetIconDir('radio_button_on.png')), LoadPixmap(GetIconDir('radio_button_off.png')) ] # spinner timer self.spinner["timer"] = eTimer() self.spinner["timer_conn"] = eConnectCallback( self.spinner["timer"].timeout, self.updateSpinner) self.spinner["timer_interval"] = 200 self.spinner["enabled"] = False ############################################# self["actions"] = ActionMap( [ 'IPTVAlternateVideoPlayer', 'MoviePlayerActions', 'MediaPlayerActions', 'WizardActions', 'DirectionActions' ], { "ok": self.key_ok, "back": self.key_back, "left": self.key_left, "right": self.key_right, "up": self.key_up, "down": self.key_down, }, -1) self.onClose.append(self.__onClose) #self.onShow.append(self.onStart) self.onLayoutFinish.append(self.onStart)
def __init__(self, session, EIB_objects): skin = """ <screen position="center,center" size="550,450" title="E.I.B.ox" > <widget name="config" position="10,420" size="530,26" zPosition="1" transparent="1" scrollbarMode="showNever" /> <ePixmap pixmap="%s" position="0,0" size="550,400" zPosition="-1" alphatest="on" />\n""" % ( img_prefix + EIB_objects.zone_img) offset = [12, 10] # fix up browser css spacing iconsize = [32, 32] self.setup_title = "E.I.B.ox" self.EIB_objects = EIB_objects for EIB_object in self.EIB_objects: if EIB_object.object_type == EIB_GOTO: pixmap_src = (img_prefix + 'goto' + EIB_object.img.capitalize() + '.png') skin += '\t\t\t<widget name="%s" pixmap="%s" position="%s" size="32,32" transparent="1" alphatest="on" borderColor="#004679" zPosition="1" />\n' % ( EIB_object.object_id, pixmap_src, EIB_object.getPos(offset)) self[EIB_object.object_id] = Pixmap() elif EIB_object.object_type in (EIB_SWITCH, EIB_MULTISWITCH, EIB_DIMMER): if EIB_object.object_type == EIB_DIMMER or EIB_object.img == "light": pixmaps_sources = ['light_off.png', 'light_on.png'] elif EIB_object.img == "blinds": pixmaps_sources = ['blinds_up.png', 'blinds_down.png'] elif EIB_object.img == "outlet": pixmaps_sources = ['outlet_off.png', 'outlet_on.png'] elif EIB_object.img == "fan": pixmaps_sources = ['fan_off.png', 'fan_on.png'] elif EIB_object.img == "pump": pixmaps_sources = ['pump_off.png', 'pump_on.png'] else: pixmaps_sources = list(EIB_object.custom_img) for idx, filename in enumerate(pixmaps_sources): pixmaps_sources[idx] = img_prefix + filename pixmaps_string = ','.join(pixmaps_sources) skin += '\t\t\t<widget name="%s" pixmaps="%s" position="%s" size="32,32" transparent="1" alphatest="on" borderColor="#004679" zPosition="1" />\n' % ( EIB_object.object_id, pixmaps_string, EIB_object.getPos(offset)) self[EIB_object.object_id] = MultiPixmap() if EIB_object.object_type == EIB_DIMMER: skin += '\t\t\t<widget source="%s_progress" render="Progress" pixmap="progress_small.png" position="%s" size="32,5" backgroundColor="#4f74BB" zPosition="1" />\n' % ( EIB_object.object_id, EIB_object.getPos([offset[0], offset[1] - iconsize[1] ])) self[EIB_object.object_id + "_progress"] = Progress() self[EIB_object.object_id + "_progress"].range = 255 elif EIB_object.object_type in (EIB_THERMO, EIB_TEXT): skin += '\t\t\t<widget name="%s" position="%s" size="120,20" font="Regular;14" halign="left" valign="center" foregroundColors="#000000,#0000FF" transparent="1" zPosition="1" />\n' % ( EIB_object.object_id, EIB_object.getPos(offset)) self[EIB_object.object_id] = MultiColorLabel() skin += """ </screen>""" if config.eib.debug.value: print skin self.skin = skin Screen.__init__(self, session) self.initConfigList() ConfigListScreen.__init__(self, self.list, session=self.session, on_change=self.changedEntry) self.onChangedEntry = [] self["actions"] = ActionMap( [ "SetupActions", "OkCancelActions", "ColorActions", "DirectionActions" ], { "up": self.keyUp, "upUp": self.keyPass, "upRepeated": self.keyUp, "down": self.keyDown, "downUp": self.keyPass, "downRepeated": self.keyDown, "leftRepeated": self.keyLeftRepeated, "rightRepeated": self.keyRightRepeated, "cancel": self.keyCancel, "red": self.keyCancel, "green": self.keyOk, "ok": self.keyOk }, -2) self.onLayoutFinish.append(self.layoutFinished)
def __init__(self, session, csel, service): # print("[SF-Plugin] SF:MovieContextMenu init") Screen.__init__(self, session) self.csel = csel self.service = service self["actions"] = ActionMap(["OkCancelActions"], { "ok": self.okbuttonClick, "cancel": self.cancelClick }) menu = [(_("delete..."), self.delete)] menu.extend([ (p.description, boundFunction(self.execPlugin, p)) for p in plugins.getPlugins(PluginDescriptor.WHERE_MOVIELIST) ]) if config.movielist.sfmoviesort.value == MovieList.SORT_ALPHANUMERIC: menu.append((_x("sort by date (quick toggle by key 0)"), boundFunction(self.sortBy, MovieList.SORT_RECORDED))) else: menu.append((_x("alphabetic sort (quick toggle by key 0)"), boundFunction(self.sortBy, MovieList.SORT_ALPHANUMERIC))) menu.extend( ((_x("list style elaborately"), boundFunction(self.listType, MovieList.LISTTYPE_ORIGINAL)), (_x("list style compact with service (quick toggle by key 8)"), boundFunction(self.listType, MovieList.LISTTYPE_COMPACT_SERVICE)), (_x("list style compact with tags (quick toggle by key 8)"), boundFunction(self.listType, MovieList.LISTTYPE_COMPACT_TAGS)), (_x("list style single line (key = service, 8 = tags)"), boundFunction(self.listType, MovieList.LISTTYPE_MINIMAL)))) if config.movielist.sftimes.value & MovieList.SHOW_RECORDINGTIME: menu.append((_x("hide recordingtime"), boundFunction(self.showTimes, MovieList.SHOW_RECORDINGTIME))) else: menu.append((_x("show recordingtime"), boundFunction(self.showTimes, MovieList.SHOW_RECORDINGTIME))) if config.movielist.sftimes.value & MovieList.SHOW_DURATION: menu.append((_x("hide duration"), boundFunction(self.showTimes, MovieList.SHOW_DURATION))) else: menu.append((_x("show duration"), boundFunction(self.showTimes, MovieList.SHOW_DURATION))) menu.append((_x("Configuration of the title:episode separator"), boundFunction(self.sfconfigure, None))) if config.movielist.sftimes.value & MovieList.SHOW_DIRECTORIES: menu.append((_x("hide the read real directories"), boundFunction(self.showTimes, MovieList.SHOW_DIRECTORIES))) else: menu.append((_x("show real directories in red"), boundFunction(self.showTimes, MovieList.SHOW_DIRECTORIES))) self["menu"] = MenuList(menu)
def __init__(self, player, contexts = [ ], actions = { }, prio=0): ActionMap.__init__(self, contexts, actions, prio) self.player = player
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 })
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}, )
def __init__(self, session): serienRecBaseScreen.__init__(self, session) Screen.__init__(self, session) HelpableScreen.__init__(self) self.session = session self.picload = ePicLoad() self.database = SRDatabase(SerienRecorder.serienRecDataBaseFilePath) self.chooseMenuList_popup = MenuList( [], enableWrapAround=True, content=eListboxPythonMultiContent) self["actions"] = HelpableActionMap( self, "SerienRecorderActions", { "ok": (self.keyOK, "für die ausgewählte Serien neue Einträge hinzufügen"), "cancel": (self.keyCancel, "zurück zur vorherigen Ansicht"), "left": (self.keyLeft, "zur vorherigen Seite blättern"), "right": (self.keyRight, "zur nächsten Seite blättern"), "up": (self.keyUp, "eine Zeile nach oben"), "down": (self.keyDown, "eine Zeile nach unten"), "red": (self.keyRed, "ausgewählten Eintrag löschen"), "green": (self.keyGreen, "alle Änderungen speichern und zurück zur vorherigen Ansicht" ), "yellow": (self.keyYellow, "umschalten Sortierung ein/aus"), "blue": (self.keyBlue, "alle Einträge aus der Liste endgültig löschen"), "menu": (self.recSetup, "Menü für globale Einstellungen öffnen"), "0": (self.readLogFile, "Log-File des letzten Suchlaufs anzeigen"), "3": (self.showProposalDB, "Liste der Serien/Staffel-Starts anzeigen"), "4": (self.serieInfo, "Informationen zur ausgewählten Serie anzeigen"), "6": (self.showConflicts, "Liste der Timer-Konflikte anzeigen"), }, -1) self.helpList[0][2].sort() self["helpActions"] = ActionMap([ "SerienRecorderActions", ], { "displayHelp": self.showHelp, "displayHelp_long": self.showManual, }, 0) self.setupSkin() self.delAdded = False self.wishlist = [] self.wishlist_tmp = [] self.dbData = [] self.modus = "menu_list" self.aSerie = "" self.aStaffel = 0 self.aFromEpisode = 0 self.aToEpisode = 0 self.onLayoutFinish.append(self.readWishlist) self.onClose.append(self.__onClose) self.onLayoutFinish.append(self.setSkinProperties)
def __init__(self, session): Screen.__init__(self, session) # Summary self.setup_title = _("AutoTimer Settings") self.onChangedEntry = [] ConfigListScreen.__init__(self, [ getConfigListEntry( _("Poll automatically"), config.plugins.autotimer.autopoll, _("Unless this is enabled AutoTimer will NOT automatically look for events matching your AutoTimers but only when you leave the GUI with the green button." )), getConfigListEntry( _("Only poll while in standby"), config.plugins.autotimer.onlyinstandby, _("When this is enabled AutoTimer will ONLY check for new events whilst in stanadby." )), getConfigListEntry( _("Startup delay (in min)"), config.plugins.autotimer.delay, _("This is the delay in minutes that the AutoTimer will wait on initial launch to not delay enigma2 startup time." )), getConfigListEntry( _("Poll Interval (in mins)"), config.plugins.autotimer.interval, _("This is the delay in minutes that the AutoTimer will wait after a search to search the EPG again." )), getConfigListEntry( _("Only add timer for next x days"), config.plugins.autotimer.maxdaysinfuture, _("You can control for how many days in the future timers are added. Set this to 0 to disable this feature." )), getConfigListEntry( _("Show in plugin browser"), config.plugins.autotimer.show_in_plugins, _("Enable this to be able to access the AutoTimer Overview from within the plugin browser." )), getConfigListEntry( _("Show in extension menu"), config.plugins.autotimer.show_in_extensionsmenu, _("Enable this to be able to access the AutoTimer Overview from within the extension menu." )), getConfigListEntry( _("Modify existing timers"), config.plugins.autotimer.refresh, _("This setting controls the behavior when a timer matches a found event." )), getConfigListEntry( _("Guess existing timer based on begin/end"), config.plugins.autotimer.try_guessing, _("If this is enabled an existing timer will also be considered recording an event if it records at least 80% of the it." )), getConfigListEntry( _("Add similar timer on conflict"), config.plugins.autotimer.addsimilar_on_conflict, _("If a timer conflict occurs, AutoTimer will search outside the timespan for a similar event and add it." )), getConfigListEntry( _("Add timer as disabled on conflict"), config.plugins.autotimer.disabled_on_conflict, _("This toggles the behavior on timer conflicts. If an AutoTimer matches an event that conflicts with an existing timer it will not ignore this event but add it disabled." )), getConfigListEntry( _("Include \"AutoTimer\" in tags"), config.plugins.autotimer.add_autotimer_to_tags, _("If this is selected, the tag \"AutoTimer\" will be given to timers created by this plugin." )), getConfigListEntry( _("Include AutoTimer name in tags"), config.plugins.autotimer.add_name_to_tags, _("If this is selected, the name of the respective AutoTimer will be added as a tag to timers created by this plugin." )), getConfigListEntry( _("Show notification on conflicts"), config.plugins.autotimer.notifconflict, _("By enabling this you will be notified about timer conflicts found during automated polling. There is no intelligence involved, so it might bother you about the same conflict over and over." )), getConfigListEntry( _("Show notification on similars"), config.plugins.autotimer.notifsimilar, _("By enabling this you will be notified about similar timers added during automated polling. There is no intelligence involved, so it might bother you about the same conflict over and over." )), getConfigListEntry( _("Editor for new AutoTimers"), config.plugins.autotimer.editor, _("The editor to be used for new AutoTimers. This can either be the Wizard or the classic editor." )), getConfigListEntry( _("Support \"Fast Scan\"?"), config.plugins.autotimer.fastscan, _("When supporting \"Fast Scan\" the service type is ignored. You don't need to enable this unless your Image supports \"Fast Scan\" and you are using it." )), getConfigListEntry( _("Skip poll during records"), config.plugins.autotimer.skip_during_records, _("If enabled, the polling will be skipped if a recording is in progress." )), ], session=session, on_change=self.changed) def selectionChanged(): if self["config"].current: self["config"].current[1].onDeselect(self.session) self["config"].current = self["config"].getCurrent() if self["config"].current: self["config"].current[1].onSelect(self.session) for x in self["config"].onSelectionChanged: x() self["config"].selectionChanged = selectionChanged self["config"].onSelectionChanged.append(self.updateHelp) # Initialize widgets self["key_green"] = StaticText(_("OK")) self["key_red"] = StaticText(_("Cancel")) self["help"] = StaticText() # Define Actions self["actions"] = ActionMap(["SetupActions"], { "cancel": self.keyCancel, "save": self.Save, }) # Trigger change self.changed() self.onLayoutFinish.append(self.setCustomTitle)
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.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["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)
def __init__(self, session, piclist, lastindex, path): self.textcolor = config.pic.textcolor.value self.color = config.pic.bgcolor.value textsize = 20 self.spaceX = 35 self.picX = 190 self.spaceY = 30 self.picY = 200 self.size_w = getDesktop(0).size().width() self.size_h = getDesktop(0).size().height() self.thumbsX = self.size_w / (self.spaceX + self.picX) # thumbnails in X self.thumbsY = self.size_h / (self.spaceY + self.picY) # thumbnails in Y self.thumbsC = self.thumbsX * self.thumbsY # all thumbnails self.positionlist = [] skincontent = "" posX = -1 for x in list(range(self.thumbsC)): posY = x / self.thumbsX posX += 1 if posX >= self.thumbsX: posX = 0 absX = self.spaceX + (posX*(self.spaceX + self.picX)) absY = self.spaceY + (posY*(self.spaceY + self.picY)) self.positionlist.append((absX, absY)) skincontent += "<widget source=\"label" + str(x) + "\" render=\"Label\" position=\"" + str(absX+5) + "," + str(absY+self.picY-textsize) + "\" size=\"" + str(self.picX - 10) + "," + str(textsize) + "\" font=\"Regular;14\" zPosition=\"2\" transparent=\"1\" noWrap=\"1\" foregroundColor=\"" + self.textcolor + "\" />" skincontent += "<widget name=\"thumb" + str(x) + "\" position=\"" + str(absX+5)+ "," + str(absY+5) + "\" size=\"" + str(self.picX -10) + "," + str(self.picY - (textsize*2)) + "\" zPosition=\"2\" transparent=\"1\" alphatest=\"on\" />" # Screen, backgroundlabel and MovingPixmap self.skin = "<screen position=\"0,0\" size=\"" + str(self.size_w) + "," + str(self.size_h) + "\" flags=\"wfNoBorder\" > \ <eLabel position=\"0,0\" zPosition=\"0\" size=\""+ str(self.size_w) + "," + str(self.size_h) + "\" backgroundColor=\"" + self.color + "\" /><widget name=\"frame\" position=\"35,30\" size=\"190,200\" pixmap=\"pic_frame.png\" zPosition=\"1\" alphatest=\"on\" />" + skincontent + "</screen>" Screen.__init__(self, session) self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "DirectionActions", "MovieSelectionActions"], { "cancel": self.Exit, "ok": self.KeyOk, "left": self.key_left, "right": self.key_right, "up": self.key_up, "down": self.key_down, "showEventInfo": self.StartExif, }, -1) self["frame"] = MovingPixmap() for x in list(range(self.thumbsC)): self["label"+str(x)] = StaticText() self["thumb"+str(x)] = Pixmap() self.Thumbnaillist = [] self.filelist = [] self.currPage = -1 self.dirlistcount = 0 self.path = path index = 0 framePos = 0 Page = 0 for x in piclist: if not x[0][1]: self.filelist.append((index, framePos, Page, x[0][0], path + x[0][0])) index += 1 framePos += 1 if framePos > (self.thumbsC -1): framePos = 0 Page += 1 else: self.dirlistcount += 1 self.maxentry = len(self.filelist)-1 self.index = lastindex - self.dirlistcount if self.index < 0: self.index = 0 self.picload = ePicLoad() self.picload.PictureData.get().append(self.showPic) self.onLayoutFinish.append(self.setPicloadConf) self.ThumbTimer = eTimer() self.ThumbTimer.callback.append(self.showPic)
def __init__(self, session): Screen.__init__(self, session) self.current_play_service = self.session.nav.getCurrentlyPlayingServiceReference( ) # update sat list self.satList = [] for slot in nimmanager.nim_slots: if slot.isCompatible("DVB-S"): self.satList.append(nimmanager.getSatListForNim(slot.slot)) else: self.satList.append(None) # make config self.createConfig() self.list = [] self.status = "" ConfigListScreen.__init__(self, self.list) if self.scan_nims.value != None and self.scan_nims.value != "": self["actions"] = ActionMap( [ "OkCancelActions", "ShortcutActions", "WizardActions", "ColorActions", "SetupActions", ], { "red": self.keyCancel, "green": self.keyGo, "blue": self.keyGoAll, "ok": self.keyGo, "cancel": self.keyCancel, }, -2) self["key_red"] = StaticText(_("Exit")) self["key_green"] = StaticText(_("Scan")) self["key_blue"] = StaticText(_("Scan All")) self["introduction"] = Label(_("Press Green/OK to start the scan")) self.createSetup() else: self["actions"] = ActionMap( [ "OkCancelActions", "ShortcutActions", "WizardActions", "ColorActions", "SetupActions", ], { "red": self.keyCancel, "green": self.keyNone, "blue": self.keyNone, "ok": self.keyNone, "cancel": self.keyCancel, }, -2) self["key_red"] = StaticText(_("Exit")) self["key_green"] = StaticText(" ") self["key_blue"] = StaticText(" ") self["introduction"] = Label( _("Please setup your tuner configuration.")) self.i2c_mapping_table = None self.nimSockets = self.ScanNimsocket() self.makeNimSocket()
def __init__(self, session, menu_path=""): Screen.__init__(self, session) screentitle = _("Network") if config.usage.show_menupath.value == 'large': menu_path += screentitle title = menu_path self["menu_path_compressed"] = StaticText("") elif config.usage.show_menupath.value == 'small': title = screentitle self["menu_path_compressed"] = StaticText( menu_path + " >" if not menu_path.endswith(' / ') else menu_path[:-3] + " >" or "") else: title = screentitle self["menu_path_compressed"] = StaticText("") Screen.setTitle(self, title) self.skinName = ["SystemNetworkInfo", "WlanStatus"] self["LabelBSSID"] = StaticText() self["LabelESSID"] = StaticText() self["LabelQuality"] = StaticText() self["LabelSignal"] = StaticText() self["LabelBitrate"] = StaticText() self["LabelEnc"] = StaticText() self["BSSID"] = StaticText() self["ESSID"] = StaticText() self["quality"] = StaticText() self["signal"] = StaticText() self["bitrate"] = StaticText() self["enc"] = StaticText() self["IFtext"] = StaticText() self["IF"] = StaticText() self["Statustext"] = StaticText() self["statuspic"] = MultiPixmap() self["statuspic"].setPixmapNum(1) self["statuspic"].show() self["devicepic"] = MultiPixmap() self["AboutScrollLabel"] = ScrollLabel() self.iface = None self.createscreen() self.iStatus = None if iNetwork.isWirelessInterface(self.iface): try: from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus self.iStatus = iStatus except: pass self.resetList() self.onClose.append(self.cleanup) self["key_red"] = StaticText(_("Close")) self["actions"] = ActionMap( ["SetupActions", "ColorActions", "DirectionActions"], { "cancel": self.close, "ok": self.close, "up": self["AboutScrollLabel"].pageUp, "down": self["AboutScrollLabel"].pageDown }) self.onLayoutFinish.append(self.updateStatusbar)