def __init__(self, directory, showDirectories = True, showFiles = True, showMountpoints = True, matchingPattern = None, useServiceRef = False, inhibitDirs = False, inhibitMounts = False, isTop = False, enableWrapAround = False, additionalExtensions = None, sort = "default"): MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent) self.additional_extensions = additionalExtensions self.mountpoints = [] self.current_directory = None self.current_mountpoint = None self.useServiceRef = useServiceRef self.showDirectories = showDirectories self.showMountpoints = showMountpoints self.showFiles = showFiles self.isTop = isTop # example: matching .nfi and .ts files: "^.*\.(nfi|ts)" self.matchingPattern = matchingPattern self.sort = sort self.inhibitDirs = inhibitDirs or [] self.inhibitMounts = inhibitMounts or [] self.refreshMountpoints() self.changeDir(directory, sort = sort) if getDesktop(0).size().width() == 1920: self.l.setFont(0, gFont("Regular", 26)) self.l.setItemHeight(36) else: self.l.setFont(0, gFont("Regular", 18)) self.l.setItemHeight(21) self.serviceHandler = eServiceCenter.getInstance()
def build(self): self["myMenu"] = MenuList(self.buildlist(), False, eListboxPythonMultiContent) #self.act = self.myaction(self) self["myMenu"].l.setFont(0, gFont("Regular", 20)) self["myMenu"].l.setFont(1, gFont("Regular", 14)) self["myMenu"].l.setItemHeight(40) #self["myMenu"].onSelectionChanged = [self.Changed] self["Description"] = Label("") self["red"] = Label("Download") self["green"] = Label("Upload") self["yellow"] = Label("Edit") self["blue"] = Label("Delete") self.actions['red'] = self.ActionHelperDownload self.actions['green'] = self.ActionHelperUpload self.actions['yellow'] = self.ActionHelperEdit self.actions['blue'] = self.ActionHelperDelete self.actions['0'] = self.ActionHelperAdd self.context = ["ChannelSelectBaseActions","WizardActions", "DirectionActions","MenuActions","NumberActions","ColorActions"]
def __init__(self, directory, showDirectories = True, showFiles = True, showMountpoints = True, matchingPattern = None, useServiceRef = False, inhibitDirs = False, inhibitMounts = False, isTop = False, enableWrapAround = False, additionalExtensions = None, sortDate=False): MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent) GUIComponent.__init__(self) self.additional_extensions = additionalExtensions self.mountpoints = [] self.current_directory = None self.current_mountpoint = None self.useServiceRef = useServiceRef self.showDirectories = showDirectories self.showMountpoints = showMountpoints self.showFiles = showFiles self.isTop = isTop # example: matching .nfi and .ts files: "^.*\.(nfi|ts)" self.matchingPattern = matchingPattern self.inhibitDirs = inhibitDirs or [] self.inhibitMounts = inhibitMounts or [] self.sortDate = sortDate self.refreshMountpoints() #self.changeDir(directory) #self.l.setFont(0, gFont("Regular", int(config.plugins.AdvancedFreePlayer.FileListFontSize.value))) #self.l.setItemHeight(35) self.serviceHandler = eServiceCenter.getInstance() #default values: self.font0 = gFont("Regular",22) self.font1 = gFont("Regular",16) self.itemHeight = 35 self.DimText0 = (45, 1, 1020, 35, 0) self.DimText1 = (0, 0, 0, 0) # not used here self.DimPIC = (5, 4, 25, 25)
def __init__(self): GUIComponent.__init__(self) self.l = eListboxPythonMultiContent() self.l.setBuildFunc(self.buildList) self.l.setFont(0, gFont("Regular", 22)) self.l.setFont(1, gFont("Regular", 18)) self.l.setItemHeight(75)
def __init__(self, session): self.session = session path = "%s/skins/%s/screen_archiv.xml" % (getPluginPath(), config.plugins.skyrecorder.anytime_skin.value) with open(path, "r") as f: self.skin = f.read() f.close() Screen.__init__(self, session) pluginName = config.plugins.skyrecorder.pluginname.value contentSize = config.plugins.skyrecorder.contentsize.value # try to get the ayntimefolder try: anytimefolder = config.plugins.skyrecorder.anytimefolder.value except Exception: sys.exc_clear() anytimefolder = resolveFilename(SCOPE_HDD) self.anytimefolder = anytimefolder self.serviceHandler = eServiceCenter.getInstance() self["actions"] = ActionMap(["OkCancelActions", "ShortcutActions", "EPGSelectActions", "WizardActions", "ColorActions", "NumberActions", "MenuActions", "MoviePlayerActions"], { "ok" : self.keyOK, "cancel" : self.keyCancel, "up" : self.keyUp, "down" : self.keyDown, "right" : self.keySwitchList, "left" : self.keySwitchList, "red": self.keyRed, "green": self.keyGreen, "prevBouquet" : self.keyPageDown, "nextBouquet" : self.keyPageUp }, -1) # Genrelist self.showGenreList = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent) self.showGenreList.l.setFont(0, gFont('Regular', contentSize)) self.showGenreList.l.setItemHeight(25) self['genreselect'] = self.showGenreList self['genreselect'].setList([]) #Movielist self.showMovieList = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent) self.showMovieList.l.setFont(0, gFont('Regular', contentSize)) self.showMovieList.l.setItemHeight(25) self['movieselect'] = self.showMovieList self['movieselect'].setList([]) # Auswahl der liste welche als erstes angezeigt werden soll self["genreselect"].selectionEnabled(0) self["movieselect"].selectionEnabled(1) self.currentList = "movieselect" self['mainselect'] = Label("SkyRecorder Archiv") self['handlung'] = Label("") self.onLayoutFinish.append(self.getGenreList) self['movieselect'].onSelectionChanged.append(self.showDetails)
def __init__(self, type=EPG_TYPE_SINGLE, selChangedCB=None, timer = None): self.days = (_("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat"), _("Sun")) self.timer = timer self.onSelChanged = [ ] if selChangedCB is not None: self.onSelChanged.append(selChangedCB) GUIComponent.__init__(self) self.type=type self.l = eListboxPythonMultiContent() tlf = TemplatedListFonts() self._font0 = gFont(tlf.face(tlf.BIG), tlf.size(tlf.BIG)) self._font1 = gFont(tlf.face(tlf.SMALL), tlf.size(tlf.SMALL)) self.l.setFont(0, self._font0) self.l.setFont(1, self._font1) self._textRenderer = None sizes = componentSizes[EPGList.SKIN_COMPONENT_KEY] self._iconWidth = sizes.get(EPGList.SKIN_COMPONENT_ICON_WIDTH, 21) self._iconHeight = sizes.get(EPGList.SKIN_COMPONENT_ICON_HEIGHT, 21) self._iconHPos = sizes.get(EPGList.SKIN_COMPONENT_ICON_HPOS, 4) self._itemMargin = sizes.get(EPGList.SKIN_COMPONENT_ITEM_MARGIN, 10) if type in (EPG_TYPE_SINGLE, EPG_TYPE_SIMILAR): self.l.setBuildFunc(self.buildSingleEntry) else: assert(type == EPG_TYPE_MULTI) self.l.setBuildFunc(self.buildMultiEntry) self.epgcache = eEPGCache.getInstance() self.clock_pixmap = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/epgclock.png')) self.clock_add_pixmap = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/epgclock_add.png')) self.clock_pre_pixmap = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/epgclock_pre.png')) self.clock_post_pixmap = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/epgclock_post.png')) self.clock_prepost_pixmap = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/epgclock_prepost.png'))
def __init__(self, list): MenuList.__init__(self, list, False, eListboxPythonMultiContent) self.l.setItemHeight(45) self.l.setFont(0, gFont('SetrixHD', 24)) self.l.setFont(1, gFont('Regular', 22)) if 1 == 2: cat = _('Education') cat = _('Movie & Media') cat = _('Network & Streaming') cat = _('News') cat = _('Program Guide') cat = _('Social') cat = _('Spinners') cat = _('Sports') cat = _('Radio') cat = _('Tweaks') cat = _('Recordings') cat = _('Communication') cat = _('System Extensions') cat = _('Utilities') cat = _('Development') cat = _('Picons') cat = _('Skin Extensions') cat = _('SkinParts Collections') cat = _('Drivers') cat = _('Channellists') cat = _('Kernel Modules') cat = _('Language Packs') cat = _('Weather') cat = _('Various') cat = _('My SkinParts') cat = _('Default Bugfixes') cat = _('VTI Specific') cat = _('OpenPLi Specific') cat = _('MetrixHD Default')
def __init__(self, list): GUIComponent.__init__(self) self.l = eListboxPythonMultiContent() self.l.setBuildFunc(self.buildTimerEntry) self.serviceNameFont = gFont("Regular", 20) self.font = gFont("Regular", 18) self.eventNameFont = gFont("Regular", 18) self.l.setList(list) self.posy = 0 self.posy2 = 0 self.itemHeight = 50 self.rowSplit = 25 self.iconMargin = 4 self.satPosLeft = 160 self.iconWait = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/timer_wait.png")) # currently intended that all icons have the same size self.iconWidth = self.iconWait.size().width() self.iconHeight = self.iconWait.size().height() self.iconRecording = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/timer_rec.png")) self.iconPrepared = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/timer_prep.png")) self.iconDone = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/timer_done.png")) self.iconRepeat = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/timer_rep.png")) self.iconZapped = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/timer_zap.png")) self.iconDisabled = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/timer_off.png")) self.iconAutoTimer = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/timer_autotimer.png"))
def applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [ ] for (attrib, value) in self.skinAttributes: if attrib == "EntryForegroundColor": self.foreColor = parseColor(value) elif attrib == "EntryForegroundColorSelected": self.foreColorSelected = parseColor(value) elif attrib == "EntryActiveBackgroundColor": self.backColorActive = parseColor(value) elif attrib == "EntryActiveBackgroundColorSelected": self.backColorActiveSelected = parseColor(value) elif attrib == "EntryBorderColor": self.borderColor = parseColor(value) elif attrib == "EntryBackgroundColor": self.backColor = parseColor(value) elif attrib == "EntryBackgroundColorSelected": self.backColorSelected = parseColor(value) elif attrib == "ServiceNameForegroundColor": self.foreColorService = parseColor(value) elif attrib == "ServiceNameBackgroundColor": self.backColorService = parseColor(value) elif attrib == "EntryFont": self.l.setFont(1, gFont(value.split(";")[0], int(value.split(";")[1]))) elif attrib == "ServiceFont": self.l.setFont(0, gFont(value.split(";")[0], int(value.split(";")[1]))) else: attribs.append((attrib,value)) self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, screen)
def __init__(self, entries): GUIComponent.__init__(self) self.l = eListboxPythonMultiContent() self.l.setFont(0, gFont("Regular", 22)) self.l.setFont(1, gFont("Regular", 18)) self.list = [self.buildListboxEntry(x) for x in entries] self.l.setList(self.list)
def __init__(self, session): Screen.__init__(self, session) self["Canvas"] = CanvasSource() self.basic_colors = [RGB(255, 255, 255), RGB(255, 255, 0), RGB(0, 255, 255), RGB(0, 255, 0), RGB(255, 0, 255), RGB(255, 0, 0), RGB(0, 0, 255), RGB(0, 0, 0)] tlf = TemplatedListFonts() self._textFont = gFont(tlf.face(tlf.BIGGER), tlf.size(tlf.BIGGER)) self._headerSize = tlf.size(tlf.BIGGER) * 2 self._headerFont = gFont(tlf.face(tlf.BIGGER), self._headerSize) self._headerSize = int(self._headerSize * 1.5) self["actions"] = ActionMap(["InputActions", "OkCancelActions"], { "1": self.testpic_brightness, "2": self.testpic_contrast, # "3": self.testpic_colors, "3": self.testpic_filter, "4": self.testpic_gamma, "5": self.testpic_fubk, "ok": self.callNext, "cancel": self.close, }) self._size = None self.next = None self._clear() self.onLayoutFinish.append(self._onLayoutFinish)
def layoutFinished(self): screenwidth = getDesktop(0).size().width() if screenwidth and screenwidth < 1920: f = 1 elif screenwidth and screenwidth < 3840: f = 1.5 else: f = 3 font = gFont("Console", int(16*f)) if not int(fontRenderClass.getInstance().getLineHeight(font)): font = gFont("Regular", int(16*f)) self["list"].instance.setFont(font) fontwidth = getTextBoundarySize(self.instance, font, self["list"].instance.size(), _(" ")).width() listwidth = int(self["list"].instance.size().width() / fontwidth) - 2 if path.exists(self.logfile): for line in file(self.logfile ).readlines(): line = line.replace('\t',' '*9) if len(line) > listwidth: pos = 0 offset = 0 readyline = True while readyline: a = " " * offset + line[pos:pos+listwidth-offset] self.log.append(a) if len(line[pos+listwidth-offset:]): pos += listwidth-offset offset = 19 else: readyline = False else: self.log.append(line) else: self.log = [_("file can not displayed - file not found")] self["list"].setList(self.log)
def __init__(self, list, itemHeight=29): MenuList.__init__(self, list, False, eListboxPythonMultiContent) self.l.setItemHeight(itemHeight) self.l.setFont(0, gFont("Regular", 21)) self.l.setFont(1, gFont("Regular", 23)) self.l.setFont(2, gFont("Regular", 18)) self.l.setFont(3, gFont("Regular", 19))
def __init__(self, session): Screen.__init__(self, session) HelpableScreen.__init__(self) ChannelsBase.__init__(self) self.session = session self.skinName = [ "SeriesPluginChannelEditor" ] from plugin import NAME, VERSION self.setup_title = NAME + " " + _("Channel Editor") + " " + VERSION # Buttons self["key_red"] = Button(_("Cancel")) self["key_green"] = Button(_("OK")) self["key_blue"] = Button(_("Remove")) self["key_yellow"] = Button(_("Auto match")) # Define Actions self["actions_1"] = HelpableActionMap(self, "SetupActions", { "ok" : (self.keyAdd, _("Show popup to add Stb Channel")), "cancel" : (self.keyCancel, _("Cancel and close")), "deleteForward" : (self.keyResetChannelMapping, _("Reset channels")), }, -1) self["actions_2"] = HelpableActionMap(self, "DirectionActions", { "left" : (self.keyLeft, _("Previeous page")), "right" : (self.keyRight, _("Next page")), "up" : (self.keyUp, _("One row up")), "down" : (self.keyDown, _("One row down")), }, -1) self["actions_3"] = HelpableActionMap(self, "ColorActions", { "red" : (self.keyCancel, _("Cancel and close")), "green" : (self.keySave, _("Save and close")), "blue" : (self.keyRemove, _("Remove channel")), "yellow" : (self.tryToMatchChannels, _("Auto match")), }, -2) # higher priority self.helpList[0][2].sort() self["helpActions"] = ActionMap(["HelpActions",], { "displayHelp" : self.showHelp }, 0) self.chooseMenuList = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent) global TemplatedListFonts if TemplatedListFonts is not None: tlf = TemplatedListFonts() self.chooseMenuList.l.setFont(0, gFont(tlf.face(tlf.MEDIUM), tlf.size(tlf.MEDIUM))) self.chooseMenuList.l.setItemHeight(30) else: self.chooseMenuList.l.setFont(0, gFont('Regular', 20 )) self.chooseMenuList.l.setItemHeight(25) self['list'] = self.chooseMenuList self['list'].show() self.stbChlist = [] self.webChlist = [] self.stbToWebChlist = [] self.onLayoutFinish.append(self.readChannels)
def __init__(self, list, enableWrapAround=True): MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent) self.l.setFont(0, gFont("Regular", 20)) self.l.setFont(1, gFont("Regular", 14)) self.l.setFont(2, gFont("Regular", 32)) self.l.setFont(3, gFont("Regular", 24)) self.l.setItemHeight(50)
def postWidgetCreate(self, instance): instance.setWrapAround(True) instance.selectionChanged.get().append(self.serviceChanged) instance.setContent(self.l) self.l.setFont(0, gFont("Regular", 20)) self.l.setFont(1, gFont("Regular", 14)) self.l.setSelectionClip(eRect(0, 0, 0, 0), False)
def setFontsize(self): self.ServiceNumberFont = gFont(self.ServiceNameFontName, self.ServiceNameFontSize + int(config.usage.servicenum_fontsize.value)) self.ServiceNameFont = gFont(self.ServiceNameFontName, self.ServiceNameFontSize + int(config.usage.servicename_fontsize.value)) self.ServiceInfoFont = gFont(self.ServiceInfoFontName, self.ServiceInfoFontSize + int(config.usage.serviceinfo_fontsize.value)) self.l.setElementFont(self.l.celServiceName, self.ServiceNameFont) self.l.setElementFont(self.l.celServiceNumber, self.ServiceNumberFont) self.l.setElementFont(self.l.celServiceInfo, self.ServiceInfoFont)
def __init__(self, directory, showDirectories = True, showFiles = True, showMountpoints = True, matchingPattern = None, useServiceRef = False, inhibitDirs = False, inhibitMounts = False, isTop = False, enableWrapAround = False, additionalExtensions = None): MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent) self.additional_extensions = additionalExtensions self.mountpoints = [] self.current_directory = None self.current_mountpoint = None self.useServiceRef = useServiceRef self.showDirectories = showDirectories self.showMountpoints = showMountpoints self.showFiles = showFiles if isTop: self.topDirectory = directory else: self.topDirectory = "/" # example: matching .nfi and .ts files: "^.*\.(nfi|ts)" if matchingPattern: self.matchingPattern = re.compile(matchingPattern) else: self.matchingPattern = None self.inhibitDirs = inhibitDirs or [] self.inhibitMounts = inhibitMounts or [] self.refreshMountpoints() self.changeDir(directory) self.l.setFont(0, gFont("Regular", 18)) self.l.setFont(1, gFont("Regular", 32)) self.l.setItemHeight(23) self.serviceHandler = eServiceCenter.getInstance()
def __init__(self, list, enableWrapAround=True): MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent) font = skin.fonts.get("PluginBrowser0", ("Regular", 20, 50)) self.l.setFont(0, gFont(font[0], font[1])) self.l.setItemHeight(font[2]) font = skin.fonts.get("PluginBrowser1", ("Regular", 14)) self.l.setFont(1, gFont(font[0], font[1]))
def __init__(self, type=EPG_TYPE_SINGLE, selChangedCB=None, timer = None): self.days = (_("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat"), _("Sun")) self.timer = timer self.onSelChanged = [ ] if selChangedCB is not None: self.onSelChanged.append(selChangedCB) GUIComponent.__init__(self) self.type=type self.l = eListboxPythonMultiContent() self.l.setFont(0, gFont("Regular", 22)) self.l.setFont(1, gFont("Regular", 16)) self.dy = 0 if type == EPG_TYPE_SINGLE: self.l.setBuildFunc(self.buildSingleEntry) elif type == EPG_TYPE_MULTI: self.l.setBuildFunc(self.buildMultiEntry) else: assert(type == EPG_TYPE_SIMILAR) self.l.setBuildFunc(self.buildSimilarEntry) self.epgcache = eEPGCache.getInstance() self.clocks = [ LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/epgclock_add.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/epgclock_pre.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/epgclock.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/epgclock_prepost.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/epgclock_post.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/zapclock_add.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/zapclock_pre.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/zapclock.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/zapclock_prepost.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/zapclock_post.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/zaprecclock_add.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/zaprecclock_pre.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/zaprecclock.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/zaprecclock_prepost.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/zaprecclock_post.png')) ]
def __init__(self, list, enableWrapAround = True): MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent) font = skin.fonts.get("PartnerBoxEntryList0", ("Regular", 20, 20)) self.l.setFont(0, gFont(font[0], font[1])) self.ItemHeight = int(font[2]) font = skin.fonts.get("PartnerBoxEntryList1", ("Regular", 18)) self.l.setFont(1, gFont(font[0], font[1]))
def __init__(self, type=EPG_TYPE_SINGLE, selChangedCB=None, timer = None): self.days = (_("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat"), _("Sun")) self.timer = timer self.onSelChanged = [ ] if selChangedCB is not None: self.onSelChanged.append(selChangedCB) GUIComponent.__init__(self) self.type=type self.l = eListboxPythonMultiContent() font, size = skin.parameters.get("EPGlistFont1", ('Regular',22)) self.l.setFont(0, gFont(font, size)) font, size = skin.parameters.get("EPGlistFont2", ('Regular',16)) self.l.setFont(1, gFont(font, size)) if type == EPG_TYPE_SINGLE: self.l.setBuildFunc(self.buildSingleEntry) elif type == EPG_TYPE_MULTI: self.l.setBuildFunc(self.buildMultiEntry) elif type == EPG_TYPE_EPGBAR: self.l.setBuildFunc(self.buildEPGBarEntry) else: assert(type == EPG_TYPE_SIMILAR) self.l.setBuildFunc(self.buildSimilarEntry) self.epgcache = eEPGCache.getInstance() self.clock_pixmap = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/epgclock.png')) self.clock_add_pixmap = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/epgclock_add.png')) self.clock_pre_pixmap = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/epgclock_pre.png')) self.clock_post_pixmap = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/epgclock_post.png')) self.clock_prepost_pixmap = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/epgclock_prepost.png')) self.clock_pixmap_disabled = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/epgclock_disabled.png'))
def build(self): self["myMenu"] = MenuList(self.buildlist(), False, eListboxPythonMultiContent) self["myMenu"].onSelectionChanged = [self.Changed] self["myMenu"].l.setFont(0, gFont("Regular", 20)) self["myMenu"].l.setFont(1, gFont("Regular", 14)) self["myMenu"].l.setItemHeight(40) self["Description"] = Label("/var") self["red"] = Label("") self["green"] = Label("") self["yellow"] = Label("") self["blue"] = Label("Delete") self.actions['red'] = lambda: self.action('create') self.actions['green'] = lambda: self.action('upload') self.actions['yellow'] = lambda: self.action() self.actions['blue'] = lambda: self.action('delete') self.actions['ok'] = lambda: self.action('ok') #self.actions["up"] = lambda: self.Changed('up') #self.actions["down"] = self.Changed('down') self.context = ["ChannelSelectBaseActions","WizardActions", "DirectionActions","MenuActions","NumberActions","ColorActions"]
def __init__(self, session): self.session = session Screen.__init__(self, session) self["actions"] = ActionMap(["OkCancelActions", "ShortcutActions", "WizardActions", "ColorActions", "SetupActions", "NumberActions", "MenuActions"], { "ok" : self.keyOK, "cancel": self.keyCancel, "up" : self.keyUp, "down" : self.keyDown, "left" : self.keyLeft, "right" : self.keyRight, }, -1) self.streamBin = resolveFilename(SCOPE_PLUGINS, "usr/bin/rtmpdump") self.streamFile = resolveFilename(SCOPE_PLUGINS, "Extensions/OpenIPTV/chanels.xml") self.streamList = [] self.makeStreamList() self.streamMenuList = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent) self.streamMenuList.l.setFont(0, gFont('Regular', 22)) self.streamMenuList.l.setFont(1, gFont('Regular', 18)) self.streamMenuList.l.setItemHeight(37) self['streamlist'] = self.streamMenuList self.streamMenuList.setList(map(streamListEntry, self.streamList)) self.onLayoutFinish.append(self.layoutFinished) self.rtmpConsole = None self.beforeService = None self.currentService = None self.playerStoped = False self.serviceDoCommand = None self.keyLocked = False
def __init__(self): GUIComponent.__init__(self) self.l = eListboxPythonMultiContent() self.l.setFont(0, gFont("Regular", 24)) self.l.setFont(1, gFont("Regular", 18)) self.l.setBuildFunc(self.buildEntry) #self.l.setItemHeight(65) self.l.setItemHeight(35) self.onSelectionChanged = [ ] try: self.categoryPIX = LoadPixmap(cached=True, path=resolveFilename(SCOPE_PLUGINS, self.ICON_CATEGORY)) print("loaded") self.searchPIX = LoadPixmap(cached=True, path=resolveFilename(SCOPE_PLUGINS, self.ICON_SEARCH)) print("loaded") self.newthreadPIX = LoadPixmap(cached=True, path=resolveFilename(SCOPE_PLUGINS, self.ICON_NEWTHREAD)) print("loaded") self.oldthreadPIX = LoadPixmap(cached=True, path=resolveFilename(SCOPE_PLUGINS, self.ICON_OLDTHREAD)) print("loaded") except: self.categoryPIX = None self.searchPIX = None self.newthreadPIX = None self.oldthreadPIX = None print("Problem with loading markers for MyList")
def __init__(self, list, itemH = 25): MenuList.__init__(self, list, False, eListboxPythonMultiContent) self.l.setItemHeight(itemH) self.l.setFont(0, gFont("Regular", 18)) self.l.setFont(1, gFont("Regular", 16)) self.clientFont = gFont("Regular", 14) self.l.setFont(2, self.clientFont) self.l.setFont(3, gFont("Regular", 12))
def setFontsize(self): screenwidth = getDesktop(0).size().width() if screenwidth and screenwidth == 1920: self.l.setFont(0, gFont(self.fontName, self.fontSize1080 + config.movielist.fontsize.value)) self.l.setFont(1, gFont(self.fontName, (self.fontSize1080 - 2) + config.movielist.fontsize.value)) else: self.l.setFont(0, gFont(self.fontName, self.fontSize + config.movielist.fontsize.value)) self.l.setFont(1, gFont(self.fontName, (self.fontSize - 3) + config.movielist.fontsize.value))
def __init__(self, list): GUIComponent.__init__(self) self.l = eListboxPythonMultiContent() self.l.setBuildFunc(self.buildTimerEntry) self.l.setFont(0, gFont("Regular", 20)) self.l.setFont(1, gFont("Regular", 18)) self.l.setItemHeight(70) self.l.setList(list)
def __init__(self, menuList, enableWrapAround = True): printl("", self, "S") MenuList.__init__(self, menuList, enableWrapAround, eListboxPythonMultiContent) self.l.setFont(0, gFont("Regular", 20)) self.l.setFont(1, gFont("Regular", 18)) printl("", self, "C")
def __init__(self): MenuList.__init__(self, [], False, eListboxPythonMultiContent) self.l.setFont(0, gFont("Regular", 18)) self.l.setFont(1, gFont("Regular", 16)) self.listCompleted = [] self.callback = None self.idx = 0 self.thumb = ""
def __init__(self, list, selection=0, enableWrapAround=False): MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent) font = skin.fonts.get("ChoiceList", ("Regular", 20, 30)) self.l.setFont(0, gFont(font[0], font[1])) self.l.setItemHeight(font[2]) self.selection = selection
def __init__(self, list): GUIComponent.__init__(self) self.l = eListboxPythonMultiContent() self.l.setList(list) self.l.setFont(0, gFont("Regular", 20)) self.l.setFont(1, gFont("Regular", 18))
def __init__(self, list): MenuList.__init__(self, list, False, eListboxPythonMultiContent) self.l.setItemHeight(50) self.l.setFont(0, gFont("SetrixHD", 26)) self.l.setFont(1, gFont("Regular", 22))
def __init__(self): GUIComponent.__init__(self) self.l = eListboxPythonMultiContent() self.l.setSelectionClip(eRect(0, 0, 0, 0)) self.l.setItemHeight(25) self.l.setFont(0, gFont("Regular", 20))
def __init__(self, session): self.skin = """ <screen name="Vpn Menu" backgroundColor="#00000000" position="center,center" size="666,420" title="Vpn" flags="wfNoBorder"> <widget name="countryPng" position="30,5" alphatest="blend" size="50,33" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/VpnChanger/icon/default.png" zPosition="2" /> <widget name="list" position="center,70" size="600,160" backgroundColor="#00000000" scrollbarMode="showOnDemand" zPosition="2" transparent="1" /> <widget name="vpnLoad" position="center,70" size="600,160" backgroundColor="#00000000" foregroundColor="#00B8B8B8" font="Regular; 24" valign="top" halign="left" zPosition="2" transparent="1" /> <widget name="ipLabel" position="80,5" size="600,33" backgroundColor="#00000000" foregroundColor="#00B8B8B8" font="Regular; 24" valign="top" halign="left" zPosition="2" transparent="1" /> <eLabel position="30,253" size="5,33" zPosition="2" backgroundColor="#00ff0000" /> <eLabel text="Start/Stop OpenVpn" position="40,253" size="333,33" backgroundColor="#00000000" transparent="1" foregroundColor="#00B8B8B8" zPosition="2" font="Regular; 24" valign="top" halign="left" /> <widget name="vpnStatus" position="303,253" size="290,33" backgroundColor="#00000000" foregroundColor="#00B8B8B8" font="Regular; 24" valign="top" halign="left" zPosition="2" transparent="1" /> <widget name="vpnInfo" position="303,293" size="290,33" backgroundColor="#00000000" foregroundColor="#00B8B8B8" font="Regular; 24" valign="top" halign="left" zPosition="2" transparent="1" /> <eLabel position="30,293" size="5,33" zPosition="2" backgroundColor="#0000ff00" /> <widget name="vpnDir" position="40,293" size="290,33" backgroundColor="#00000000" foregroundColor="#00B8B8B8" font="Regular; 24" valign="top" halign="left" zPosition="2" transparent="1" /> <eLabel position="30,333" size="5,33" zPosition="2" backgroundColor="#00ebff00" /> <widget name="check" position="40,333" size="290,33" backgroundColor="#00000000" foregroundColor="#00B8B8B8" font="Regular; 24" valign="top" halign="left" zPosition="2" transparent="1" /> <widget name="checkLabel" position="303,333" size="290,33" backgroundColor="#00000000" foregroundColor="#00B8B8B8" font="Regular; 24" valign="top" halign="left" zPosition="2" transparent="1" /> <eLabel position="30,373" size="5,33" zPosition="2" backgroundColor="#003000ff" /> <widget name="network" position="40,373" size="290,33" backgroundColor="#00000000" foregroundColor="#00B8B8B8" font="Regular; 24" valign="top" halign="left" zPosition="2" transparent="1" /> </screen>""" Screen.__init__(self, session) self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "SetupActions"], { "ok": self.keyOK, "red": self.keyRed, "green": self.keyGreen, "yellow": self.keyYellow, "blue": self.keyBlue, "cancel": self.keyCancel }, -1) self.chooseMenuList = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent) if DESKTOPSIZE.width() == 1920: self.chooseMenuList.l.setFont(0, gFont('Regular', 29)) self.chooseMenuList.l.setItemHeight(31) else: self.chooseMenuList.l.setFont(0, gFont('Regular', 19)) self.chooseMenuList.l.setItemHeight(22) self['countryPng'] = Pixmap() self["ipLabel"] = Label("") self["check"] = Label("Start/Stop Check Vpn") self["network"] = Label(_("Restart Network")) if config.vpnChanger.vpnCheck.value: text = "Vpn Check is Enabled" else: text = "Vpn Check is Disabled" self["checkLabel"] = Label(text) self['vpnInfo'] = Label(config.vpnChanger.lastVpn.value) self['vpnDir'] = Label(config.vpnChanger.dir.value) self['list'] = self.chooseMenuList self['vpnLoad'] = Label("OpenVpn is Loading.....") if "openvpn" in str(os.listdir("/var/run")): text = "OpenVpn is Running" else: text = "OpenVpn is not Running" self['vpnStatus'] = Label(text) self['vpnLoad'].hide() self.Timer = 0 self.StatusTimer = eTimer() self.StatusTimer.callback.append(self.statusVpn) self.onLayoutFinish.append(self.setList)
def __init__(self, list): MenuList.__init__(self, list, False, eListboxPythonMultiContent) self.l.setItemHeight(40) textfont = int(config.plugins.kodiplug.textfont.value) self.l.setFont(0, gFont("Regular", textfont))
def parseFont(str, scale): name, size = str.split(';') return gFont(name, int(size) * scale[0][0] / scale[0][1])
def __init__(self, list, enableWrapAround=True): MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent) self.l.setFont(0, gFont("Regular", 20))
def testpic_colors(self): self.next = self.testpic_filter self.show() c = self["Canvas"] xres, yres = getDesktop(0).size().width(), getDesktop( 0).size().height() bbw = xres / 192 bbh = yres / 192 c.fill(0, 0, xres, yres, RGB(255, 255, 255)) for i in range(33): col = i * 255 / 32 width = xres - xres / 5 ew = width / 33 offset = xres / 10 + ew * i y = yres * 2 / 3 height = yres / 20 o = yres / 60 if i < 16: c1 = 0xFF c2 = 0xFF - (0xFF * i / 16) else: c1 = 0xFF - (0xFF * (i - 16) / 16) c2 = 0 c.fill(offset, y, ew, height, RGB(c1, c2, c2)) c.fill(offset, y + (height + o) * 1, ew, height, RGB(c2, c1, c2)) c.fill(offset, y + (height + o) * 2, ew, height, RGB(c2, c2, c1)) c.fill(offset, y + (height + o) * 3, ew, height, RGB(col, col, col)) if i == 0: self.bbox(offset, y, ew, height, RGB(0, 0, 0), bbw, bbh) self.bbox(offset, y + (height + o) * 1, ew, height, RGB(0, 0, 0), bbw, bbh) self.bbox(offset, y + (height + o) * 2, ew, height, RGB(0, 0, 0), bbw, bbh) for i in range(8): height = yres / 3 eh = height / 8 offset = yres / 6 + eh * i x = xres * 2 / 3 width = yres / 6 c.fill(x, offset, width, eh, self.basic_colors[i]) if i == 0: self.bbox(x, offset, width, eh, RGB(0, 0, 0), bbw, bbh) c.writeText(xres / 10, yres / 6 - 40, xres * 3 / 5, 40, RGB(128, 0, 0), RGB(255, 255, 255), gFont("Regular", self.MyFontSize * 2), _("Color")) c.writeText( xres / 10, yres / 5, xres / 2, yres * 4 / 6, RGB(0, 0, 0), RGB(255, 255, 255), gFont("Regular", self.MyFontSize), _("Adjust the color settings so that all the color shades are distinguishable, but appear as saturated as possible. " "If you are happy with the result, press OK to close the video fine-tuning, or use the number keys to select other test screens." ), RT_WRAP) c.flush()
def __init__(self, type=EPG_TYPE_SINGLE, selChangedCB=None, timer=None): self.days = (_("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat"), _("Sun")) self.timer = timer self.onSelChanged = [] if selChangedCB is not None: self.onSelChanged.append(selChangedCB) GUIComponent.__init__(self) self.type = type self.l = eListboxPythonMultiContent() self.eventItemFont = gFont("Regular", 22) self.eventTimeFont = gFont("Regular", 16) self.iconSize = 21 self.iconDistance = 2 self.colGap = 10 self.skinColumns = False self.tw = 120 self.dy = 0 if type is EPG_TYPE_SINGLE: self.l.setBuildFunc(self.buildSingleEntry) elif type is EPG_TYPE_MULTI: self.l.setBuildFunc(self.buildMultiEntry) else: assert(type is EPG_TYPE_SIMILAR) self.l.setBuildFunc(self.buildSimilarEntry) self.epgcache = eEPGCache.getInstance() self.clocks = [LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/epgclock_add.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/epgclock_pre.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/epgclock.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/epgclock_prepost.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/epgclock_post.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/zapclock_add.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/zapclock_pre.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/zapclock.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/zapclock_prepost.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/zapclock_post.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/zaprecclock_add.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/zaprecclock_pre.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/zaprecclock.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/zaprecclock_prepost.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/zaprecclock_post.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/repepgclock_add.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/repepgclock_pre.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/repepgclock.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/repepgclock_prepost.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/repepgclock_post.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/repzapclock_add.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/repzapclock_pre.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/repzapclock.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/repzapclock_prepost.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/repzapclock_post.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/repzaprecclock_add.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/repzaprecclock_pre.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/repzaprecclock.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/repzaprecclock_prepost.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/repzaprecclock_post.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/pipclock_add.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/pipclock_pre.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/pipclock.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/pipclock_prepost.png')), LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'icons/pipclock_post.png'))]
def setFontsize(self): self.l.setFont(0, gFont(self.fontName, self.fontSize)) self.l.setFont(1, gFont(self.fontName, self.fontSize + 5))
def __init__(self): GUIComponent.__init__(self) self.l = eListboxPythonMultiContent() self.l.setFont(0, gFont('Regular', 28)) self.l.setItemHeight(40) self.l.setBuildFunc(self.buildList)
def __init__(self, eventList): GUIComponent.__init__(self) self.l = eListboxPythonMultiContent() self.l.setFont(0, gFont("Regular", 18)) self.l.setBuildFunc(self.buildResultEntry) self.l.setItemHeight(150) self.onSelectionChanged = [] self.resultlist = LoadPixmap( cached=True, path=resolveFilename( SCOPE_CURRENT_PLUGIN, 'Extensions/PrimeTimeManager/images/resultlist.png'), desktop=getDesktop(0)) self.favoritePixmap = LoadPixmap( cached=True, path=resolveFilename( SCOPE_CURRENT_PLUGIN, 'Extensions/PrimeTimeManager/images/favorite.png'), desktop=getDesktop(0)) self.clockPixmap = LoadPixmap( cached=True, path=resolveFilename( SCOPE_CURRENT_PLUGIN, 'Extensions/PrimeTimeManager/images/epgclock.png'), desktop=getDesktop(0)) self.clockOverlap = LoadPixmap( cached=True, path=resolveFilename( SCOPE_CURRENT_PLUGIN, 'Extensions/PrimeTimeManager/images/clockOverlap.png'), desktop=getDesktop(0)) self.clockNotrecord = LoadPixmap( cached=True, path=resolveFilename( SCOPE_CURRENT_PLUGIN, 'Extensions/PrimeTimeManager/images/clockNotrecord.png'), desktop=getDesktop(0)) self.noConflictPixmap = LoadPixmap( cached=True, path=resolveFilename( SCOPE_CURRENT_PLUGIN, 'Extensions/PrimeTimeManager/images/noConflict.png'), desktop=getDesktop(0)) self.arrowRightPixmap = LoadPixmap( cached=True, path=resolveFilename( SCOPE_CURRENT_PLUGIN, 'Extensions/PrimeTimeManager/images/right.png'), desktop=getDesktop(0)) self.deletePixmap = LoadPixmap( cached=True, path=resolveFilename( SCOPE_CURRENT_PLUGIN, 'Extensions/PrimeTimeManager/images/delete.png'), desktop=getDesktop(0)) if AUTOTIMER and config.plugins.PrimeTimeManager.UseAutotimer.value: self.autotimerPixmap = LoadPixmap( cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, 'Extensions/AutoTimer/plugin.png'), desktop=getDesktop(0)) self.l.setList(eventList) self.digitList = [] i = 0 while i <= 10: name = 'Extensions/PrimeTimeManager/images/digit_' + str( i) + '.png' digitPixmap = LoadPixmap(cached=True, path=resolveFilename( SCOPE_CURRENT_PLUGIN, name), desktop=getDesktop(0)) self.digitList.append(digitPixmap) i += 1
def loadSingleSkinData(desktop, screenID, domSkin, pathSkin, scope=SCOPE_CURRENT_SKIN): """Loads skin data like colors, windowstyle etc.""" assert domSkin.tag == "skin", "root element in skin must be 'skin'!" global colors, fonts, menus, parameters, setups, switchPixmap for tag in domSkin.findall("output"): scrnID = int(tag.attrib.get("id", GUI_SKIN_ID)) if scrnID == GUI_SKIN_ID: for res in tag.findall("resolution"): xres = res.attrib.get("xres") xres = int(xres) if xres else 720 yres = res.attrib.get("yres") yres = int(yres) if yres else 576 bpp = res.attrib.get("bpp") bpp = int(bpp) if bpp else 32 # print("[Skin] DEBUG: Resolution xres=%d, yres=%d, bpp=%d." % (xres, yres, bpp)) from enigma import gMainDC gMainDC.getInstance().setResolution(xres, yres) desktop.resize(eSize(xres, yres)) if bpp != 32: pass # Load palette (Not yet implemented!) if yres >= 1080: parameters["AutotimerEnabledIcon"] = (2, 1, 38, 36) parameters["AutotimerRecordIcon"] = (42, 5, 30, 30) parameters["ChoicelistDash"] = (0, 3, 1000, 30) parameters["ChoicelistIcon"] = (7, 0, 52, 38) parameters["ChoicelistName"] = (68, 3, 1000, 30) parameters["ConfigListSeperator"] = 300 parameters["DreamexplorerIcon"] = (15, 4, 30, 30) parameters["DreamexplorerName"] = (62, 0, 1200, 38) parameters["EPGImportFilterListDescr"] = (30, 3, 500, 30) parameters["EPGImportFilterListLockOff"] = (0, 0, 30, 30) parameters["EPGImportFilterListLockOn"] = (0, 0, 30, 30) parameters["ExpandableListCategory"] = (60, 0, 655, 38) parameters["ExpandableListIcon"] = (5, 0, 45, 38) parameters["ExpandableListItem"] = (105, 0, 620, 38) parameters["ExpandableListLock"] = (60, 1, 38, 36) parameters["FileListIcon"] = (7, 4, 52, 37) parameters["FileListMultiIcon"] = (45, 4, 30, 30) parameters["FileListMultiLock"] = (2, 0, 36, 36) parameters["FileListMultiName"] = (90, 3, 1000, 32) parameters["FileListName"] = (68, 4, 1000, 34) parameters["HelpMenuListExtHlp0"] = (0, 0, 900, 39) parameters["HelpMenuListExtHlp1"] = (0, 42, 900, 30) parameters["HelpMenuListHlp"] = (0, 0, 900, 42) parameters["PartnerBoxBouquetListName"] = (0, 0, 45) parameters["PartnerBoxChannelListName"] = (0, 0, 45) parameters["PartnerBoxChannelListTime"] = (0, 78, 225, 30) parameters["PartnerBoxChannelListTitle"] = (0, 42, 30) parameters["PartnerBoxE1TimerState"] = (255, 78, 255, 30) parameters["PartnerBoxE1TimerTime"] = (0, 78, 255, 30) parameters["PartnerBoxE2TimerIcon"] = (1050, 8, 20, 20) parameters["PartnerBoxE2TimerIconRepeat"] = (1050, 38, 20, 20) parameters["PartnerBoxE2TimerState"] = (225, 78, 225, 30) parameters["PartnerBoxE2TimerTime"] = (0, 78, 225, 30) parameters["PartnerBoxEntryListIP"] = (180, 2, 225, 38) parameters["PartnerBoxEntryListName"] = (8, 2, 225, 38) parameters["PartnerBoxEntryListPort"] = (405, 2, 150, 38) parameters["PartnerBoxEntryListType"] = (615, 2, 150, 38) parameters["PartnerBoxTimerName"] = (0, 42, 30) parameters["PartnerBoxTimerServicename"] = (0, 0, 45) parameters["PicturePlayerThumb"] = (30, 285, 45, 300, 30, 25) parameters["PlayListIcon"] = (7, 7, 24, 24) parameters["PlayListName"] = (38, 2, 1000, 34) parameters["PluginBrowserDescr"] = (180, 42, 25) parameters["PluginBrowserDownloadDescr"] = (120, 42, 25) parameters["PluginBrowserDownloadIcon"] = (15, 0, 90, 76) parameters["PluginBrowserDownloadName"] = (120, 8, 38) parameters["PluginBrowserIcon"] = (15, 8, 150, 60) parameters["PluginBrowserName"] = (180, 8, 38) parameters["SHOUTcastListItem"] = (30, 27, 35, 96, 35, 33, 60, 32) parameters["SelectionListDescr"] = (45, 3, 1000, 32) parameters["SelectionListLock"] = (0, 2, 36, 36) parameters["SelectionListLockOff"] = (0, 2, 36, 36) parameters["ServiceInfo"] = (0, 0, 450, 50) parameters["ServiceInfoLeft"] = (0, 0, 450, 45) parameters["ServiceInfoRight"] = (450, 0, 1000, 45) parameters["VirtualKeyBoard"] = (68, 68) parameters["VirtualKeyBoardAlignment"] = (0, 0) parameters["VirtualKeyBoardPadding"] = (7, 7) parameters["VirtualKeyBoardShiftColors"] = (0x00ffffff, 0x00ffffff, 0x0000ffff, 0x00ff00ff) for tag in domSkin.findall("include"): filename = tag.attrib.get("filename") if filename: filename = resolveFilename(scope, filename, path_prefix=pathSkin) if isfile(filename): loadSkin(filename, scope=scope, desktop=desktop, screenID=screenID) else: raise SkinError("Included file '%s' not found" % filename) for tag in domSkin.findall("switchpixmap"): for pixmap in tag.findall("pixmap"): name = pixmap.attrib.get("name") if not name: raise SkinError("Pixmap needs name attribute") filename = pixmap.attrib.get("filename") if not filename: raise SkinError("Pixmap needs filename attribute") resolved = resolveFilename(scope, filename, path_prefix=pathSkin) if isfile(resolved): switchPixmap[name] = LoadPixmap(resolved, cached=True) else: raise SkinError("The switchpixmap pixmap filename='%s' (%s) not found" % (filename, resolved)) for tag in domSkin.findall("colors"): for color in tag.findall("color"): name = color.attrib.get("name") color = color.attrib.get("value") if name and color: colors[name] = parseColor(color) # print("[Skin] DEBUG: Color name='%s', color='%s'." % (name, color)) else: raise SkinError("Tag 'color' needs a name and color, got name='%s' and color='%s'" % (name, color)) for tag in domSkin.findall("fonts"): for font in tag.findall("font"): filename = font.attrib.get("filename", "<NONAME>") name = font.attrib.get("name", "Regular") scale = font.attrib.get("scale") scale = int(scale) if scale else 100 isReplacement = font.attrib.get("replacement") and True or False render = font.attrib.get("render") if render: render = int(render) else: render = 0 filename = resolveFilename(SCOPE_FONTS, filename, path_prefix=pathSkin) if isfile(filename): addFont(filename, name, scale, isReplacement, render) # Log provided by C++ addFont code. # print("[Skin] Add font: Font path='%s', name='%s', scale=%d, isReplacement=%s, render=%d." % (filename, name, scale, isReplacement, render)) else: raise SkinError("Font file '%s' not found" % filename) fallbackFont = resolveFilename(SCOPE_FONTS, "fallback.font", path_prefix=pathSkin) if isfile(fallbackFont): addFont(fallbackFont, "Fallback", 100, -1, 0) # else: # As this is optional don't raise an error. # raise SkinError("Fallback font '%s' not found" % fallbackFont) for alias in tag.findall("alias"): try: name = alias.attrib.get("name") font = alias.attrib.get("font") size = int(alias.attrib.get("size")) height = int(alias.attrib.get("height", size)) # To be calculated some day. width = int(alias.attrib.get("width", size)) fonts[name] = (font, size, height, width) # print("[Skin] Add font alias: name='%s', font='%s', size=%d, height=%s, width=%d." % (name, font, size, height, width)) except Exception as err: raise SkinError("Bad font alias: '%s'" % str(err)) for tag in domSkin.findall("parameters"): for parameter in tag.findall("parameter"): try: name = parameter.attrib.get("name") value = parameter.attrib.get("value") parameters[name] = map(parseParameter, [x.strip() for x in value.split(",")]) if "," in value else parseParameter(value) except Exception as err: raise SkinError("Bad parameter: '%s'" % str(err)) for tag in domSkin.findall("menus"): for setup in tag.findall("menu"): key = setup.attrib.get("key") image = setup.attrib.get("image") if key and image: menus[key] = image # print("[Skin] DEBUG: Menu key='%s', image='%s'." % (key, image)) else: raise SkinError("Tag menu needs key and image, got key='%s' and image='%s'" % (key, image)) for tag in domSkin.findall("setups"): for setup in tag.findall("setup"): key = setup.attrib.get("key") image = setup.attrib.get("image") if key and image: setups[key] = image # print("[Skin] DEBUG: Setup key='%s', image='%s'." % (key, image)) else: raise SkinError("Tag setup needs key and image, got key='%s' and image='%s'" % (key, image)) for tag in domSkin.findall("subtitles"): from enigma import eSubtitleWidget scale = ((1, 1), (1, 1)) for substyle in tag.findall("sub"): font = parseFont(substyle.attrib.get("font"), scale) col = substyle.attrib.get("foregroundColor") if col: foregroundColor = parseColor(col) haveColor = 1 else: foregroundColor = gRGB(0xFFFFFF) haveColor = 0 col = substyle.attrib.get("borderColor") if col: borderColor = parseColor(col) else: borderColor = gRGB(0) borderwidth = substyle.attrib.get("borderWidth") if borderwidth is None: borderWidth = 3 # Default: Use a subtitle border. else: borderWidth = int(borderwidth) face = eSubtitleWidget.__dict__[substyle.attrib.get("name")] eSubtitleWidget.setFontStyle(face, font, haveColor, foregroundColor, borderColor, borderWidth) for tag in domSkin.findall("windowstyle"): style = eWindowStyleSkinned() scrnID = int(tag.attrib.get("id", GUI_SKIN_ID)) font = gFont("Regular", 20) # Default offset = eSize(20, 5) # Default for title in tag.findall("title"): offset = parseSize(title.attrib.get("offset"), ((1, 1), (1, 1))) font = parseFont(title.attrib.get("font"), ((1, 1), (1, 1))) style.setTitleFont(font) style.setTitleOffset(offset) # print("[Skin] DEBUG: WindowStyle font, offset - '%s' '%s'." % (str(font), str(offset))) for borderset in tag.findall("borderset"): bsName = str(borderset.attrib.get("name")) for pixmap in borderset.findall("pixmap"): bpName = pixmap.attrib.get("pos") filename = pixmap.attrib.get("filename") if filename and bpName: png = loadPixmap(resolveFilename(scope, filename, path_prefix=pathSkin), desktop) try: style.setPixmap(eWindowStyleSkinned.__dict__[bsName], eWindowStyleSkinned.__dict__[bpName], png) except Exception: pass # print("[Skin] DEBUG: WindowStyle borderset name, filename - '%s' '%s'." % (bpName, filename)) for color in tag.findall("color"): colorType = color.attrib.get("name") color = parseColor(color.attrib.get("color")) try: style.setColor(eWindowStyleSkinned.__dict__["col" + colorType], color) except Exception: raise SkinError("Unknown color type '%s'" % colorType) # print("[Skin] DEBUG: WindowStyle color type, color -" % (colorType, str(color))) x = eWindowStyleManager.getInstance() x.setStyle(scrnID, style) for tag in domSkin.findall("margin"): scrnID = int(tag.attrib.get("id", GUI_SKIN_ID)) r = eRect(0, 0, 0, 0) v = tag.attrib.get("left") if v: r.setLeft(int(v)) v = tag.attrib.get("top") if v: r.setTop(int(v)) v = tag.attrib.get("right") if v: r.setRight(int(v)) v = tag.attrib.get("bottom") if v: r.setBottom(int(v)) # The "desktop" parameter is hard-coded to the GUI screen, so we must ask # for the one that this actually applies to. getDesktop(scrnID).setMargins(r)
def __init__(self, list): MenuList.__init__(self, list, False, eListboxPythonMultiContent) self.l.setItemHeight(60) self.l.setFont(0, gFont('SetrixHD', 30)) self.l.setFont(1, gFont('Regular', 22))
def setEventFontsize(self): self.l.setFont(1, gFont(self.entryFontName, self.entryFontSize + config.misc.graph_mepg.ev_fontsize.getValue()))
def parseColumnValue(value): x, length, color, fontname, fontheight, align, itemindex = value.split( ',') return (int(x), int(length), parseColor(color), gFont(fontname, int(fontheight)), int(fontheight), int(itemindex), int(align))
def showmenulist(self, datalist): cacolor = 16776960 cbcolor = 16753920 cccolor = 15657130 cdcolor = 16711680 cecolor = 16729344 cfcolor = 65407 cgcolor = 11403055 chcolor = 13047173 cicolor = 13789470 scolor = cbcolor res = [] menulist = [] if reswidth == 1280: self['menu'].l.setItemHeight(50) self['menu'].l.setFont(0, gFont('Regular', 28)) else: self['menu'].l.setItemHeight(75) self['menu'].l.setFont(0, gFont('Regular', 42)) for i in range(0, len(datalist)): txt = datalist[i][1] if reswidth == 1280: png = os_path.join( resolveFilename( SCOPE_PLUGINS, 'Extensions/KeyAdder/VirtualKeyBoard_Icons/buttonsHD/%s.png' % datalist[i][2])) else: png = os_path.join( resolveFilename( SCOPE_PLUGINS, 'Extensions/KeyAdder/VirtualKeyBoard_Icons/buttonsFHD/%s.png' % datalist[i][2])) res.append( MultiContentEntryText(pos=(0, 1), size=(0, 0), font=0, flags=RT_HALIGN_LEFT | RT_VALIGN_CENTER | RT_WRAP, text='', color=scolor, color_sel=cccolor, border_width=3, border_color=806544)) if reswidth == 1280: res.append( MultiContentEntryText(pos=(60, 1), size=(723, 50), font=0, flags=RT_HALIGN_LEFT | RT_VALIGN_CENTER | RT_WRAP, text=str(txt), color=16777215, color_sel=16777215)) res.append( MultiContentEntryPixmapAlphaTest(pos=(5, 5), size=(40, 40), png=loadPNG(png))) else: res.append( MultiContentEntryText(pos=(100, 1), size=(1080, 75), font=0, flags=RT_HALIGN_LEFT | RT_VALIGN_CENTER | RT_WRAP, text=str(txt), color=16777215, color_sel=16777215)) res.append( MultiContentEntryPixmapAlphaTest(pos=(5, 5), size=(75, 75), png=loadPNG(png))) menulist.append(res) res = [] self['menu'].l.setList(menulist) self['menu'].show()
def setMode(self, mode): if config.usage.servicelist_number_of_services.value == "by skin": ItemHeight = self.ItemHeight ServiceNameFont = self.ServiceNameFont ServiceNumberFont = self.ServiceNumberFont ServiceInfoFont = self.ServiceInfoFont else: ItemHeight = int( self.instance.size().height() / int(config.usage.servicelist_number_of_services.value)) FontFactor = ItemHeight * 100 / self.ItemHeight ServiceNameFont = gFont( self.ServiceNameFont.family, int(self.ServiceNameFont.pointSize * FontFactor / 100)) ServiceNumberFont = gFont( self.ServiceNumberFont.family, int(self.ServiceNumberFont.pointSize * FontFactor / 100)) ServiceInfoFont = gFont( self.ServiceInfoFont.family, int(self.ServiceInfoFont.pointSize * FontFactor / 100)) self.mode = mode self.l.setItemHeight(ItemHeight) self.l.setVisualMode(eListboxServiceContent.visModeComplex) if config.usage.service_icon_enable.value: self.l.setGetPiconNameFunc(getPiconName) else: self.l.setGetPiconNameFunc(None) rowWidth = self.instance.size().width( ) - 30 #scrollbar is fixed 20 + 10 Extra marge if mode is self.MODE_NORMAL or not config.usage.show_channel_numbers_in_servicelist.value: channelNumberWidth = 0 channelNumberSpace = 0 else: channelNumberWidth = config.usage.alternative_number_mode.value and getTextBoundarySize( self.instance, ServiceNumberFont, self.instance.size(), "0000").width() or getTextBoundarySize( self.instance, self.ServiceNumberFont, self.instance.size(), "00000").width() channelNumberSpace = self.fieldMargins self.l.setElementPosition(self.l.celServiceNumber, eRect(0, 0, channelNumberWidth, ItemHeight)) progressWidth = self.progressBarWidth if "perc" in config.usage.show_event_progress_in_servicelist.value: progressWidth = self.progressPercentWidth or self.progressBarWidth if "left" in config.usage.show_event_progress_in_servicelist.value: self.l.setElementPosition( self.l.celServiceEventProgressbar, eRect(channelNumberWidth + channelNumberSpace, 0, progressWidth, ItemHeight)) self.l.setElementPosition( self.l.celServiceName, eRect( channelNumberWidth + channelNumberSpace + progressWidth + self.fieldMargins, 0, rowWidth - (channelNumberWidth + channelNumberSpace + progressWidth + self.fieldMargins), ItemHeight)) elif "right" in config.usage.show_event_progress_in_servicelist.value: self.l.setElementPosition( self.l.celServiceEventProgressbar, eRect(rowWidth - progressWidth, 0, progressWidth, ItemHeight)) self.l.setElementPosition( self.l.celServiceName, eRect( channelNumberWidth + channelNumberSpace, 0, rowWidth - (channelNumberWidth + channelNumberSpace + progressWidth + self.fieldMargins), ItemHeight)) else: self.l.setElementPosition(self.l.celServiceEventProgressbar, eRect(0, 0, 0, 0)) self.l.setElementPosition( self.l.celServiceName, eRect(channelNumberWidth + channelNumberSpace, 0, rowWidth - (channelNumberWidth + channelNumberSpace), ItemHeight)) self.l.setElementFont(self.l.celServiceName, ServiceNameFont) self.l.setElementFont(self.l.celServiceNumber, ServiceNumberFont) self.l.setElementFont(self.l.celServiceInfo, ServiceInfoFont) if "perc" in config.usage.show_event_progress_in_servicelist.value: self.l.setElementFont(self.l.celServiceEventProgressbar, ServiceInfoFont) self.l.setHideNumberMarker(config.usage.hide_number_markers.value) self.l.setServiceTypeIconMode( int(config.usage.servicetype_icon_mode.value)) self.l.setCryptoIconMode(int(config.usage.crypto_icon_mode.value)) self.l.setRecordIndicatorMode( int(config.usage.record_indicator_mode.value)) self.l.setColumnWidth(int(config.usage.servicelist_column.value))
def __init__(self, helplist, callback): GUIComponent.__init__(self) self.onSelChanged = [] self.l = eListboxPythonMultiContent() self.callback = callback self.extendedHelp = False l = [] for (actionmap, context, actions) in helplist: for (action, help) in actions: if hasattr(help, '__call__'): help = help() if not help: continue buttons = queryKeyBinding(context, action) # do not display entries which are not accessible from keys if not len(buttons): continue name = None flags = 0 for n in buttons: (name, flags) = (getKeyDescription(n[0]), n[1]) # only show entries with keys that are available on the used rc if name is None: continue if flags & 8: # for long keypresses, prepend l_ into the key name. name = (name[0], "long") entry = [(actionmap, context, action, name)] if isinstance(help, list): self.extendedHelp = True print "extendedHelpEntry found" x, y, w, h = skin.parameters.get( "HelpMenuListExtHlp0", (0, 0, 600, 26)) x1, y1, w1, h1 = skin.parameters.get( "HelpMenuListExtHlp1", (0, 28, 600, 20)) entry.extend(((eListboxPythonMultiContent.TYPE_TEXT, x, y, w, h, 0, 0, help[0]), (eListboxPythonMultiContent.TYPE_TEXT, x1, y1, w1, h1, 1, 0, help[1]))) else: x, y, w, h = skin.parameters.get( "HelpMenuListHlp", (0, 0, 600, 28)) entry.append((eListboxPythonMultiContent.TYPE_TEXT, x, y, w, h, 0, 0, help)) l.append(entry) self.l.setList(l) if self.extendedHelp is True: font = skin.fonts.get("HelpMenuListExt0", ("Regular", 24, 50)) self.l.setFont(0, gFont(font[0], font[1])) self.l.setItemHeight(font[2]) font = skin.fonts.get("HelpMenuListExt1", ("Regular", 18)) self.l.setFont(1, gFont(font[0], font[1])) else: font = skin.fonts.get("HelpMenuList", ("Regular", 24, 38)) self.l.setFont(0, gFont(font[0], font[1])) self.l.setItemHeight(font[2])
def setTextFont(self): if self["text"].long_text is not None: self["text"].long_text.setFont(gFont("Console", self.currentFontSize))
def __init__(self, list): MenuList.__init__(self, list, False, eListboxPythonMultiContent) self.l.setItemHeight(int(30 * f)) self.l.setFont(0, gFont("Regular", int(18 * f)))
def __init__(self, list, font0 = 24, font1 = 16, itemHeight = 50, enableWrapAround = True): MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent) self.l.setFont(0, gFont("Regular", font0)) self.l.setFont(1, gFont("Regular", font1)) self.l.setItemHeight(itemHeight)
def __init__(self, list, enableWrapAround = False): MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent) self.l.setFont(0, gFont("Regular", 22)) self.l.setFont(1, gFont("Regular", 14)) self.l.setItemHeight(50)
def __init__(self, list, enableWrapAround = False): MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent) tlf = TemplatedListFonts() self.l.setFont(0, gFont(tlf.face(tlf.BIG), tlf.size(tlf.BIG))) itemHeight = componentSizes.itemHeight(componentSizes.PARENTAL_CONTROL_LIST, 32) self.l.setItemHeight(itemHeight)
def __init__(self, list, selection = 0, enableWrapAround=True): MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent) self.l.setFont(0, gFont("Regular", 18)) self.l.setItemHeight(120) self.selection = selection
def setFontsize(self): self.l.setFont(0, gFont(self.fontName, self.fontSize + config.movielist.fontsize.value)) self.dateFont = gFont(self.fontName, (self.fontSize - 3) + config.movielist.fontsize.value) self.l.setFont(1, self.dateFont)
# default: use a subtitle border borderWidth = 3 else: borderWidth = int(borderwidth) face = eSubtitleWidget.__dict__[get_attr("name")] eSubtitleWidget.setFontStyle(face, font, haveColor, foregroundColor, borderColor, borderWidth) for windowstyle in skin.findall("windowstyle"): style = eWindowStyleSkinned() style_id = windowstyle.attrib.get("id") if style_id: style_id = int(style_id) else: style_id = 0 # defaults font = gFont("Regular", 20) offset = eSize(20, 5) for title in windowstyle.findall("title"): get_attr = title.attrib.get offset = parseSize(get_attr("offset"), ((1,1),(1,1))) font = parseFont(get_attr("font"), ((1,1),(1,1))) style.setTitleFont(font); style.setTitleOffset(offset) #print " ", font, offset for borderset in windowstyle.findall("borderset"): bsName = str(borderset.attrib.get("name")) for pixmap in borderset.findall("pixmap"): get_attr = pixmap.attrib.get bpName = get_attr("pos") filename = get_attr("filename")
def __init__(self): MenuList.__init__(self, [], False, eListboxPythonMultiContent) self.l.setItemHeight(25) self.l.setFont(0, gFont("Regular", 20))
def __init__(self, list): MenuList.__init__(self, list, False, eListboxPythonMultiContent) self.l.setItemHeight(100) self.l.setFont(0, gFont('Regular', 25))