def applySkin(self, desktop, parent): attribs = [] value_attributes = [] size_attributes = [] font_attributes = [] color_attributes = [] if self.skinAttributes: for (attrib, value) in self.skinAttributes: if attrib in value_attributes: setattr(self, attrib, int(value)) elif attrib in size_attributes: setattr(self, attrib, parseSize(value, ((1, 1), (1, 1)))) elif attrib in font_attributes: setattr(self, attrib, parseFont(value, ((1, 1), (1, 1)))) elif attrib in color_attributes: setattr(self, attrib, parseColor(value).argb()) else: attribs.append((attrib, value)) self.skinAttributes = attribs self.list_styles, template_attributes = parseTemplate( MovieList.default_template) self.setListStyle(config.plugins.moviecockpit.list_style.value) logger.debug("self.skinAttributes: %s", str(self.skinAttributes)) GUIComponent.applySkin(self, desktop, parent) template_attributes["width"] = self.l.getItemSize().width() - 15 self.applyTemplate(additional_locals=template_attributes)
def applySkin(self, desktop, screen): if self.skinAttributes is not None: skin_path_prefix = getattr(screen, "skin_path", path) pixmap = None attribs = [ ] for (attrib, value) in self.skinAttributes: if attrib == "pixmaps": pixmaps = value.split(',') for p in pixmaps: pngfile = resolveFilename(SCOPE_CURRENT_SKIN, p, path_prefix=skin_path_prefix) if not fileExists(pngfile) and fileExists(resolveFilename(SCOPE_CURRENT_LCDSKIN, p, path_prefix=skin_path_prefix)): pngfile = resolveFilename(SCOPE_CURRENT_LCDSKIN, p, path_prefix=skin_path_prefix) if path.exists(pngfile): self.pixmaps.append(loadPixmap(pngfile, desktop)) if not pixmap: pixmap = resolveFilename(SCOPE_CURRENT_SKIN, pixmaps[0], path_prefix=skin_path_prefix) if not fileExists(pixmap) and fileExists(resolveFilename(SCOPE_CURRENT_LCDSKIN, pixmaps[0], path_prefix=skin_path_prefix)): pixmap = resolveFilename(SCOPE_CURRENT_LCDSKIN, pixmaps[0], path_prefix=skin_path_prefix) elif attrib == "pixmap": pixmap = resolveFilename(SCOPE_CURRENT_SKIN, value, path_prefix=skin_path_prefix) if not fileExists(pixmap) and fileExists(resolveFilename(SCOPE_CURRENT_LCDSKIN, value, path_prefix=skin_path_prefix)): pixmap = resolveFilename(SCOPE_CURRENT_LCDSKIN, value, path_prefix=skin_path_prefix) else: attribs.append((attrib, value)) if pixmap: attribs.append(("pixmap", pixmap)) self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, screen)
def applySkin(self, desktop, parent): def font0(value): self.font0 = parseFont(value, ((1, 1), (1, 1))) def font1(value): self.font1 = parseFont(value, ((1, 1), (1, 1))) def itemHeight(value): self.itemHeight = int(value) def DimText0(value): self.DimText0 = (int(value.split(',')[0]), int( value.split(',')[1]), int(value.split(',')[2]), int(value.split(',')[3])) def DimText1(value): self.DimText1 = (int(value.split(',')[0]), int( value.split(',')[1]), int(value.split(',')[2]), int(value.split(',')[3])) def DimPIC(value): self.DimPIC = (int(value.split(',')[0]), int(value.split(',')[1]), int(value.split(',')[2]), int(value.split(',')[3])) for (attrib, value) in list(self.skinAttributes): try: locals().get(attrib)(value) self.skinAttributes.remove((attrib, value)) except: pass self.l.setFont(0, self.font0) self.l.setFont(1, self.font1) self.l.setItemHeight(self.itemHeight) return GUIComponent.applySkin(self, desktop, parent)
def applySkin(self, desktop, parent): attribs = [] if self.skinAttributes is not None: for (attrib, value) in self.skinAttributes: if attrib == "posFont": self.posFont = parseFont(value, ((1,1),(1,1))) self.l.setFont(0, self.posFont) elif attrib == "nameFont": self.nameFont = parseFont(value, ((1,1),(1,1))) self.l.setFont(1, self.nameFont) elif attrib == "posWidth": self.posWidth = int(value) elif attrib == "nameWidth": self.nameWidth = int(value) elif attrib == "posColor": self.posColor = parseColor(value).argb() elif attrib == "posColorSel": self.posColorSel = parseColor(value).argb() elif attrib == "nameColor": self.nameColor = parseColor(value).argb() elif attrib == "nameColorSel": self.nameColorSel = parseColor(value).argb() elif attrib == "itemHeight": self.itemHeight = int(value) else: attribs.append((attrib, value)) self.readPlaylist() self.refreshList() self.setItemHeight() self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, parent)
def applySkin(self, desktop, parent): def itemHeight(value): self.itemHeight = int(value) def setServiceNameFont(value): self.serviceNameFont = parseFont(value, ((1, 1), (1, 1))) def setEventNameFont(value): self.eventNameFont = parseFont(value, ((1, 1), (1, 1))) def setFont(value): self.font = parseFont(value, ((1, 1), (1, 1))) def rowSplit(value): self.rowSplit = int(value) def iconMargin(value): self.iconMargin = int(value) def satPosLeft(value): self.satPosLeft = int(value) for (attrib, value) in list(self.skinAttributes): try: locals().get(attrib)(value) self.skinAttributes.remove((attrib, value)) except: pass self.l.setItemHeight(self.itemHeight) self.l.setFont(0, self.serviceNameFont) self.l.setFont(1, self.font) self.l.setFont(2, self.eventNameFont) return GUIComponent.applySkin(self, desktop, parent)
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 applySkin(self, desktop, screen): if self.skinAttributes is not None: skin_path_prefix = getattr(screen, "skin_path", path) pixmap = None attribs = [] for (attrib, value) in self.skinAttributes: if attrib == "pixmaps": pixmaps = value.split(',') for p in pixmaps: self.pixmaps.append( loadPixmap( resolveFilename(SCOPE_SKIN_IMAGE, p, path_prefix=skin_path_prefix), desktop)) if not pixmap: pixmap = resolveFilename(SCOPE_SKIN_IMAGE, pixmaps[0], path_prefix=skin_path_prefix) elif attrib == "pixmap": pixmap = resolveFilename(SCOPE_SKIN_IMAGE, value, path_prefix=skin_path_prefix) else: attribs.append((attrib, value)) if pixmap: attribs.append(("pixmap", pixmap)) self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, screen)
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 applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [] for (attrib, value) in self.skinAttributes: if attrib == "font": font = parseFont(value, ((1, 1), (1, 1))) self.bouquetFontName = font.family self.bouquetFontSize = font.pointSize elif attrib == "foregroundColor": self.foreColor = parseColor(value).argb() elif attrib == "backgroundColor": self.backColor = parseColor(value).argb() elif attrib == "foregroundColorSelected": self.foreColorSelected = parseColor(value).argb() elif attrib == "backgroundColorSelected": self.backColorSelected = parseColor(value).argb() elif attrib == "borderColor": self.borderColor = parseColor(value).argb() elif attrib == "borderWidth": self.borderWidth = int(value) elif attrib == "itemHeight": self.itemHeight = parseScale(value) else: attribs.append((attrib, value)) self.skinAttributes = attribs rc = GUIComponent.applySkin(self, desktop, screen) self.setFontsize() self.listHeight = self.instance.size().height() self.listWidth = self.instance.size().width() self.l.setItemHeight(self.itemHeight) return rc
def applySkin(self, desktop, parent): attribs = [] if self.skinAttributes is not None: for (attrib, value) in self.skinAttributes: if attrib == "posFont": self.posFont = parseFont(value, ((1, 1), (1, 1))) self.l.setFont(0, self.posFont) elif attrib == "nameFont": self.nameFont = parseFont(value, ((1, 1), (1, 1))) self.l.setFont(1, self.nameFont) elif attrib == "posWidth": self.posWidth = int(value) elif attrib == "nameWidth": self.nameWidth = int(value) elif attrib == "posColor": self.posColor = parseColor(value).argb() elif attrib == "posColorSel": self.posColorSel = parseColor(value).argb() elif attrib == "nameColor": self.nameColor = parseColor(value).argb() elif attrib == "nameColorSel": self.nameColorSel = parseColor(value).argb() elif attrib == "itemHeight": self.itemHeight = int(value) else: attribs.append((attrib, value)) self.readPlaylist() self.refreshList() self.setItemHeight() self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, parent)
def applySkin(self, desktop, screen): if self.skinAttributes is not None: foregroundColor = None backgroundColor = None attribs = [] for (attrib, value) in self.skinAttributes: if attrib == "foregroundColors": colors = value.split(',') for color in colors: self.foreColors.append(parseColor(color)) if not foregroundColor: foregroundColor = colors[0] elif attrib == "backgroundColors": colors = value.split(',') for color in colors: self.backColors.append(parseColor(color)) if not backgroundColor: backgroundColor = colors[0] elif attrib == "backgroundColor": backgroundColor = value elif attrib == "foregroundColor": foregroundColor = value else: attribs.append((attrib, value)) if foregroundColor: attribs.append(("foregroundColor", foregroundColor)) if backgroundColor: attribs.append(("backgroundColor", backgroundColor)) self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, screen)
def applySkin(self, desktop, parent): def font0(value): self.font0 = parseFont(value, ((1,1),(1,1))) def font1(value): self.font1 = parseFont(value, ((1,1),(1,1))) def itemHeight(value): self.itemHeight = int(value) def DimText0(value): self.DimText0 = ( int(value.split(',')[0]), int(value.split(',')[1]), int(value.split(',')[2]), int(value.split(',')[3]) ) def DimText1(value): self.DimText1 = ( int(value.split(',')[0]), int(value.split(',')[1]), int(value.split(',')[2]), int(value.split(',')[3]) ) def DimPIC(value): self.DimPIC = ( int(value.split(',')[0]), int(value.split(',')[1]), int(value.split(',')[2]), int(value.split(',')[3]) ) for (attrib, value) in list(self.skinAttributes): try: locals().get(attrib)(value) self.skinAttributes.remove((attrib, value)) except: pass self.l.setFont(0,self.font0) #self.l.setFont(1,self.font1) self.l.setItemHeight(self.itemHeight) return GUIComponent.applySkin(self, desktop, parent)
def applySkin(self, desktop, screen): if self.skinAttributes is not None: myScreen, path = domScreens.get(screen.__class__.__name__, (None, None)) skinPathPrefix = getattr(screen, "skin_path", path) pixmap = None attribs = [] for (attrib, value) in self.skinAttributes: if attrib == "pixmaps": pixmaps = value.split(",") for pix in pixmaps: if fileExists(resolveFilename(SCOPE_GUISKIN, pix, path_prefix=skinPathPrefix)): pngfile = resolveFilename(SCOPE_GUISKIN, pix, path_prefix=skinPathPrefix) elif fileExists(resolveFilename(SCOPE_LCDSKIN, pix, path_prefix=skinPathPrefix)): pngfile = resolveFilename(SCOPE_LCDSKIN, pix, path_prefix=skinPathPrefix) else: pngfile = "" if pngfile and isfile(pngfile): self.pixmaps.append(loadPixmap(pngfile, desktop)) if not pixmap: if fileExists(resolveFilename(SCOPE_GUISKIN, pixmaps[0], path_prefix=skinPathPrefix)): pixmap = resolveFilename(SCOPE_GUISKIN, pixmaps[0], path_prefix=skinPathPrefix) elif fileExists(resolveFilename(SCOPE_LCDSKIN, pixmaps[0], path_prefix=skinPathPrefix)): pixmap = resolveFilename(SCOPE_LCDSKIN, pixmaps[0], path_prefix=skinPathPrefix) elif attrib == "pixmap": if fileExists(resolveFilename(SCOPE_GUISKIN, value, path_prefix=skinPathPrefix)): pixmap = resolveFilename(SCOPE_GUISKIN, value, path_prefix=skinPathPrefix) elif fileExists(resolveFilename(SCOPE_LCDSKIN, value, path_prefix=skinPathPrefix)): pixmap = resolveFilename(SCOPE_LCDSKIN, value, path_prefix=skinPathPrefix) else: attribs.append((attrib, value)) if pixmap: attribs.append(("pixmap", pixmap)) self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, screen)
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).argb() elif attrib == "EntryForegroundColorSelected": self.foreColorSelected = parseColor(value).argb() elif attrib == "EntryBorderColor": self.borderColor = parseColor(value).argb() elif attrib == "EntryBackgroundColor": self.backColor = parseColor(value).argb() elif attrib == "EntryBackgroundColorSelected": self.backColorSelected = parseColor(value).argb() elif attrib == "ServiceNameForegroundColor": self.foreColorService = parseColor(value).argb() elif attrib == "ServiceNameBackgroundColor": self.backColorService = parseColor(value).argb() else: attribs.append((attrib,value)) self.skinAttributes = attribs rc = GUIComponent.applySkin(self, desktop, screen) # now we know our size and can savely set items per page self.setItemsPerPage() return rc
def applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [ ] for (attrib, value) in self.skinAttributes: if attrib == "rowsincolumn": self.rows_in_column = int(value) self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, screen)
def applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [] for (attrib, value) in self.skinAttributes: if attrib == "rowsincolumn": self.rows_in_column = int(value) self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, screen)
class FileList(MenuList): def __init__(self, directory, showDirectories = True, showFiles = True, showMountpoints = True, matchingPattern = None, inhibitDirs = False, inhibitMounts = False, isTop = False, enableWrapAround = False, additionalExtensions = None, sortType='name'): MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent) GUIComponent.__init__(self) self.additional_extensions = additionalExtensions self.mountpoints = [] self.current_directory = None self.current_mountpoint = None 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.sortType = sortType 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 applySkin(self, desktop, parent): def font0(value): self.font0 = parseFont(value, ((1,1),(1,1))) def font1(value): self.font1 = parseFont(value, ((1,1),(1,1))) def itemHeight(value): self.itemHeight = int(value) def DimText0(value): self.DimText0 = ( int(value.split(',')[0]), int(value.split(',')[1]), int(value.split(',')[2]), int(value.split(',')[3]) ) def DimText1(value): self.DimText1 = ( int(value.split(',')[0]), int(value.split(',')[1]), int(value.split(',')[2]), int(value.split(',')[3]) ) def DimPIC(value): self.DimPIC = ( int(value.split(',')[0]), int(value.split(',')[1]), int(value.split(',')[2]), int(value.split(',')[3]) ) for (attrib, value) in list(self.skinAttributes): try: locals().get(attrib)(value) self.skinAttributes.remove((attrib, value)) except Exception, e: pass self.l.setFont(0,self.font0) #self.l.setFont(1,self.font1) self.l.setItemHeight(self.itemHeight) return GUIComponent.applySkin(self, desktop, parent)
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).argb() elif attrib == "EntryForegroundColorSelected": self.foreColorSelected = parseColor(value).argb() elif attrib == "EntryBackgroundColor": self.backColor = parseColor(value).argb() elif attrib == "EntryBackgroundColorSelected": self.backColorSelected = parseColor(value).argb() elif attrib == "EntryBorderColor": self.borderColor = parseColor(value).argb() elif attrib == "EntryFont": font = parseFont(value, ((1,1),(1,1)) ) self.entryFontName = font.family self.entryFontSize = font.pointSize elif attrib == "ServiceForegroundColor" or attrib == "ServiceNameForegroundColor": self.foreColorService = parseColor(value).argb() elif attrib == "ServiceForegroundColorSelected": self.foreColorServiceSelected = parseColor(value).argb() elif attrib == "ServiceBackgroundColor" or attrib == "ServiceNameBackgroundColor": self.backColorService = parseColor(value).argb() elif attrib == "ServiceBackgroundColorSelected": self.backColorServiceSelected = parseColor(value).argb() elif attrib == "ServiceBackgroundColorRecording" or attrib == "ServiceNameBackgroundColor": self.backColorRec = parseColor(value).argb() elif attrib == "ServiceForegroundColorRecording": self.foreColorRec = parseColor(value).argb() elif attrib == "ServiceBorderColor": self.borderColorService = parseColor(value).argb() elif attrib == "ServiceFont": self.serviceFont = parseFont(value, ((1,1),(1,1)) ) elif attrib == "EntryBackgroundColorNow": self.backColorNow = parseColor(value).argb() elif attrib == "EntryForegroundColorNow": self.foreColorNow = parseColor(value).argb() elif attrib == "ServiceBorderWidth": self.serviceBorderWidth = int(value) elif attrib == "ServiceNamePadding": self.serviceNamePadding = int(value) elif attrib == "EventBorderWidth": self.eventBorderWidth = int(value) elif attrib == "EventNamePadding": self.eventNamePadding = int(value) else: attribs.append((attrib,value)) self.skinAttributes = attribs self.l.setFont(0, self.serviceFont) self.setEventFontsize() rc = GUIComponent.applySkin(self, desktop, screen) # now we know our size and can safely set items per page self.listHeight = self.instance.size().height() self.listWidth = self.instance.size().width() self.setItemsPerPage() return rc
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).argb() elif attrib == "EntryForegroundColorSelected": self.foreColorSelected = parseColor(value).argb() elif attrib == "EntryBackgroundColor": self.backColor = parseColor(value).argb() elif attrib == "EntryBackgroundColorSelected": self.backColorSelected = parseColor(value).argb() elif attrib == "EntryBorderColor": self.borderColor = parseColor(value).argb() elif attrib == "EntryFont": font = parseFont(value, ((1, 1), (1, 1)) ) self.entryFontName = font.family self.entryFontSize = font.pointSize elif attrib == "ServiceForegroundColor" or attrib == "ServiceNameForegroundColor": self.foreColorService = parseColor(value).argb() elif attrib == "ServiceForegroundColorSelected": self.foreColorServiceSelected = parseColor(value).argb() elif attrib == "ServiceBackgroundColor" or attrib == "ServiceNameBackgroundColor": self.backColorService = parseColor(value).argb() elif attrib == "ServiceBackgroundColorSelected": self.backColorServiceSelected = parseColor(value).argb() elif attrib == "ServiceBackgroundColorRecording" or attrib == "ServiceNameBackgroundColor": self.backColorRec = parseColor(value).argb() elif attrib == "ServiceForegroundColorRecording": self.foreColorRec = parseColor(value).argb() elif attrib == "ServiceBorderColor": self.borderColorService = parseColor(value).argb() elif attrib == "ServiceFont": self.serviceFont = parseFont(value, ((1, 1), (1, 1)) ) elif attrib == "EntryBackgroundColorNow": self.backColorNow = parseColor(value).argb() elif attrib == "EntryForegroundColorNow": self.foreColorNow = parseColor(value).argb() elif attrib == "ServiceBorderWidth": self.serviceBorderWidth = int(value) elif attrib == "ServiceNamePadding": self.serviceNamePadding = int(value) elif attrib == "EventBorderWidth": self.eventBorderWidth = int(value) elif attrib == "EventNamePadding": self.eventNamePadding = int(value) else: attribs.append((attrib, value)) self.skinAttributes = attribs self.l.setFont(0, self.serviceFont) self.setEventFontsize() rc = GUIComponent.applySkin(self, desktop, screen) # now we know our size and can safely set items per page self.listHeight = self.instance.size().height() self.listWidth = self.instance.size().width() self.setItemsPerPage() return rc
def applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [ ] for (attrib, value) in self.skinAttributes: if attrib == "TimelineFont": 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 applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [] for (attrib, value) in self.skinAttributes: if attrib == "offset": self.xOffset, self.yOffset = map(int, value.split(",")) else: attribs.append((attrib, value)) self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, screen)
def applySkin(self, desktop, parent): def warningWrongSkinParameter(string): print "[StreamList] wrong '%s' skin parameter" % string def itemHeight(value): self.itemHeight = int(value) def serviceNameFont(value): self.serviceNameFont = parseFont(value, ((1,1),(1,1))) def serviceUrlFont(value): self.serviceUrlFont = parseFont(value, ((1,1),(1,1))) def serviceNamePosition(value): pos = map(int, value.split(',')) if len(pos) == 2: self.serviceNamePosition = pos else: warningWrongSkinParameter(attrib) def serviceNameSize(value): size = map(int, value.split(',')) if len(size) == 2: self.serviceNameSize = size else: warningWrongSkinParameter(attrib) def serviceUrlPosition(value): pos = map(int, value.split(',')) if len(pos) == 2: self.serviceUrlPosition = pos else: warningWrongSkinParameter(attrib) def serviceUrlSize(value): size = map(int, value.split(',')) if len(size) == 2: self.serviceUrlSize = size else: warningWrongSkinParameter(attrib) def iconPosition(value): pos = map(int, value.split(',')) if len(pos) == 2: self.iconPosition = pos else: warningWrongSkinParameter(attrib) def iconSize(value): size = map(int, value.split(',')) if len(size) == 2: self.iconSize = size else: warningWrongSkinParameter(attrib) for (attrib, value) in self.skinAttributes[:]: try: locals().get(attrib)(value) self.skinAttributes.remove((attrib, value)) except: pass self.l.setItemHeight(self.itemHeight) self.l.setFont(0, self.serviceNameFont) self.l.setFont(1, self.serviceUrlFont) return GUIComponent.applySkin(self, desktop, parent)
def applySkin(self, desktop, parent): if self.skinAttributes is None: return False for (attrib, value) in self.skinAttributes: if attrib == "seperation" or attrib == "separation": Log.d("separation=%i" % (int(value), )) self.l.setSeparation(int(value)) elif attrib == "dividerHeight": Log.d("dividerHeight=%i" % (int(value), )) self.l.setDividerHeight(int(value)) return GUIComponent.applySkin(self, desktop, parent)
def applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [] for (attrib, value) in self.skinAttributes: if attrib == "TimelineFont": 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 applySkin(self, desktop, parent): attribs = [] if self.skinAttributes is not None: for (attrib, value) in self.skinAttributes: if attrib == "default": self.default = value else: attribs.append((attrib, value)) self.skinAttributes = attribs res = GUIComponent.applySkin(self, desktop, parent) return res
def applySkin(self, desktop, parent): attribs = [ ] if self.skinAttributes is not None: for (attrib, value) in self.skinAttributes: if attrib == "default": self.default = value else: attribs.append((attrib, value)) self.skinAttributes = attribs res = GUIComponent.applySkin(self, desktop, parent) return res
def applySkin(self, desktop, parent): def warningWrongSkinParameter(string): print("[EPGList] wrong '%s' skin parameters") % string def setEventItemFont(value): self.eventItemFont = parseFont(value, ((1, 1), (1, 1))) def setEventTimeFont(value): self.eventTimeFont = parseFont(value, ((1, 1), (1, 1))) def setIconDistance(value): self.iconDistance = int(value) def setIconShift(value): self.dy = int(value) def setTimeWidth(value): self.tw = int(value) def setColWidths(value): self.col = map(int, value.split(',')) if len(self.col) == 2: self.skinColumns = True else: warningWrongSkinParameter(attrib) def setPiconSize(value): self.piconSize = map(int, value.split(',')) if len(self.piconSize) == 2: self.skinColumns = True else: warningWrongSkinParameter(attrib) def setPiconDistance(value): self.piconDistance = int(value) def setColGap(value): self.colGap = int(value) def setPboxDistance(value): self.pboxDistance = int(value) for (attrib, value) in self.skinAttributes[:]: try: locals().get(attrib)(value) self.skinAttributes.remove((attrib, value)) except: pass self.l.setFont(0, self.eventItemFont) self.l.setFont(1, self.eventTimeFont) return GUIComponent.applySkin(self, desktop, parent)
def applySkin(self, desktop, parent): def warningWrongSkinParameter(string): print("[MovieList] wrong '%s' skin parameters" % string) def font(value): font = skin.parseFont(value, ((1,1),(1,1))) self.fontName = font.family self.fontSize = font.pointSize def partIconeShift(value): self.partIconeShift = int(value) def pbarShift(value): self.pbarShift = int(value) def pbarHeight(value): self.pbarHeight = int(value) def pbarLargeWidth(value): self.pbarLargeWidth = int(value) def pbarColour(value): self.pbarColour = skin.parseColor(value).argb() def pbarColourSeen(value): self.pbarColourSeen = skin.parseColor(value).argb() def pbarColourRec(value): self.pbarColourRec = skin.parseColor(value).argb() def spaceIconeText(value): self.spaceIconeText = int(value) def iconsWidth(value): self.iconsWidth = int(value) def trashShift(value): self.trashShift = int(value) def dirShift(value): self.dirShift = int(value) def spaceRight(value): self.spaceRight = int(value) def durationWidth(value): self.durationWidth = int(value) def dateWidth(value): self.dateWidth = int(value) if config.usage.time.wide.value: self.dateWidth = int(self.dateWidth * 1.15) for (attrib, value) in self.skinAttributes[:]: try: locals().get(attrib)(value) self.skinAttributes.remove((attrib, value)) except: pass rc = GUIComponent.applySkin(self, desktop, parent) self.listHeight = self.instance.size().height() self.listWidth = self.instance.size().width() self.setFontsize() self.setItemsPerPage() return rc
def applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [ ] for (attrib, value) in self.skinAttributes: if attrib == "foregroundColor": self.foreColor = parseColor(value).argb() elif attrib == "backgroundColor": self.backColor = parseColor(value).argb() elif attrib == "font": self.font = parseFont(value, ((1, 1), (1, 1)) ) else: attribs.append((attrib, value)) self.skinAttributes = attribs self.l.setFont(0, self.font) return GUIComponent.applySkin(self, desktop, screen)
def applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [ ] for (attrib, value) in self.skinAttributes: if attrib == "foregroundColor": self.foreColor = parseColor(value).argb() elif attrib == "backgroundColor": self.backColor = parseColor(value).argb() elif attrib == "font": self.font = parseFont(value, ((1, 1), (1, 1)) ) else: attribs.append((attrib,value)) self.skinAttributes = attribs self.l.setFont(0, self.font) return GUIComponent.applySkin(self, desktop, screen)
def applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [] for (attrib, value) in self.skinAttributes: if attrib == "NumberOfRows": self.numberOfRows = int(value) else: attribs.append((attrib, value)) self.skinAttributes = attribs rc = GUIComponent.applySkin(self, desktop, screen) self.listHeight = self.instance.size().height() self.listWidth = self.instance.size().width() self.setFontsize() self.setItemsPerPage() return rc
def applySkin(self, desktop, screen): def foregroundColor(value): self.foreColor = parseColor(value).argb() def backgroundColor(value): self.backColor = parseColor(value).argb() def font(value): self.font = parseFont(value, ((1, 1), (1, 1)) ) for (attrib, value) in list(self.skinAttributes): try: locals().get(attrib)(value) self.skinAttributes.remove((attrib, value)) except: pass self.l.setFont(0, self.font) return GUIComponent.applySkin(self, desktop, screen)
def applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [ ] for (attrib, value) in self.skinAttributes: if attrib == "font": font = skin.parseFont(value, ((1,1),(1,1))) self.fontName = font.family self.fontSize = font.pointSize elif attrib == "itemHeight": self.ItemHeight = int(value) else: attribs.append((attrib,value)) self.skinAttributes = attribs rc = GUIComponent.applySkin(self, desktop, screen) self.setFontsize() self.l.setItemHeight(self.ItemHeight) return rc
def applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [] for (attrib, value) in self.skinAttributes: if attrib == "font": font = skin.parseFont(value, ((1, 1), (1, 1))) self.fontName = font.family self.fontSize = font.pointSize elif attrib == "itemHeight": self.ItemHeight = int(value) else: attribs.append((attrib, value)) self.skinAttributes = attribs rc = GUIComponent.applySkin(self, desktop, screen) self.setFontsize() self.l.setItemHeight(self.ItemHeight) return rc
def applySkin(self, desktop, parent): if self.skinAttributes is not None: attribs = [] for (attrib, value) in self.skinAttributes: if attrib == "font": font = skin.parseFont(value, ((1, 1), (1, 1))) self.fontName = font.family self.fontSize = font.pointSize else: attribs.append((attrib, value)) self.skinAttributes = attribs self.setFontsize() rc = GUIComponent.applySkin(self, desktop, parent) self.listHeight = self.instance.size().height() self.listWidth = self.instance.size().width() self.setItemsPerPage() return rc
def applySkin(self, desktop, screen): def EntryForegroundColor(value): self.foreColor = parseColor(value).argb() def EntryForegroundColorSelected(value): self.foreColorSelected = parseColor(value).argb() def EntryBackgroundColor(value): self.backColor = parseColor(value).argb() def EntryBackgroundColorSelected(value): self.backColorSelected = parseColor(value).argb() def EntryBorderColor(value): self.borderColor = parseColor(value).argb() def EntryItemHeight(value): self.itemHeight = int(value) def ServiceNameForegroundColor(value): self.foreColorService = parseColor(value).argb() def ServiceNameBackgroundColor(value): self.backColorService = parseColor(value).argb() def ServiceFont(value): self.serviceFont = parseFont(value, ((1, 1), (1, 1))) def EntryFont(value): self.entryFont = parseFont(value, ((1, 1), (1, 1))) for (attrib, value) in list(self.skinAttributes): try: locals().get(attrib)(value) self.skinAttributes.remove((attrib, value)) except: pass self.l.setFont(0, self.serviceFont) self.l.setFont(1, self.entryFont) self.l.setItemHeight(self.itemHeight) return GUIComponent.applySkin(self, desktop, screen)
def applySkin(self, desktop, parent): def warningWrongSkinParameter(string): print "[EPGList] wrong '%s' skin parameters" % string def setEventItemFont(value): self.eventItemFont = parseFont(value, ((1,1),(1,1))) def setEventTimeFont(value): self.eventTimeFont = parseFont(value, ((1,1),(1,1))) def setIconDistance(value): self.iconDistance = int(value) def setIconShift(value): self.dy = int(value) def setTimeWidth(value): self.tw = int(value) def setColWidths(value): self.col = map(int, value.split(',')) if len(self.col) == 2: self.skinColumns = True else: warningWrongSkinParameter(attrib) def setPiconSize(value): self.piconSize = map(int, value.split(',')) if len(self.piconSize) == 2: self.skinColumns = True else: warningWrongSkinParameter(attrib) def setPiconDistance(value): self.piconDistance = int(value) def setColGap(value): self.colGap = int(value) def setPboxDistance(value): self.pboxDistance = int(value) for (attrib, value) in self.skinAttributes[:]: try: locals().get(attrib)(value) self.skinAttributes.remove((attrib, value)) except: pass self.l.setFont(0, self.eventItemFont) self.l.setFont(1, self.eventTimeFont) return GUIComponent.applySkin(self, desktop, parent)
def applySkin(self, desktop, parent): attribs = [ ] if self.skinAttributes is not None: attribs = [ ] for (attrib, value) in self.skinAttributes: if attrib == "CoolFont": self.CoolFont = parseFont(value, ((1,1),(1,1))) self.l.setFont(1, self.CoolFont) elif attrib == "CoolDirPos": self.CoolDirPos = int(value) elif attrib == "CoolMoviePos": self.CoolMoviePos = int(value) elif attrib == "CoolMovieSize": self.CoolMovieSize = int(value) elif attrib == "CoolDatePos": self.CoolDatePos = int(value) elif attrib == "CoolTimePos": self.CoolTimePos = int(value) else: attribs.append((attrib, value)) self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, parent)
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).argb() elif attrib == "EntryForegroundColorSelected": self.foreColorSelected = parseColor(value).argb() elif attrib == "EntryBorderColor": self.borderColor = parseColor(value).argb() elif attrib == "EntryBackgroundColor": self.backColor = parseColor(value).argb() elif attrib == "EntryBackgroundColorSelected": self.backColorSelected = parseColor(value).argb() elif attrib == "ServiceNameForegroundColor": self.foreColorService = parseColor(value).argb() elif attrib == "ServiceNameBackgroundColor": self.backColorService = parseColor(value).argb() else: attribs.append((attrib, value)) self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, screen)
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).argb() elif attrib == "EntryForegroundColorSelected": self.foreColorSelected = parseColor(value).argb() elif attrib == "EntryBorderColor": self.borderColor = parseColor(value).argb() elif attrib == "EntryBackgroundColor": self.backColor = parseColor(value).argb() elif attrib == "EntryBackgroundColorSelected": self.backColorSelected = parseColor(value).argb() elif attrib == "ServiceNameForegroundColor": self.foreColorService = parseColor(value).argb() elif attrib == "ServiceNameBackgroundColor": self.backColorService = parseColor(value).argb() else: attribs.append((attrib, value)) self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, screen)
def applySkin(self, desktop, screen): def foregroundColor(value): self.foreColor = parseColor(value).argb() def backgroundColor(value): self.backColor = parseColor(value).argb() def font(value): self.font = parseFont(value, ((1, 1), (1, 1))) def itemHeight(value): self.itemHeight = int(value) for (attrib, value) in list(self.skinAttributes): try: locals().get(attrib)(value) self.skinAttributes.remove((attrib, value)) except: pass self.l.setFont(0, self.font) self.l.setItemHeight(self.itemHeight) return GUIComponent.applySkin(self, desktop, screen)
def applySkin(self, desktop, parent): attribs = [] value_attributes = [ "MVCStartHPos", "MVCSpacer", "MVCMovieHPos", "MVCMovieVPos", "MVCMovieWidth" "MVCIconVPos", "MVCIconHPos", "MVCRecIconVPos", "MVCRecIconHPos", "MVCBarHPos", "MVCBarVPos", "MVCDateHPos", "MVCDateVPos", "MVCDateWidth", "MVCSelNumTxtVPos", "MVCProgressHPos", "MVCProgressVPos", "MVCPiconHPos", "MVCPiconVPos" ] size_attributes = [ "MVCBarSize", "MVCIconSize", "MVCRecIconSize", "MVCPiconSize" ] font_attributes = ["MVCFont", "MVCSelectFont", "MVCDateFont"] color_attributes = [ "TitleColor", "DateColor", "DefaultColor", "BackColor", "BackColorSel", "FrontColorSel", "RecordingColor" ] if self.skinAttributes: for (attrib, value) in self.skinAttributes: if attrib in value_attributes: setattr(self, attrib, int(value)) elif attrib in size_attributes: setattr(self, attrib, parseSize(value, ((1, 1), (1, 1)))) elif attrib in font_attributes: setattr(self, attrib, parseFont(value, ((1, 1), (1, 1)))) elif attrib in color_attributes: setattr(self, attrib, parseColor(value).argb()) else: attribs.append((attrib, value)) self.skinAttributes = attribs self.l.setFont(1, self.MVCFont) self.l.setFont(3, self.MVCSelectFont) self.l.setFont(4, self.MVCDateFont) #print("MVC: MovieCenterGUI: applySkin: attribs: " + str(attribs)) return GUIComponent.applySkin(self, desktop, parent)
def applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [ ] for (attrib, value) in self.skinAttributes: if attrib == "TileFont": font = parseFont(value, ((1,1),(1,1)) ) self.tileFontName = font.family self.tileFontSize = font.pointSize elif attrib == "DateFont": font = parseFont(value, ((1,1),(1,1)) ) self.dateFontName = font.family self.dateFontSize = font.pointSize elif attrib == "DescriptionFont": font = parseFont(value, ((1,1),(1,1)) ) self.descriptionFontName = font.family self.descriptionFontSize = font.pointSize else: attribs.append((attrib,value)) self.skinAttributes = attribs rc = GUIComponent.applySkin(self, desktop, screen) self.listHeight = self.instance.size().height() self.listWidth = self.instance.size().width() self.setItemsPerPage() return rc
def applySkin(self, desktop, parent): GUIComponent.applySkin(self, desktop, parent)
def applySkin(self, desktop, screen): rc = GUIComponent.applySkin(self, desktop, screen) self.listHeight = self.instance.size().height() self.listWidth = self.instance.size().width() self.setItemsPerPage() return rc
def applySkin(self, desktop, screen): def EntryForegroundColor(value): self.foreColor = parseColor(value).argb() def EntryForegroundColorSelected(value): self.foreColorSelected = parseColor(value).argb() def EntryBackgroundColor(value): self.backColor = parseColor(value).argb() def EntryBackgroundColorSelected(value): self.backColorSelected = parseColor(value).argb() def EntryBorderColor(value): self.borderColor = parseColor(value).argb() def EntryFont(value): font = parseFont(value, ((1,1),(1,1)) ) self.entryFontName = font.family self.entryFontSize = font.pointSize def ServiceForegroundColor(value): self.foreColorService = parseColor(value).argb() def ServiceNameForegroundColor(value): self.foreColorService = parseColor(value).argb() def ServiceForegroundColorSelected(value): self.foreColorServiceSelected = parseColor(value).argb() def ServiceBackgroundColor(value): self.backColorService = parseColor(value).argb() def ServiceNameBackgroundColor(value): self.backColorService = parseColor(value).argb() def ServiceBackgroundColorSelected(value): self.backColorServiceSelected = parseColor(value).argb() def ServiceBackgroundColorRecording(value): self.backColorRec = parseColor(value).argb() def ServiceNameBackgroundColor(value): self.backColorRec = parseColor(value).argb() def ServiceForegroundColorRecording(value): self.foreColorRec = parseColor(value).argb() def ServiceBorderColor(value): self.borderColorService = parseColor(value).argb() def ServiceFont(value): self.serviceFont = parseFont(value, ((1,1),(1,1)) ) def EntryBackgroundColorNow(value): self.backColorNow = parseColor(value).argb() def EntryForegroundColorNow(value): self.foreColorNow = parseColor(value).argb() def ServiceBorderWidth(value): self.serviceBorderWidth = int(value) def ServiceNamePadding(value): self.serviceNamePadding = int(value) def EventBorderWidth(value): self.eventBorderWidth = int(value) def EventNamePadding(value): self.eventNamePadding = int(value) for (attrib, value) in list(self.skinAttributes): try: locals().get(attrib)(value) self.skinAttributes.remove((attrib, value)) except: pass self.l.setFont(0, self.serviceFont) self.setEventFontsize() rc = GUIComponent.applySkin(self, desktop, screen) # now we know our size and can safely set items per page self.listHeight = self.instance.size().height() self.listWidth = self.instance.size().width() self.setItemsPerPage() return rc
def applySkin(self, desktop, parent): GUIComponent.applySkin(self, desktop, parent) self.applyTemplate()