def __init__(self, session): Screen.__init__(self, session) logoname = "Hypercube" # show # try: # fd = open("/proc/stb/info/eeprom/customer_id",'r'); # costomid = fd.read(8) # print costomid # for cust in custidlist: # if cust["custid"] == costomid: # logoname = cust["custname"] # break # except: # pass self["AboutTitle"] = StaticText("About " + logoname) # AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n" AboutText = _("Hardware: ") + logoname + "\n" AboutText += _("Image: ") + about.getImageTypeString() + "\n" AboutText += _( "Kernel Version: ") + about.getKernelVersionString() + "\n" EnigmaVersion = "Enigma: " + about.getEnigmaVersionString() self["EnigmaVersion"] = StaticText(EnigmaVersion) AboutText += EnigmaVersion + "\n" ImageVersion = _("Last Upgrade: ") + about.getImageVersionString() self["ImageVersion"] = StaticText(ImageVersion) AboutText += ImageVersion + "\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: for count in range(len(hddlist)): if hddinfo: hddinfo += "\n" hdd = hddlist[count][1] if int(hdd.free()) > 1024: hddinfo += "%s\n(%s, %d GB %s)" % ( hdd.model(), hdd.capacity(), hdd.free() / 1024, _("free")) else: hddinfo += "%s\n(%s, %d MB %s)" % ( hdd.model(), hdd.capacity(), hdd.free(), _("free")) else: hddinfo = _("none") self["hddA"] = StaticText(hddinfo) AboutText += hddinfo self["AboutScrollLabel"] = ScrollLabel(AboutText) self["actions"] = ActionMap( ["SetupActions", "ColorActions", "DirectionActions"], { "cancel": self.close, "ok": self.close, "green": self.showTranslationInfo, "up": self["AboutScrollLabel"].pageUp, "down": self["AboutScrollLabel"].pageDown })
def checkNetworkState(self, str, retval, extra_args): import subprocess import os os.system('ps -ef > /tmp/ps.txt') ftp_process = subprocess.getoutput("grep -i vsftpd /tmp/ps.txt") telnetd_process = subprocess.getoutput("grep -i telnetd /tmp/ps.txt") ipv6_process = subprocess.getoutput( "cat /proc/sys/net/ipv6/conf/all/disable_ipv6") afp_process = subprocess.getoutput("grep -i afpd /tmp/ps.txt") sabnzbd_process = subprocess.getoutput("grep -i SABnzbd /tmp/ps.txt") nfs_process = subprocess.getoutput("grep -i nfsd /tmp/ps.txt") openvpn_process = subprocess.getoutput("grep -i openvpn /tmp/ps.txt") samba_process = subprocess.getoutput("grep -i smbd /tmp/ps.txt") inadyn_process = subprocess.getoutput("grep -i inadyn-mt /tmp/ps.txt") ushare_process = subprocess.getoutput("grep -i ushare /tmp/ps.txt") minidlna_process = subprocess.getoutput( "grep -i minidlnad /tmp/ps.txt") str = six.ensure_str(str) xtext1 = _(": \t Installed and running") + "\n" xtext2 = _(": \t Installed and not running") + "\n" if ftp_process: self.AboutText += _("FTP") + xtext1 else: self.AboutText += _("FTP") + xtext2 if telnetd_process: self.AboutText += _("Telnet") + xtext1 else: self.AboutText += _("Telnet") + xtext2 if ipv6_process == "0": self.AboutText += _("IPV6") + xtext1 else: self.AboutText += _("IPV6") + xtext2 if '-appletalk netatalk' in str: if afp_process: self.AboutText += _("Appletalk Netatalk") + xtext1 else: self.AboutText += _("Appletalk Netatalk") + xtext2 if 'sabnzbd3' in str: if sabnzbd_process: self.AboutText += _("SABnzbd") + xtext1 else: self.AboutText += _("SABnzbd") + xtext2 if '-nfs' in str: if nfs_process: self.AboutText += _("NFS") + xtext1 else: self.AboutText += _("NFS") + xtext2 if 'openvpn' in str: if openvpn_process: self.AboutText += _("OpenVPN") + xtext1 else: self.AboutText += _("OpenVPN") + xtext2 if '-smbfs-server' in str: if samba_process: self.AboutText += _("Samba") + xtext1 else: self.AboutText += _("Samba") + xtext2 if 'inadyn-mt' in str: if inadyn_process: self.AboutText += _("Inadyn") + xtext1 else: self.AboutText += _("Inadyn") + xtext2 if 'ushare' in str: if ushare_process: self.AboutText += _("uShare") + xtext1 else: self.AboutText += _("uShare") + xtext2 if 'minidlna' in str: if minidlna_process: self.AboutText += _("MiniDLNA") + xtext1 else: self.AboutText += _("MiniDLNA") + xtext2 self["AboutScrollLabel"].setText(self.AboutText) self["actions"] = ActionMap(["SetupActions", "ColorActions"], { "cancel": self.close, "ok": self.close, })
def __init__(self, session): Screen.__init__(self, session) self['actions'] = ActionMap(['OkCancelActions'], {'ok': self.okbuttonClick, 'cancel': self.close})
def __init__(self, session): Screen.__init__(self, session) self.setTitle(_("Translation")) # don't remove the string out of the _(), or it can't be "translated" anymore. # TRANSLATORS: Add here whatever should be shown in the "translator" about screen, up to 6 lines (use \n for newline) info = _("TRANSLATOR_INFO") if info == "TRANSLATOR_INFO": info = "(N/A)" infolines = _("").split("\n") infomap = {} for x in infolines: l = x.split(': ') if len(l) != 2: continue (type, value) = l infomap[type] = value #print infomap self["actions"] = ActionMap(["SetupActions"], { "cancel": self.close, "ok": self.close }) translator_name = infomap.get("Language-Team", "none") if translator_name == "none": translator_name = infomap.get("Last-Translator", "") self["TranslatorName"] = StaticText(translator_name) linfo = "" linfo += _("Translations Info") + ":" + "\n\n" linfo += _("Project") + ":" + infomap.get("Project-Id-Version", "") + "\n" linfo += _("Language") + ":" + infomap.get("Language", "") + "\n" print infomap.get("Language-Team", "") if infomap.get("Language-Team", "") == "" or infomap.get( "Language-Team", "") == "none": linfo += _("Language Team") + ":" + "n/a" + "\n" else: linfo += _("Language Team") + ":" + infomap.get( "Language-Team", "") + "\n" linfo += _("Last Translator") + ":" + translator_name + "\n" linfo += "\n" linfo += _("Source Charset") + ":" + infomap.get( "X-Poedit-SourceCharset", "") + "\n" linfo += _("Content Type") + ":" + infomap.get("Content-Type", "") + "\n" linfo += _("Content Encoding") + ":" + infomap.get( "Content-Transfer-Encoding", "") + "\n" linfo += _("MIME Version") + ":" + infomap.get("MIME-Version", "") + "\n" linfo += "\n" linfo += _("POT-Creation Date") + ":" + infomap.get( "POT-Creation-Date", "") + "\n" linfo += _("Revision Date") + ":" + infomap.get( "PO-Revision-Date", "") + "\n" linfo += "\n" linfo += _("Generator") + ":" + infomap.get("X-Generator", "") + "\n" if infomap.get("Report-Msgid-Bugs-To", "") != "": linfo += _("Report Msgid Bugs To") + ":" + infomap.get( "Report-Msgid-Bugs-To", "") + "\n" else: linfo += _("Report Msgid Bugs To") + ":" + "*****@*****.**" + "\n" self["AboutScrollLabel"] = ScrollLabel(linfo)
def __init__(self, session, action, value): self.imagedir = "/tmp/onDemandImg/" self.session = session self.action = action self.value = value self.url = "http://m.channel4.com/4od/tags" osdList = [] osdList.append((_("Search"), "search")) if self.action == "start": # Read the URL for the selected category on the Main Menu. try: (data, isUK) = wgetUrl(self.url) if data: soup = BeautifulSoup(data) categoriesSection = soup.find('section', id="categories") entries = categoriesSection.find('nav').findAll('a') pattern = u'/4od/tags/(.+)' for entry in entries: """ <section id="categories" class="clearfix"> <aside class="catNav clearfix"> <nav> <h2>Most popular</h2> <ul> <li class="active"> <span class="chevron"></span> <a href="/4od/tags/comedy">Comedy (100)</a> </li> </ul> <h2>More categories</h2> <ul> <li> <span class="chevron"></span> <a href="/4od/tags/animals">Animals (4)</a> </li> """ id = entry['href'] match = re.search(pattern, id, re.DOTALL | re.IGNORECASE) categoryName = match.group(1) label = six.text_type(entry.text).replace('\r\n', '') label = re.sub(' +', ' ', label) osdList.append((_(str(label)), str(categoryName))) except (Exception) as exception: print(__plugin__, __version__, 'StreamsMenu: Error parsing feed: ', exception) osdList.append((_("Back"), "exit")) Screen.__init__(self, session) self["fourODMainMenu"] = MenuList(osdList) self["myActionMap"] = ActionMap(["SetupActions"], { "ok": self.go, "cancel": self.cancel }, -1)
def __init__(self): self["helpActions"] = ActionMap(["HelpActions"], { "displayHelp": self.showHelp, }, prio=0) self["key_help"] = StaticText(_("HELP"))
def __init__(self, session): Screen.__init__(self, session) self.setTitle(_("About")) hddsplit = skin.parameters.get("AboutHddSplit", 0) bhVer = 'Black Hole' f = open('/etc/bhversion', 'r') bhVer = f.readline().strip() f.close() bhRev = '' f = open('/etc/bhrev', 'r') bhRev = f.readline().strip() f.close() driverdate = self.getDriverInstalledDate() if driverdate == 'unknown': driverdate = self.getDriverInstalledDate_proxy() self['DriverVersion'] = StaticText(_('DVB drivers: ') + driverdate) self['KernelVersion'] = StaticText( _('Kernel version: ') + self.getKernelVersionString()) self['FPVersion'] = StaticText('Support: [email protected]') self['CpuInfo'] = StaticText(_('CPU: ') + self.getCPUInfoString()) 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" self["ImageVersion"] = StaticText("Enigma: " + about.getEnigmaVersionString()) self["EnigmaVersion"] = StaticText("Firmware: " + bhVer + " " + bhRev) AboutText += _( "Enigma (re)starts: %d\n") % config.misc.startCounter.value GStreamerVersion = "GStreamer: " + about.getGStreamerVersionString( ).replace("GStreamer", "") self["GStreamerVersion"] = StaticText(GStreamerVersion) AboutText += GStreamerVersion + "\n" AboutText += _("DVB drivers: ") + about.getDriverInstalledDate() + "\n" AboutText += _( "Python version: ") + about.getPythonVersionString() + "\n" self["TunerHeader"] = StaticText(_("Detected NIMs:")) AboutText += "\n" + _("Detected NIMs:") + "\n" nims = nimmanager.nimList(showFBCTuners=False) 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 + "\n\n" + _("Network Info:") for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\n" + x[0] + ": " + x[1] 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): 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="", serviceref=None): Screen.__init__(self, session) self.menu_path = menu_path self["actions"] = ActionMap( ["OkCancelActions", "ColorActions"], { "ok": self.close, "cancel": self.close, "red": self.close, "green": self.ShowECMInformation, "yellow": self.ShowServiceInformation, "blue": self.ShowTransponderInformation }, -1) self["infolist"] = ServiceInfoList([]) self["key_red"] = self["red"] = Label(_("Exit")) self["key_green"] = self["green"] = Label(_("ECM Info")) self.transponder_info = self.info = self.feinfo = None play_service = session.nav.getCurrentlyPlayingServiceReference() if serviceref and not play_service and play_service != serviceref: screentitle = _("Transponder Information") self.type = TYPE_TRANSPONDER_INFO self.skinName = "ServiceInfoSimple" self.transponder_info = eServiceCenter.getInstance().info( serviceref).getInfoObject(serviceref, iServiceInformation.sTransponderData) # info is a iStaticServiceInformation, not a iServiceInformation else: screentitle = _("Service") self.type = TYPE_SERVICE_INFO service = session.nav.getCurrentService() if service: self.transponder_info = None self.info = service.info() self.feinfo = service.frontendInfo() if self.feinfo and not self.feinfo.getAll(True): self.feinfo = None serviceref = play_service self.transponder_info = serviceref and eServiceCenter.getInstance( ).info(serviceref).getInfoObject( serviceref, iServiceInformation.sTransponderData) if self.feinfo or self.transponder_info: self["actions2"] = ActionMap( ["ColorActions"], { "yellow": self.ShowServiceInformation, "blue": self.ShowTransponderInformation }, -1) self["key_yellow"] = self["yellow"] = Label( _("Service & PIDs")) self["key_blue"] = self["blue"] = Label( _("Tuner settings values")) else: self.skinName = "ServiceInfoSimple" if config.usage.show_menupath.value == 'large': self.menu_path += screentitle title = self.menu_path self["menu_path_compressed"] = StaticText("") self.menu_path += ' / ' elif config.usage.show_menupath.value == 'small': title = screentitle condtext = "" if self.menu_path and not self.menu_path.endswith(' / '): condtext = self.menu_path + " >" elif self.menu_path: condtext = self.menu_path[:-3] + " >" self["menu_path_compressed"] = StaticText(condtext) self.menu_path += screentitle + ' / ' else: title = screentitle self["menu_path_compressed"] = StaticText("") Screen.setTitle(self, title) tlist = [] self.onShown.append(self.ShowServiceInformation)
def __init__(self, session, service, zapFunc=None, eventid=None, bouquetChangeCB=None, serviceChangeCB=None, parent=None): Screen.__init__(self, session) self.bouquetChangeCB = bouquetChangeCB self.serviceChangeCB = serviceChangeCB self.ask_time = -1 #now self["key_red"] = StaticText("") self.closeRecursive = False self.saved_title = None self["Service"] = ServiceEvent() self["Event"] = Event() self.session = session self.Console = Console() if isinstance(service, str) and eventid is not None: self.type = EPG_TYPE_SIMILAR self.setTitle(_("Similar EPG")) self["key_yellow"] = StaticText() self["key_blue"] = StaticText() self["key_red"] = StaticText() self.currentService = service self.eventid = eventid self.zapFunc = None elif isinstance(service, eServiceReference) or isinstance( service, str): self.setTitle(_("Single EPG")) self.type = EPG_TYPE_SINGLE self["key_yellow"] = StaticText() self["key_blue"] = StaticText(_("Select Channel")) self.currentService = ServiceReference(service) self.zapFunc = zapFunc self.sort_type = 0 self.setSortDescription() else: self.setTitle(_("Multi EPG")) self.skinName = "EPGSelectionMulti" self.type = EPG_TYPE_MULTI if self.bouquetChangeCB == StaticText: self["key_yellow"] = StaticText( pgettext("button label, 'previous screen'", "Prev")) self["key_blue"] = StaticText( pgettext("button label, 'next screen'", "Next")) else: self["key_yellow"] = Button( pgettext("button label, 'previous screen'", "Prev")) self["key_blue"] = Button( pgettext("button label, 'next screen'", "Next")) self["now_button"] = Pixmap() self["next_button"] = Pixmap() self["more_button"] = Pixmap() self["now_button_sel"] = Pixmap() self["next_button_sel"] = Pixmap() self["more_button_sel"] = Pixmap() self["now_text"] = Label() self["next_text"] = Label() self["more_text"] = Label() self["date"] = Label() self.services = service self.zapFunc = zapFunc self.parent = parent if self.bouquetChangeCB == StaticText: self["key_green"] = StaticText(_("Add timer")) else: self["key_green"] = Button(_("Add timer")) self.key_green_choice = self.ADD_TIMER self.key_red_choice = self.EMPTY self["list"] = EPGList(type=self.type, selChangedCB=self.onSelectionChanged, timer=session.nav.RecordTimer) self["actions"] = ActionMap( ["EPGSelectActions", "OkCancelActions"], { "cancel": self.closeScreen, "ok": self.eventSelected, "timerAdd": self.timerAdd, "yellow": self.yellowButtonPressed, "blue": self.blueButtonPressed, "info": self.infoKeyPressed, "menu": self.furtherOptions, "nextBouquet": self.nextBouquet, # just used in multi epg yet "prevBouquet": self.prevBouquet, # just used in multi epg yet "nextService": self.nextService, # just used in single epg yet "prevService": self.prevService, # just used in single epg yet "preview": self.eventPreview, }) self['colouractions'] = HelpableActionMap( self, ["ColorActions"], {"red": (self.GoToTmbd, _("Search event in TMBD"))}) self.isTMBD = fileExists( resolveFilename(SCOPE_PLUGINS, "Extensions/TMBD/plugin.pyo")) or fileExists( resolveFilename(SCOPE_PLUGINS, "Extensions/TMBD/plugin.py")) if self.isTMBD: self["key_red"] = Button(_("Search TMBD")) self.select = True if not self.isTMBD: self["key_red"] = Button(_("TMBD Not Installed")) self.select = False try: from Plugins.Extensions.YTTrailer.plugin import baseEPGSelection__init__ description = _("Search yt-trailer for event") except ImportError as ie: pass else: if baseEPGSelection__init__ is not None: self["trailerActions"] = ActionMap( ["InfobarActions", "InfobarTeletextActions"], { "showTv": self.showTrailer, "showRadio": self.showTrailerList, "startTeletext": self.showConfig }) self["actions"].csel = self if parent and hasattr(parent, "fallbackTimer"): self.fallbackTimer = parent.fallbackTimer self.onLayoutFinish.append(self.onCreate) else: self.fallbackTimer = FallbackTimerList(self, self.onCreate)
def __init__(self, session, currentTitle, currentUrl, menulist=None): Screen.__init__(self, session) self.currentUrl = currentUrl self.currentTitle = currentTitle #Menu if menulist is None: self.menu = MenuList([ (_("Bookmarks"), self.MENU_BOOKMARKS), (_("History"), self.MENU_HISTORY), (_("Downloads"), self.MENU_DOWNLOADS), (_("Certificates"), self.MENU_CERTS), (_("Cookies"), self.MENU_COOKIES), (_("Settings"), self.MENU_SETTINGS), ], enableWrapAround=True) else: self.menu = MenuList(menulist, enableWrapAround=True) self["menu"] = self.menu self["statuslabel"] = Label("") self["statuslabel"].hide() #Color Buttons self["button_red"] = Boolean(False) self["button_green"] = Boolean(False) self["button_yellow"] = Boolean(False) self["button_blue"] = Boolean(False) self.red = Label("") self.green = Label("") self.yellow = Label("") self.blue = Label("") self["red"] = self.red self["green"] = self.green self["yellow"] = self.yellow self["blue"] = self.blue #Lists self.detailList = List([], enableWrapAround=True) self.detailConfigList = ConfigList([]) self.detailConfigList.l.setSeparation((BrowserMenu.width - 210) // 2) config.plugins.WebBrowser.storage.enabled.addNotifier( self.__cfgExpandableElementChanged, initial_call=False) config.plugins.WebBrowser.storage.enabled.addNotifier( self.__cfgStoragePathChanged, initial_call=False) config.plugins.WebBrowser.storage.path.addNotifier( self.__cfgStoragePathChanged, initial_call=False) self.detailInput = EnhancedInput() self["list"] = self.detailList self["config"] = self.detailConfigList self["input"] = self.detailInput self["line"] = CanvasSource() self.__cfgCreateSetup() self.__db = BrowserDB.getInstance() self.__curMenu = self.MENU_BOOKMARKS self.__bmList = None self.__hisList = None self.__crtList = None self.__ckList = None self.__bmNeedle = "" self.__bmFilterTimer = eTimer() self.__bmFilterTimer_conn = self.__bmFilterTimer.timeout.connect( self.__bmFilterCB) self.__hisNeedle = "" self.__hisFilterTimer = eTimer() self.__hisFilterTimer_conn = self.__hisFilterTimer.timeout.connect( self.__hisFilterCB) self.__dlRefreshTimer = eTimer() self.__dlRefreshTimer_conn = self.__dlRefreshTimer.timeout.connect( self.__dlBuildList) self.__statusTimer = eTimer() self.__statusTimer_conn = self.__statusTimer.timeout.connect( self.__hideStatus) self.__actions = [] self.onFirstExecBegin.append(self.__drawSeparator) self.onFirstExecBegin.append(self.__onMenuChanged) self.onExecBegin.append(self.__reloadData) self.onShow.append(self.setKeyboardModeAscii) self["actions"] = ActionMap( ["BrowserActions", "ColorActions"], { "ok": self.__actionOk, "enter": self.__actionOk, "exit": self.__actionExit, "pageUp": self.__actionMenuUp, "pageDown": self.__actionMenuDown, "up": boundFunction(self.__action, "up"), "down": boundFunction(self.__action, "down"), "left": boundFunction(self.__action, "left"), "right": boundFunction(self.__action, "right"), "red": boundFunction(self.__action, "red"), "green": boundFunction(self.__action, "green"), "yellow": boundFunction(self.__action, "yellow"), "blue": boundFunction(self.__action, "blue"), "backspace": boundFunction(self.__action, "backspace"), "delete": boundFunction(self.__action, "delete"), "ascii": boundFunction(self.__action, "ascii"), # TODO "text" : self.__text }, -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 }, -2) self.__actionFuncs = { self.MENU_BOOKMARKS: { "up": self.detailList.selectPrevious, "down": self.detailList.selectNext, "left": self.detailList.selectPrevious, "right": self.detailList.pageDown, "ok": self.__bmOk, "enter": self.__bmOk, "red": self.__bmDelete, "green": self.__bmAdd, "yellow": self.__bmEdit, "blue": self.__bmSetCurrentAsHome, "backspace": self.__bmKeyBackspace, "delete": self.__bmKeyDelete, "ascii": self.__bmKeyAscii, }, self.MENU_HISTORY: { "up": self.detailList.selectPrevious, "down": self.detailList.selectNext, "left": self.detailList.pageUp, "right": self.detailList.pageDown, "ok": self.__hisOk, "enter": self.__hisOk, "red": self.__hisClear, "blue": self.__hisSetCurrentAsHome, "backspace": self.__hisKeyBackspace, "delete": self.__hisKeyDelete, "ascii": self.__hisKeyAscii, }, self.MENU_SETTINGS: { "up": self.__cfgKeyUp, "down": self.__cfgKeyDown, "left": self.__cfgKeyLeft, "right": self.__cfgKeyRight, "ok": self.__cfgKeyOK, "enter": self.__cfgKeyOK, "red": self.__cfgCancel, "green": self.__cfgSave, "backspace": self.__cfgKeyBackspace, "delete": self.__cfgKeyDelete, "ascii": self.__cfgKeyAscii, }, self.MENU_DOWNLOADS: { "up": self.detailList.selectPrevious, "down": self.detailList.selectNext, "left": self.detailList.pageUp, "right": self.detailList.pageDown, "red": self.__dlAbort, }, self.MENU_CERTS: { "up": self.detailList.selectPrevious, "down": self.detailList.selectNext, "left": self.detailList.pageUp, "right": self.detailList.pageDown, "red": self.__crtDelete, "green": self.__crtDetails, }, self.MENU_COOKIES: { "up": self.detailList.selectPrevious, "down": self.detailList.selectNext, "left": self.detailList.pageUp, "right": self.detailList.pageDown, "red": self.__ckDelete, "blue": self.__ckDeleteAll, } }
def __init__(self, session, args=0): print("[MakeBouquet][__init__] Starting...") print("[MakeBouquet][__init__] args", args) self.session = session Screen.__init__(self, session) Screen.setTitle(self, _("MakeBouquet")) self.skinName = ["TerrestrialScan"] self.path = "/etc/enigma2" self.services_dict = {} self.tmp_services_dict = {} self.namespace_dict = { } # to store namespace when sub network is enabled self.logical_channel_number_dict = {} self.ignore_visible_service_flag = False # make this a user override later if found necessary self.VIDEO_ALLOWED_TYPES = [1, 4, 5, 17, 22, 24, 25, 27, 135] self.AUDIO_ALLOWED_TYPES = [2, 10] self.BOUQUET_PREFIX = "userbouquet.TerrestrialScan." self.bouquetsIndexFilename = "bouquets.tv" self.bouquetFilename = self.BOUQUET_PREFIX + "tv" self.bouquetName = _('Terrestrial') self.namespace_complete_terrestrial = not ( config.usage.subnetwork_terrestrial.value if hasattr( config.usage, "subnetwork_terrestrial") else True ) # config.usage.subnetwork not available in all images self.terrestrialXmlFilename = "terrestrial.xml" self.frontend = None self.rawchannel = None self["background"] = Pixmap() self["action"] = Label(_("Starting scanner")) self["status"] = Label("") self["progress"] = ProgressBar() self["progress_text"] = Progress() self["tuner_text"] = Label("") self["Frontend"] = FrontendStatus( frontend_source=lambda: self.frontend, update_interval=100) self["actions"] = ActionMap(["SetupActions"], { "cancel": self.keyCancel, }, -2) self.selectedNIM = -1 self.transponders_unique = {} self.FTA_only = False self.makebouquet = True self.makexmlfile = False self.lcndescriptor = 0x83 self.channel_list_id = 0 if args: if "feid" in args: self.selectedNIM = args["feid"] if "transponders_unique" in args: self.transponders_unique = args["transponders_unique"] if "FTA_only" in args: self.FTA_only = args["FTA_only"] if "makebouquet" in args: self.makebouquet = args["makebouquet"] if "makexmlfile" in args: self.makexmlfile = args["makexmlfile"] if "lcndescriptor" in args: self.lcndescriptor = args["lcndescriptor"] if "channel_list_id" in args: self.channel_list_id = args["channel_list_id"] self.tsidOnidKeys = list(self.transponders_unique.keys()) self.index = 0 self.lockTimeout = 50 # 100ms for tick - 5 sec self.onClose.append(self.__onClose) self.onFirstExecBegin.append(self.firstExec)
def __init__(self, session, text, type = TYPE_YESNO, timeout = -1, close_on_any_key = False, default = True, enable_input = True, msgBoxID = None, picon = None, simple = False, wizard = False, list = []): self.type = type Screen.__init__(self, session) if wizard: from Components.config import config, ConfigInteger from Components.Pixmap import MultiPixmap self["rc"] = MultiPixmap() self["rc"].setPixmapNum(config.misc.rcused.value) self.skinName = ["MessageBoxWizard"] if simple: self.skinName="MessageBoxSimple" self.msgBoxID = msgBoxID self["text"] = Label(_(text)) self["Text"] = StaticText(_(text)) self["selectedChoice"] = StaticText() self.text = _(text) self.close_on_any_key = close_on_any_key self["ErrorPixmap"] = Pixmap() self["QuestionPixmap"] = Pixmap() self["InfoPixmap"] = Pixmap() self.timerRunning = False self.initTimeout(timeout) picon = picon or type if picon != self.TYPE_ERROR: self["ErrorPixmap"].hide() if picon != self.TYPE_YESNO: self["QuestionPixmap"].hide() if picon != self.TYPE_INFO: self["InfoPixmap"].hide() self.messtype = type if type == self.TYPE_YESNO: if list: self.list = list elif default == True: self.list = [ (_("yes"), True), (_("no"), False) ] else: self.list = [ (_("no"), False), (_("yes"), True) ] else: self.list = [] self["list"] = MenuList(self.list) if self.list: self["selectedChoice"].setText(self.list[0][0]) else: self["list"].hide() if enable_input: self["actions"] = ActionMap(["MsgBoxActions", "DirectionActions"], { "cancel": self.cancel, "ok": self.ok, "alwaysOK": self.alwaysOK, "up": self.up, "down": self.down, "left": self.left, "right": self.right, "upRepeated": self.up, "downRepeated": self.down, "leftRepeated": self.left, "rightRepeated": self.right }, -1)
def __init__(self, session, text, type=TYPE_YESNO, timeout=-1, close_on_any_key=False, default=True, enable_input=True, msgBoxID=None, picon=None, simple=False, list=[], timeout_default=None): self.type = type Screen.__init__(self, session) self.setScreenPathMode(None) if simple: self.skinName = "MessageBoxSimple" self.msgBoxID = msgBoxID self["text"] = Label(text) self["Text"] = StaticText(text) self["selectedChoice"] = StaticText() self.text = text self.close_on_any_key = close_on_any_key self.timeout_default = timeout_default self["ErrorPixmap"] = Pixmap() self["QuestionPixmap"] = Pixmap() self["InfoPixmap"] = Pixmap() self["WarningPixmap"] = Pixmap() self.timerRunning = False self.initTimeout(timeout) picon = picon or type if picon is not self.TYPE_ERROR: self["ErrorPixmap"].hide() if picon is not self.TYPE_YESNO: self["QuestionPixmap"].hide() if picon is not self.TYPE_INFO: self["InfoPixmap"].hide() if picon != self.TYPE_WARNING: self["WarningPixmap"].hide() self.title = self.type < self.TYPE_MESSAGE and [ _("Question"), _("Information"), _("Warning"), _("Error") ][self.type] or _("Message") if type is self.TYPE_YESNO: if list: self.list = list elif default == True: self.list = [(_("yes"), True), (_("no"), False)] else: self.list = [(_("no"), False), (_("yes"), True)] else: self.list = [] self["list"] = MenuList(self.list) if self.list: self["selectedChoice"].setText(self.list[0][0]) else: self["list"].hide() if enable_input: self["actions"] = ActionMap( ["MsgBoxActions", "DirectionActions"], { "cancel": self.cancel, "ok": self.ok, "alwaysOK": self.alwaysOK, "up": self.up, "down": self.down, "left": self.left, "right": self.right, "upRepeated": self.up, "downRepeated": self.down, "leftRepeated": self.left, "rightRepeated": self.right }, -1) self.setTitle(self.title)
def __init__(self, session): Screen.__init__(self, session) self.skinName = ["SeriesPluginConfiguration"] from plugin import NAME, VERSION self.setup_title = NAME + " " + _("Configuration") + " " + VERSION log.debug("SeriesPluginConfiguration") self.onChangedEntry = [] # Buttons self["key_red"] = Button(_("Cancel")) self["key_green"] = Button(_("OK")) self["key_blue"] = Button(_("Show Log")) self["key_yellow"] = Button(_("Channel Edit")) # Define Actions self["actions"] = ActionMap( ["SetupActions", "ChannelSelectBaseActions", "ColorActions"], { "cancel": self.keyCancel, "save": self.keySave, "nextBouquet": self.pageUp, "prevBouquet": self.pageDown, "blue": self.showLog, "yellow": self.openChannelEditor, "ok": self.keyOK, "left": self.keyLeft, "right": self.keyRight, }, -2) # higher priority stopIndependent() #resetInstance() self.seriesPlugin = getInstance() # Create temporary identifier config elements identifiers = self.seriesPlugin.modules identifiers_elapsed = [ k for k, v in identifiers.items() if v.knowsElapsed() ] identifiers_today = [ k for k, v in identifiers.items() if v.knowsToday() ] identifiers_future = [ k for k, v in identifiers.items() if v.knowsFuture() ] if config.plugins.seriesplugin.identifier_elapsed.value in identifiers_elapsed: self.cfg_identifier_elapsed = NoSave( ConfigSelection(choices=identifiers_elapsed, default=config.plugins.seriesplugin. identifier_elapsed.value)) else: self.cfg_identifier_elapsed = NoSave( ConfigSelection(choices=identifiers_elapsed, default=identifiers_elapsed[0])) self.changesMade = True if config.plugins.seriesplugin.identifier_today.value in identifiers_today: self.cfg_identifier_today = NoSave( ConfigSelection(choices=identifiers_today, default=config.plugins.seriesplugin. identifier_today.value)) else: self.cfg_identifier_today = NoSave( ConfigSelection(choices=identifiers_today, default=identifiers_today[0])) self.changesMade = True if config.plugins.seriesplugin.identifier_future.value in identifiers_future: self.cfg_identifier_future = NoSave( ConfigSelection(choices=identifiers_future, default=config.plugins.seriesplugin. identifier_future.value)) else: self.cfg_identifier_future = NoSave( ConfigSelection(choices=identifiers_future, default=identifiers_future[0])) self.changesMade = True # Load patterns patterns_file = readFilePatterns() self.cfg_pattern_title = NoSave( ConfigSelection( choices=patterns_file, default=config.plugins.seriesplugin.pattern_title.value)) self.cfg_pattern_description = NoSave( ConfigSelection( choices=patterns_file, default=config.plugins.seriesplugin.pattern_description.value)) #self.cfg_pattern_record = NoSave( ConfigSelection(choices = patterns_file, default = config.plugins.seriesplugin.pattern_record.value ) ) patterns_directory = readDirectoryPatterns() self.cfg_pattern_directory = NoSave( ConfigSelection( choices=patterns_directory, default=config.plugins.seriesplugin.pattern_directory.value)) bouquetList = [("", "")] tvbouquets = getTVBouquets() for bouquet in tvbouquets: bouquetList.append((bouquet[1], bouquet[1])) self.cfg_bouquet_main = NoSave( ConfigSelection( choices=bouquetList, default=config.plugins.seriesplugin.bouquet_main.value or str(list(zip(*bouquetList)[1])))) checkList(self.cfg_pattern_title) checkList(self.cfg_pattern_description) checkList(self.cfg_pattern_directory) checkList(self.cfg_bouquet_main) self.changesMade = False # Initialize Configuration self.list = [] self.buildConfig() ConfigListScreen.__init__(self, self.list, session=session, on_change=self.changed) self.changed() self.onLayoutFinish.append(self.layoutFinished)
def __init__(self, session, params={}): # params: vk_title, movie_title printDBG("IPTVSubDownloaderWidget.__init__ desktop IPTV_VERSION[%s]\n" % (IPTVSubDownloaderWidget.IPTV_VERSION) ) self.session = session path = GetSkinsDir(config.plugins.iptvplayer.skin.value) + "/subplaylist.xml" if os_path.exists(path): try: with open(path, "r") as f: self.skin = f.read() f.close() except Exception: printExc("Skin read error: " + path) Screen.__init__(self, session) self["key_red"] = StaticText(_("Cancel")) self["list"] = IPTVMainNavigatorList() self["list"].connectSelChanged(self.onSelectionChanged) self["statustext"] = Label("Loading...") self["actions"] = ActionMap(["IPTVPlayerListActions", "WizardActions", "DirectionActions", "ColorActions", "NumberActions"], { "red" : self.red_pressed, "green" : self.green_pressed, "yellow" : self.yellow_pressed, "blue" : self.blue_pressed, "ok" : self.ok_pressed, "back" : self.back_pressed, }, -1) self["headertext"] = Label() self["console"] = Label() self["sequencer"] = Label() try: for idx in range(5): spinnerName = "spinner" if idx: spinnerName += '_%d' % idx self[spinnerName] = Cover3() except Exception: printExc() self.spinnerPixmap = [LoadPixmap(GetIconDir('radio_button_on.png')), LoadPixmap(GetIconDir('radio_button_off.png'))] self.showHostsErrorMessage = True self.onClose.append(self.__onClose) #self.onLayoutFinish.append(self.onStart) self.onShow.append(self.onStart) #Defs self.params = dict(params) self.params['discover_info'] = self.discoverInfoFromTitle() self.params['movie_url'] = strwithmeta(self.params.get('movie_url', '')) self.params['url_params'] = self.params['movie_url'].meta self.movieTitle = self.params['discover_info']['movie_title'] self.workThread = None self.host = None self.hostName = '' self.nextSelIndex = 0 self.currSelIndex = 0 self.prevSelList = [] self.categoryList = [] self.currList = [] self.currItem = CDisplayListItem() self.visible = True ################################################################# # Inits for Proxy Queue ################################################################# # register function in main Queue if None == asynccall.gMainFunctionsQueueTab[1]: asynccall.gMainFunctionsQueueTab[1] = asynccall.CFunctionProxyQueue(self.session) asynccall.gMainFunctionsQueueTab[1].clearQueue() asynccall.gMainFunctionsQueueTab[1].setProcFun(self.doProcessProxyQueueItem) #main Queue self.mainTimer = eTimer() self.mainTimer_conn = eConnectCallback(self.mainTimer.timeout, self.processProxyQueue) # every 100ms Proxy Queue will be checked self.mainTimer_interval = 100 self.mainTimer.start(self.mainTimer_interval, True) # spinner timer self.spinnerTimer = eTimer() self.spinnerTimer_conn = eConnectCallback(self.spinnerTimer.timeout, self.updateSpinner) self.spinnerTimer_interval = 200 self.spinnerEnabled = False ################################################################# self.downloadedSubItems = []
def __init__(self, session): Screen.__init__(self, session) self.skinName = "Standby" self.avswitch = AVSwitch() print "[Standby] enter standby" SystemInfo["StandbyState"] = True if os.path.exists("/usr/script/StandbyEnter.sh"): Console().ePopen("/usr/script/StandbyEnter.sh &") self["actions"] = ActionMap( [ "StandbyActions" ], { "power": self.Power, "power_make": self.Power_make, "power_break": self.Power_break, "power_long": self.Power_long, "power_repeat": self.Power_repeat, "discrete_on": self.Power }, -1) globalActionMap.setEnabled(False) self.ignoreKeyBreakTimer = eTimer() self.standbyStopServiceTimer = eTimer() self.standbyStopServiceTimer.callback.append(self.stopService) self.timeHandler = None #mute adc self.setMute() if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]: # set LCDminiTV off setLCDModeMinitTV("0") self.paused_service = None self.prev_running_service = None self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup() service = self.prev_running_service and self.prev_running_service.toString() if service: if service.startswith("1:") and service.rsplit(":", 1)[1].startswith("/"): self.paused_service = self.session.current_dialog 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: from Screens.InfoBar import InfoBar InfoBar.instance and hasattr(InfoBar.instance, "showPiP") and InfoBar.instance.showPiP() #set input to vcr scart if SystemInfo["ScartSwitch"]: self.avswitch.setInput("SCART") else: self.avswitch.setInput("AUX") if (getBrandOEM() in ('fulan','clap','dinobot') or getMachineBuild() in ('gbmv200','sf8008','ustym4kpro','beyonwizv2','viper4k') or about.getChipSetString() in ('ali3505')): try: open("/proc/stb/hdmi/output", "w").write("off") except: pass if int(config.usage.hdd_standby_in_standby.value) != -1: # HDD standby timer value (box in standby) / -1 = same as when box is active for hdd in harddiskmanager.HDDList(): hdd[1].setIdleTime(int(config.usage.hdd_standby_in_standby.value)) self.onFirstExecBegin.append(self.__onFirstExecBegin) self.onClose.append(self.__onClose)
def __init__(self, session, title = '', text = ''): Screen.__init__(self, session) self.skin = TecladoVirtualA.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'], [u'q', u'w', u'e', u'r', u't', u'y', 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'z', u'x', u'c', u'v', u'b', u'n', u'm', 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, dvd_device=None, dvd_filelist=[], args=None): 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) 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["DVDPlayerColorActions"] = HelpableActionMap( self, "ColorActions", { "blue": (self.chapterZap, _("jump to chapter by number")), }, -2) 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, title = '', text = ''): Screen.__init__(self, session) self.skin = Teclado_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): Screen.__init__(self, session) HelpableScreen.__init__(self) self.list = [] # Summary self.setup_title = _("EPGRefresh Configuration") self.onChangedEntry = [] self.session = session # Although EPGRefresh keeps services in a Set we prefer a list self.services = ( [x for x in epgrefresh.services[0]], [x for x in epgrefresh.services[1]] ) ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changed) self._getConfig() self["config"].onSelectionChanged.append(self.updateHelp) # Initialize Buttons self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("OK")) self["key_yellow"] = StaticText(_("Functions")) self["key_blue"] = StaticText(_("Edit Services")) self["help"] = self["description"] = StaticText() # Define Actions self["ColorActions"] = HelpableActionMap(self, "ColorActions", { "yellow": (self.showFunctionMenu, _("Show more Functions")), "blue": (self.editServices, _("Edit Services")), } ) self["actions"] = HelpableActionMap(self, "ChannelSelectEPGActions", { "showEPGList": (self.keyInfo, _("Show last EPGRefresh - Time")), } ) self["ChannelSelectBaseActions"] = HelpableActionMap(self, "ChannelSelectBaseActions", { "nextBouquet": (self.pageup, _("Move page up")), "prevBouquet": (self.pagedown, _("Move page down")), } ) self["actionstmp"] = ActionMap(["HelpActions"], { "displayHelp": self.showHelp, } ) self["SetupActions"] = HelpableActionMap(self, "SetupActions", { "cancel": (self.keyCancel, _("Close and forget changes")), "save": (self.keySave, _("Close and save changes")), } ) # Trigger change self.changed() self.needsEnigmaRestart = False self.ServicesChanged = False self.onLayoutFinish.append(self.setCustomTitle) self.onFirstExecBegin.append(self.firstExec) self["config"].isChanged = self._ConfigisChanged
def __init__(self, session, title = '', text = '', imagen=''): Screen.__init__(self, session) self.skin = '\n\t<screen name="TecladoVirtualPlusdede" position="center,center" size="560,425" zPosition="99" title="Escribe los numeros: " flags="wfNoBorder">\n\t\t<ePixmap name="imagen" position="10,335" zPosition="0" size="348,111" pixmap="' + imagen + '" transparent="1" alphatest="on" />\n\t\t<ePixmap pixmap="skin_default/vkey_text.png" position="9,35" zPosition="-4" size="542,52" alphatest="on" />\n\t\t<widget name="header" position="10,10" size="500,20" font="Regular;20" transparent="1" noWrap="1" />\n\t\t<widget name="text" position="12,35" size="536,44" font="Regular;40" transparent="1" noWrap="1" halign="right" />\n\t\t<widget name="list" position="10,100" size="540,225" selectionDisabled="1" transparent="0" />\n\t</screen>' #self.skin = TecladoVirtualPlusdede.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'], [u'q', u'w', u'e', u'r', u't', u'y', 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'z', u'x', u'c', u'v', u'b', u'n', u'm', 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): Screen.__init__(self, session) hddsplit = skin.parameters.get("AboutHddSplit", 0) #AboutHddSplit = 0 #try: # hddsplit = skin.parameters.get("AboutHddSplit",(0))[0] #except: # hddsplit = AboutHddSplit if boxtype == 'gb800solo': BoxName = "GigaBlue HD 800SOLO" elif boxtype == 'gb800se': BoxName = "GigaBlue HD 800SE" elif boxtype == 'gb800ue': BoxName = "GigaBlue HD 800UE" elif boxtype == 'gbquad': BoxName = "GigaBlue Quad" elif boxtype == 'gbquad4k': BoxName = "GigaBlue Quad 4k" elif boxtype == 'gbue4k': BoxName = "GigaBlue UE 4k" elif boxtype == 'gbquadplus': BoxName = "GigaBlue HD Quadplus" elif boxtype == 'gb800seplus': BoxName = "GigaBlue HD 800SEplus" elif boxtype == 'gb800ueplus': BoxName = "GigaBlue HD 800UEplus" elif boxtype == 'gbipbox': BoxName = "GigaBlue IP Box" elif boxtype == 'gbultra': BoxName = "GigaBlue HD Ultra" elif boxtype == 'gbultraue': BoxName = "GigaBlue HD Ultra UE" elif boxtype == 'gbultraueh': BoxName = "GigaBlue HD Ultra UEh" elif boxtype == 'gbultrase': BoxName = "GigaBlue HD Ultra SE" elif boxtype == 'gbx1': BoxName = "GigaBlue X1" elif boxtype == 'gbx2': BoxName = "GigaBlue X2" elif boxtype == 'gbx3': BoxName = "GigaBlue X3" elif boxtype == 'gbx3h': BoxName = "GigaBlue X3h" elif boxtype == 'spycat': BoxName = "XCORE Spycat" elif boxtype == 'quadbox2400': BoxName = "AX Quadbox HD2400" else: BoxName = about.getHardwareTypeString() self.setTitle(_("About") + " " + BoxName) ImageType = about.getImageTypeString() self["ImageType"] = StaticText(ImageType) Boxserial = popen('cat /proc/stb/info/sn').read().strip() serial = "" if Boxserial != "": serial = ":Serial : " + Boxserial AboutHeader = _("About") + " " + BoxName self["AboutHeader"] = StaticText(AboutHeader) AboutText = BoxName + " - " + ImageType + serial + "\n" #AboutText += _("Hardware: ") + about.getHardwareTypeString() + "\n" #AboutText += _("CPU: ") + about.getCPUInfoString() + "\n" #AboutText += _("Installed: ") + about.getFlashDateString() + "\n" #AboutText += _("Image: ") + about.getImageTypeString() + "\n" CPUinfo = _("CPU: ") + about.getCPUInfoString() self["CPUinfo"] = StaticText(CPUinfo) AboutText += CPUinfo + "\n" CPUspeed = _("Speed: ") + about.getCPUSpeedString() self["CPUspeed"] = StaticText(CPUspeed) #AboutText += "(" + about.getCPUSpeedString() + ")\n" ChipsetInfo = _("Chipset: ") + about.getChipSetString() self["ChipsetInfo"] = StaticText(ChipsetInfo) AboutText += ChipsetInfo + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" else: fp_version = _("Frontprocessor version: %s") % fp_version #AboutText += fp_version +"\n" self["FPVersion"] = StaticText(fp_version) AboutText += "\n" KernelVersion = _("Kernel version: ") + about.getKernelVersionString() self["KernelVersion"] = StaticText(KernelVersion) AboutText += KernelVersion + "\n" if getMachineBuild() == 'gb7252': b = popen('cat /proc/stb/info/version').read().strip() driverdate = str(b[0:4] + '-' + b[4:6] + '-' + b[6:8] + ' ' + b[8:10] + ':' + b[10:12] + ':' + b[12:14]) AboutText += _("DVB drivers: ") + driverdate + "\n" else: AboutText += _("DVB drivers: ") + self.realDriverDate() + "\n" #AboutText += _("DVB drivers: ") + about.getDriverInstalledDate() + "\n" ImageVersion = _("Last upgrade: ") + about.getImageVersionString() self["ImageVersion"] = StaticText(ImageVersion) AboutText += ImageVersion + "\n" EnigmaVersion = _( "GUI Build: ") + about.getEnigmaVersionString() + "\n" self["EnigmaVersion"] = StaticText(EnigmaVersion) #AboutText += EnigmaVersion #AboutText += _("Enigma (re)starts: %d\n") % config.misc.startCounter.value FlashDate = _("Flashed: ") + about.getFlashDateString() self["FlashDate"] = StaticText(FlashDate) AboutText += FlashDate + "\n" EnigmaSkin = _("Skin: ") + config.skin.primary_skin.value[0:-9] self["EnigmaSkin"] = StaticText(EnigmaSkin) AboutText += EnigmaSkin + "\n" AboutText += _( "Python version: ") + about.getPythonVersionString() + "\n" GStreamerVersion = _("GStreamer: ") + about.getGStreamerVersionString( ).replace("GStreamer", "") self["GStreamerVersion"] = StaticText(GStreamerVersion) AboutText += GStreamerVersion + "\n" twisted = popen('opkg list-installed |grep -i python-twisted-core' ).read().strip().split(' - ')[1] AboutText += "Python-Twisted: " + str(twisted) + "\n" AboutText += "\n" self["TunerHeader"] = StaticText(_("Detected NIMs:")) #AboutText += _("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" #AboutText += _("Detected HDD:") + "\n" hddlist = harddiskmanager.HDDList() hddinfo = "" if hddlist: formatstring = hddsplit and "%s:%s, %.1f %sB %s" or "%s:(%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 #AboutText += "\n\n" + _("Network Info") #for x in about.GetIPsFromNetworkInterfaces(): # AboutText += "\n" + iNetwork.getFriendlyAdapterDescription(x[0]) + " :" + "/dev/" + x[0] + " " + x[1] self["AboutScrollLabel"] = ScrollLabel(AboutText) self["key_green"] = Button(_("Translations")) self["key_red"] = Button(_("Latest Commits")) self["key_yellow"] = Button(_("Troubleshoot")) self["key_blue"] = Button(_("Memory Info")) self["key_info"] = Button(_("Contact Info")) self["actions"] = ActionMap( ["ColorActions", "SetupActions", "DirectionActions"], { "cancel": self.close, "ok": self.close, "red": self.showCommits, "green": self.showTranslationInfo, "blue": self.showMemoryInfo, "info": self.showContactInfo, "yellow": self.showTroubleshoot, "up": self["AboutScrollLabel"].pageUp, "down": self["AboutScrollLabel"].pageDown })
def __init__(self, session, args=None): Screen.__init__(self, session) self.session = session self.Scale = AVSwitch().getFramebufferScale() self.PicLoad = ePicLoad() self["helperimage"] = Pixmap() self["helpertext"] = Label() self["titleText"] = StaticText("") self["titleText"].setText(_("MyMetrixLite")) self["cancelBtn"] = StaticText("") self["cancelBtn"].setText(_("Cancel")) self["applyBtn"] = StaticText("") self["applyBtn"].setText(_("Apply changes")) ActivateSkinSettings().initConfigs() self["actions"] = ActionMap( [ "OkCancelActions", "DirectionActions", "InputActions", "ColorActions" ], { "ok": self.ok, "red": self.exit, "green": self.applyChanges, "cancel": self.exit }, -1) list = [] list.append(MenuEntryItem(_("Font settings"), "FONT", _("helptext"))) list.append(MenuEntryItem(_("Color settings"), "COLOR", _("helptext"))) list.append( MenuEntryItem( _("Weather settings"), "WEATHER", _("Powered by\n-----------------\nmsn weather\n(https://www.msn.com)\nand\nOpenWeatherMap\n(https://openweathermap.org)" ))) list.append(MenuEntryItem(_("Other settings"), "OTHER", _("helptext"))) if path.isfile( "/usr/lib/enigma2/python/Plugins/Extensions/MyMetrixLite/DesignSettings.py" ): from DesignSettingsView import DesignSettingsView list.append( MenuEntryItem(_("Design settings"), "DESIGN", _("helptext"))) list.append( MenuEntryItem(_("Skinpart settings"), "SKINPART", _("helptext"))) list.append("") list.append( MenuEntryItem(_("Backup & Restore my settings"), "BACKUP", _("helptext"))) self["menuList"] = MainMenuList([], font0=24, font1=16, itemHeight=50) self["menuList"].l.setList(list) if not self.selectionChanged in self["menuList"].onSelectionChanged: self["menuList"].onSelectionChanged.append(self.selectionChanged) self.onChangedEntry = [] self.onLayoutFinish.append(self.UpdatePicture) self.checkEHDsettingsTimer = eTimer() self.checkEHDsettingsTimer.callback.append(self.checkEHDsettings) self.checkEHDsettingsTimer.start(1000, True)
def __init__(self, session): Screen.__init__(self, session) self.setTitle(_("About")) OpenNFRVersion = _("OpenNFR %s") % about.getImageVersionString() self["OpenNFRVersion"] = Label(OpenNFRVersion) AboutText = _("Model:\t\t%s %s\n") % (getMachineBrand(), getMachineName()) bootloader = "" if path.exists('/sys/firmware/devicetree/base/bolt/tag'): f = open('/sys/firmware/devicetree/base/bolt/tag', 'r') bootloader = f.readline().replace('\x00', '').replace('\n', '') f.close() AboutText += _("Bootloader:\t\t%s\n") % (bootloader) if path.exists('/proc/stb/info/chipset'): AboutText += _( "Chipset:\t\tBCM%s") % about.getChipSetString() + "\n" cpuMHz = "" if getMachineBuild() in ('u41', 'u42', 'u43'): cpuMHz = _(" (1.0 GHz)") elif getMachineBuild() in ('dags72604', 'vusolo4k', 'vuultimo4k', 'vuzero4k', 'gb72604'): cpuMHz = " (1,5 GHz)" elif getMachineBuild() in ('formuler1', 'triplex'): cpuMHz = " (1,3 GHz)" elif getMachineBuild() in ('gbmv200', 'plus', 'u51', 'u5', 'u53', 'u52', 'u54', 'u55', 'u56', 'u57', 'u5pvr', 'h9', 'h9combo', 'cc1', 'sf8008', 'hd60', 'hd61', 'i55plus', 'ustym4kpro', 'v8plus', 'multibox'): cpuMHz = " (1,6 GHz)" elif getMachineBuild() in ('vuuno4k', 'vuultimo4k', 'gb7252', 'dags7252', '8100s'): cpuMHz = " (1,7 GHz)" elif getMachineBuild() in ('alien5', 'hzero', 'h8'): cpuMHz = " (2,0 GHz)" elif getMachineBuild() in ('vuduo4k'): cpuMHz = _(" (2.1 GHz)") elif getMachineBuild() in ('sf5008', 'et13000', 'et1x000', 'hd52', 'hd51', 'sf4008', 'vs1500', 'h7', 'osmio4k', 'osmio4kplus', 'osmini4k'): try: import binascii f = open( '/sys/firmware/devicetree/base/cpus/cpu@0/clock-frequency', 'rb') clockfrequency = f.read() f.close() cpuMHz = " (%s MHz)" % str( round( int(binascii.hexlify(clockfrequency), 16) / 1000000, 1)) except: cpuMHz = " (1,7 GHz)" else: if path.exists('/proc/cpuinfo'): f = open('/proc/cpuinfo', 'r') temp = f.readlines() f.close() try: for lines in temp: lisp = lines.split(': ') if lisp[0].startswith('cpu MHz'): #cpuMHz = " (" + lisp[1].replace('\n', '') + " MHz)" cpuMHz = " (" + str( int(float(lisp[1].replace('\n', '')))) + " MHz)" break except: pass AboutText += _("CPU:\t\t%s") % about.getCPUString() + cpuMHz + "\n" AboutText += _("Cores:\t\t%s") % about.getCpuCoresString() + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/sensors/temp/value'): f = open('/proc/stb/sensors/temp/value', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: AboutText += _("System temperature:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + SIGN + "C\n" tempinfo = "" if path.exists('/proc/stb/fp/temp_sensor_avs'): f = open('/proc/stb/fp/temp_sensor_avs', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/power/avs'): f = open('/proc/stb/power/avs', 'r') tempinfo = f.read() f.close() elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'): try: f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r') tempinfo = f.read() tempinfo = tempinfo[:-4] f.close() except: tempinfo = "" elif path.exists('/proc/hisi/msp/pm_cpu'): try: for line in open('/proc/hisi/msp/pm_cpu').readlines(): line = [x.strip() for x in line.strip().split(":")] if line[0] in ("Tsensor"): temp = line[1].split("=") temp = line[1].split(" ") tempinfo = temp[2] except: tempinfo = "" if tempinfo and int(tempinfo.replace('\n', '')) > 0: AboutText += _("Processor temperature:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + SIGN + "C\n" imagestarted = "" bootname = '' if path.exists('/boot/bootname'): f = open('/boot/bootname', 'r') bootname = f.readline().split('=')[1] f.close() if SystemInfo["canMultiBoot"]: slot = image = GetCurrentImage() bootmode = "" part = "eMMC slot %s" % slot if SystemInfo["canMode12"]: bootmode = " bootmode = %s" % GetCurrentImageMode() if SystemInfo["HasHiSi"] and "sda" in SystemInfo["canMultiBoot"][ slot]['device']: if slot > 4: image -= 4 else: image -= 1 part = "SDcard slot %s (%s) " % ( image, SystemInfo["canMultiBoot"][slot]['device']) AboutText += _("Selected Image:\t\t%s") % _("STARTUP_") + str( slot) + " (" + part + bootmode + ")\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t\t%s") % driversdate + "\n" AboutText += _("Image:\t\t%s") % about.getImageVersionString() + "\n" AboutText += _("Build:\t\t%s") % getImageBuild() + "\n" AboutText += _( "Kernel: \t\t%s") % about.getKernelVersionString() + "\n" AboutText += _("Oe-Core:\t\t%s") % getOEVersion() + "\n" AboutText += _( "Enigma (re)starts:\t%d\n") % config.misc.startCounter.value AboutText += _( "GStreamer:\t\t%s") % about.getGStreamerVersionString() + "\n" AboutText += _("Python:\t\t%s") % about.getPythonVersionString() + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Front Panel:\t\t%s") % fp_version AboutText += fp_version + "\n" else: fp_version = _("Front Panel:\t\tVersion unknown") AboutText += fp_version + "\n" if getMachineBuild() not in ('gbmv200', 'vuduo4k', 'v8plus', 'ustym4kpro', 'hd60', 'hd61', 'i55plus', 'osmio4k', 'osmio4kplus', 'h9', 'h9combo', 'vuzero4k', 'sf5008', 'et13000', 'et1x000', 'hd51', 'hd52', 'vusolo4k', 'vuuno4k', 'vuuno4kse', 'vuultimo4k', 'sf4008', 'dm820', 'dm7080', 'dm900', 'dm920', 'gb7252', 'dags7252', 'vs1500', 'h7', 'xc7439', '8100s', 'u41', 'u42', 'u43', 'u5', 'u5pvr', 'u52', 'u53', 'u54', 'u55', 'u56', 'u51', 'cc1', 'sf8008'): AboutText += _( "Installed:\t\t%s") % about.getFlashDateString() + "\n" AboutText += _( "Last Upgrade:\t\t%s") % about.getLastUpdateString() + "\n\n" self["FPVersion"] = StaticText(fp_version) AboutText += _("WWW:\t\t%s") % about.getImageUrlString() + "\n\n" AboutText += _( "based on:\t\t%s") % "www.github.com/oe-alliance" + "\n\n" # don't remove the string out of the _(), or it can't be "translated" anymore. # TRANSLATORS: Add here whatever should be shown in the "translator" about screen, up to 6 lines (use \n for newline) info = _("TRANSLATOR_INFO") if info == _("TRANSLATOR_INFO"): info = "" infolines = _("").split("\n") infomap = {} for x in infolines: l = x.split(': ') if len(l) != 2: continue (type, value) = l infomap[type] = value translator_name = infomap.get("Language-Team", "none") if translator_name == "none": translator_name = infomap.get("Last-Translator", "") self["FPVersion"] = StaticText(fp_version) self["TunerHeader"] = StaticText(_("Detected NIMs:")) 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("") self["HDDHeader"] = StaticText(_("Detected HDD:")) hddlist = harddiskmanager.HDDList() hddinfo = "" if hddlist: for count in range(len(hddlist)): if hddinfo: hddinfo += "\n" hdd = hddlist[count][1] if int(hdd.free()) > 1024: hddinfo += "%s\n(%s, %d GB %s)" % ( hdd.model(), hdd.capacity(), hdd.free() / 1024, _("free")) else: hddinfo += "%s\n(%s, %d MB %s)" % ( hdd.model(), hdd.capacity(), hdd.free(), _("free")) else: hddinfo = _("none") self["hddA"] = StaticText(hddinfo) self["AboutScrollLabel"] = ScrollLabel(AboutText) self["actions"] = ActionMap( ["SetupActions", "ColorActions", "DirectionActions"], { "cancel": self.close, "ok": self.close, "green": self.showTranslationInfo, "up": self["AboutScrollLabel"].pageUp, "down": self["AboutScrollLabel"].pageDown })
def __init__(self, session, piclist, lastindex, path): self.textcolor = config.pic.textcolor.value self.color = config.pic.bgcolor.value tlf = TemplatedListFonts() self._labelFontSize = tlf.size(tlf.SMALLER) self._labelFontFace = tlf.face(tlf.SMALLER) sizes = componentSizes[Pic_Thumb.SKIN_COMPONENT_KEY] self._descSize = sizes.get(Pic_Thumb.SKIN_COMPONENT_DESCRIPTION_SIZE, 35) self._margin = sizes.get(Pic_Thumb.SKIN_COMPONENT_MARGIN, 10) self._spaceX = sizes.get(Pic_Thumb.SKIN_COMPONENT_SPACE_X, 55) self._spaceY = sizes.get(Pic_Thumb.SKIN_COMPONENT_SPACE_Y, 30) self._thumbX = sizes.get(Pic_Thumb.SKIN_COMPONENT_THUMP_X, 190) self._thumbY = sizes.get(Pic_Thumb.SKIN_COMPONENT_THUMP_Y, 200) size_w = getDesktop(0).size().width() size_h = getDesktop(0).size().height() self.thumbsX = size_w / (self._spaceX + self._thumbX ) # thumbnails in X self.thumbsY = size_h / (self._spaceY + self._thumbY ) # thumbnails in Y self.thumbsC = self.thumbsX * self.thumbsY # all thumbnails self.positionlist = [] skincontent = "" posX = -1 for x in range(self.thumbsC): posY = x / self.thumbsX posX += 1 if posX >= self.thumbsX: posX = 0 absX = self._spaceX + (posX * (self._spaceX + self._thumbX)) absY = self._spaceY + (posY * (self._spaceY + self._thumbY)) self.positionlist.append((absX, absY)) absX += self._margin absY += self._margin skincontent += '<widget source="label%s" render="Label" position="%s,%s" size="%s,%s" font="%s;%s" valign="top" halign="center" zPosition="2" transparent="1" foregroundColor="%s"/>' % ( x, absX, absY + self._thumbY - self._descSize, self._thumbX, self._descSize, self._labelFontFace, self._labelFontSize, self.textcolor) skincontent += '<widget name="thumb%s" position="%s,%s" size="%s,%s" zPosition="2" transparent="1" />' % ( x, absX, absY, self._thumbX, self._thumbY - self._descSize - self._margin) # Screen, backgroundlabel and MovingPixmap doubleMargin = self._margin * 2 self.skin = """<screen position="0,0" size="{0},{1}" flags="wfNoBorder" > <eLabel position="0,0" zPosition="0" size="{0},{1}" backgroundColor="{2}" /> \ <widget name="frame" position="35,30" size="{3},{4}" pixmap="pic_frame.png" zPosition="1" alphatest="on" />{5}</screen>""".format( size_w, size_h, self.color, self._thumbX + doubleMargin, self._thumbY + doubleMargin, skincontent) 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 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 x[0][1] == False: 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_conn = self.picload.PictureData.connect(self.showPic) self.onLayoutFinish.append(self.setPicloadConf) self.ThumbTimer = eTimer() self.ThumbTimer_conn = self.ThumbTimer.timeout.connect(self.showPic)
def __init__(self, session): Screen.__init__(self, session) self['config'] = ConfigList([configEntry('HKEY_LOCAL_ENIGMA/IMPORTANT/USER_ANNOYING_STUFF/SDTV/FLASHES/GREEN'), configEntry('HKEY_LOCAL_ENIGMA/IMPORTANT/USER_ANNOYING_STUFF/HDTV/FLASHES/GREEN')]) self['actions'] = ActionMap(['OkCancelActions'], {'ok': self['config'].toggle, 'cancel': self.close})
def __init__(self, session, *args): Screen.__init__(self, session) Screen.setTitle(self, _("Openeight Software Panel")) skin = """ <screen name="SoftwarePanel" position="center,center" size="650,605" title="Software Panel"> <widget name="a_off" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/ExtrasPanel/pics/aoff.png" position="10,10" zPosition="1" size="36,97" alphatest="on" /> <widget name="a_red" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/ExtrasPanel/pics/ared.png" position="10,10" zPosition="1" size="36,97" alphatest="on" /> <widget name="a_yellow" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/ExtrasPanel/pics/ayellow.png" position="10,10" zPosition="1" size="36,97" alphatest="on" /> <widget name="a_green" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/ExtrasPanel/pics/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="276,50" size="247,30" zPosition="1" font="Regular;25" halign="right" transparent="1" /> <widget name="packagenr" position="529,50" size="69,30" zPosition="1" font="Regular;25" halign="left" 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,560" size="138,40" alphatest="blend" /> <widget name="key_green_pic" pixmap="skin_default/buttons/green.png" position="180,560" size="138,40" alphatest="blend" /> <ePixmap pixmap="skin_default/buttons/yellow.png" position="333,560" size="138,40" alphatest="blend" /> <ePixmap pixmap="skin_default/buttons/blue.png" position="481,560" size="138,40" alphatest="blend" /> <widget name="key_red" position="38,570" size="124,26" zPosition="1" font="Regular;17" halign="center" transparent="1" /> <widget name="key_green" position="188,570" size="124,26" zPosition="1" font="Regular;17" halign="center" transparent="1" /> <widget name="key_yellow" position="340,570" size="124,26" zPosition="1" font="Regular;17" halign="center" transparent="1" /> <widget name="key_blue" position="491,570" size="124,26" zPosition="1" font="Regular;17" halign="center" 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['key_yellow'] = Label(_("")) 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.trafficLight = 0 self.ipkg = IpkgComponent() self.ipkg.addCallback(self.ipkgCallback) self["actions"] = ActionMap([ "OkCancelActions", "DirectionActions", "ColorActions", "SetupActions" ], { "cancel": self.Exit, "green": self.Green, "yellow": self.showCommitLog }, -2) self.onLayoutFinish.append(self.layoutFinished)
def __init__(self, session, key, args=None): Screen.__init__(self, session) self.session = 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 = eval("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 = list(function for function in hotkey.functions if function[1] == x) if function: self.selected.append( ChoiceEntryComponent( '', ((function[0][0]), function[0][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)
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)