def __init__(self, withTimer = True): GUIComponent.__init__(self) self.setConnect(None) if withTimer: self.conditionCheckTimer = eTimer() self.conditionCheckTimer.callback.append(self.update) self.conditionCheckTimer.start(1000)
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, text = '', onClick = None): if not onClick: onClick = [] GUIComponent.__init__(self) VariableText.__init__(self) self.setText(text) self.onClick = onClick
def __init__(self, root, sort_type=None, descr_state=None): GUIComponent.__init__(self) self.list = [] self.descr_state = descr_state or self.HIDE_DESCRIPTION self.sort_type = sort_type or self.SORT_RECORDED self.firstFileEntry = 0 self.parentDirectory = 0 self.fontName = "Regular" self.fontSize = 20 self.listHeight = None self.listWidth = None self.reloadDelayTimer = None self.l = eListboxPythonMultiContent() self.tags = set() self.root = None self._playInBackground = None self._char = '' if root is not None: self.reload(root) self.l.setBuildFunc(self.buildMovieListEntry) self.onSelectionChanged = [ ] self.iconPart = [] for part in range(5): self.iconPart.append(LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/part_%d_4.png" % part))) self.iconMovieRec = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/part_new.png")) self.iconMoviePlay = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/movie_play.png")) self.iconMoviePlayRec = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/movie_play_rec.png")) self.iconUnwatched = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/part_unwatched.png")) self.iconFolder = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/folder.png")) self.iconTrash = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/trashcan.png")) self.runningTimers = {} self.updateRecordings()
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): GUIComponent.__init__(self) self.l = eListboxServiceContent() pic = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/folder.png")) if pic: self.l.setPixmap(self.l.picFolder, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/marker.png")) if pic: self.l.setPixmap(self.l.picMarker, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "ico_dvb_s-fs8.png")) if pic: self.l.setPixmap(self.l.picDVB_S, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "ico_dvb_c-fs8.png")) if pic: self.l.setPixmap(self.l.picDVB_C, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "ico_dvb_t-fs8.png")) if pic: self.l.setPixmap(self.l.picDVB_T, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "ico_service_group-fs8.png")) if pic: self.l.setPixmap(self.l.picServiceGroup, pic) self.root = None self.mode = self.MODE_NORMAL self.ItemHeight = 28 self.ServiceNameFont = parseFont("Regular;22", ((1,1),(1,1))) self.ServiceInfoFont = parseFont("Regular;18", ((1,1),(1,1))) self.ServiceNumberFont = parseFont("Regular;20", ((1,1),(1,1))) self.onSelectionChanged = [ ]
def __init__(self, path, type, update = True): GUIComponent.__init__(self) VariableText.__init__(self) self.type = type self.path = path if update: self.update()
def __init__(self, root, list_type=None, sort_type=None, descr_state=None): GUIComponent.__init__(self) self.list_type = list_type or self.LISTTYPE_MINIMAL self.descr_state = descr_state or self.HIDE_DESCRIPTION self.sort_type = sort_type or self.SORT_RECORDED self.firstFileEntry = 0 self.fontName = "Regular" self.fontSizesOriginal = (22,18,16) self.fontSizesCompact = (20,14) self.fontSizesMinimal = (20,16) self.itemHeights = (75,37,25) self.reloadDelayTimer = None self.l = eListboxPythonMultiContent() self.tags = set() if root is not None: self.reload(root) self.l.setBuildFunc(self.buildMovieListEntry) self.onSelectionChanged = [ ] self.iconPart = [] for part in range(5): self.iconPart.append(LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/part_%d_4.png" % part))) self.iconMovieRec = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/part_new.png")) self.iconUnwatched = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/part_unwatched.png")) self.iconFolder = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/folder.png")) self.iconTrash = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/trashcan.png")) self.runningTimers = {} self.updateRecordings()
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 __init__(self): VariableText.__init__(self) GUIComponent.__init__(self) self.doClock() self.clockTimer = eTimer() self.clockTimer.callback.append(self.doClock)
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 __init__(self, list, enableWrapAround=False, content=eListboxPythonStringContent): GUIComponent.__init__(self) self.list = list self.l = content() self.l.setList(self.list) self.onSelectionChanged = [ ] self.enableWrapAround = enableWrapAround
def __init__(self, serviceList): self.serviceList = serviceList GUIComponent.__init__(self) self.l = eListboxServiceContent() pic = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/folder.png")) pic and self.l.setPixmap(self.l.picFolder, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/marker.png")) pic and self.l.setPixmap(self.l.picMarker, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/ico_dvb_s.png")) pic and self.l.setPixmap(self.l.picDVB_S, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/ico_dvb_c.png")) pic and self.l.setPixmap(self.l.picDVB_C, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/ico_dvb_t.png")) pic and self.l.setPixmap(self.l.picDVB_T, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/ico_stream.png")) pic and self.l.setPixmap(self.l.picStream, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/ico_service_group.png")) pic and self.l.setPixmap(self.l.picServiceGroup, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/icon_crypt.png")) pic and self.l.setPixmap(self.l.picCrypto, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/record.png")) pic and self.l.setPixmap(self.l.picRecord, pic) self.root = None self.mode = self.MODE_NORMAL self.ItemHeight = 28 self.ServiceNameFont = parseFont("Regular;22", ((1,1),(1,1))) self.ServiceInfoFont = parseFont("Regular;18", ((1,1),(1,1))) self.ServiceNumberFont = parseFont("Regular;20", ((1,1),(1,1))) self.progressBarWidth = 52 self.progressPercentWidth = 0 self.fieldMargins = 10 self.onSelectionChanged = [ ]
def __init__(self, text=""): GUIComponent.__init__(self) self.message = text self.instance = None self.long_text = None self.scrollbar = None self.pages = None self.total = None
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, navcore, eventmap): GUIComponent.__init__(self) VariableValue.__init__(self) PerServiceBase.__init__(self, navcore, eventmap) self.eventmap = eventmap self.navcore = navcore self.navcore.event.append(self.event) self.event(iPlayableService.evEnd)
def __init__(self, withTimer = True): GUIComponent.__init__(self) self.setConnect(None) if (withTimer): self.conditionCheckTimer = eTimer() self.conditionCheckTimer_conn = self.conditionCheckTimer.timeout.connect(self.update) self.conditionCheckTimer.start(1000)
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]) if name is not None: break # 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" entry.extend(( (eListboxPythonMultiContent.TYPE_TEXT, 0, 0, 600, 26, 0, 0, help[0]), (eListboxPythonMultiContent.TYPE_TEXT, 0, 28, 600, 20, 1, 0, help[1]) )) else: entry.append( (eListboxPythonMultiContent.TYPE_TEXT, 0, 0, 600, 28, 0, 0, help) ) l.append(entry) self.l.setList(l) if self.extendedHelp is True: self.l.setFont(0, gFont("Regular", 24)) self.l.setFont(1, gFont("Regular", 18)) self.l.setItemHeight(50) else: self.l.setFont(0, gFont("Regular", 24)) self.l.setItemHeight(38)
def __init__(self, list, session = None): GUIComponent.__init__(self) self.l = eListboxPythonConfigContent() self.l.setSeperation(200) self.timer = eTimer() self.list = list self.onSelectionChanged = [ ] self.current = None self.session = session
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: 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]) if name is not None: break 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,400,26)) x1,y1,w1,h1 = skin.parameters.get("HelpMenuListExtHlp1", (0,28,400,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", (10,4,750,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, size = skin.parameters.get("HelpMenuListExtendedFont0", ('Regular', 24)) self.l.setFont(0, gFont(font, size)) font, size = skin.parameters.get("HelpMenuListExtendedFont1", ('Regular', 18)) self.l.setFont(1, gFont(font, size)) self.l.setItemHeight(int(skin.parameters.get("HelpMenuListExtendedItemHeight", (50,))[0])) else: font, size = skin.parameters.get("HelpMenuListFont0", ('Regular', 24)) self.l.setFont(0, gFont(font, size)) self.l.setItemHeight(int(skin.parameters.get("HelpMenuListItemHeight", (38,))[0]))
def __init__(self, list, session = None): GUIComponent.__init__(self) self.l = eListboxPythonConfigContent() seperation, = skin.parameters.get("ConfigListSeperator", (200, )) self.l.setSeperation(seperation) self.timer = eTimer() self.list = list self.onSelectionChanged = [ ] self.current = None self.session = session
def __init__(self, list, session = None): GUIComponent.__init__(self) self.l = eListboxPythonConfigContent() self.l.setSeperation(200) self.timer = eTimer() self.list = list self.onSelectionChanged = [ ] self.current = None self.session = session self.vumachine = file("/proc/stb/info/vumodel").read().strip()
def __init__(self, type, servicefkt = None, frontendfkt = None, statusDict = None): GUIComponent.__init__(self) self.instance = None self.message = None self.value = None self.servicefkt = servicefkt self.frontendfkt = frontendfkt self.statusDict = statusDict self.type = type self.update()
def __init__(self, navcore, eventmap): GUIComponent.__init__(self) VariableValue.__init__(self) PerServiceBase.__init__(self, navcore, eventmap) self.eventmap = eventmap self.navcore = navcore self.navcore.event.append(self.event) # start with stopped state, so simulate that self.event(iPlayableService.evEnd)
def __init__(self, serviceList): self.serviceList = serviceList GUIComponent.__init__(self) self.l = eListboxServiceContent() pic = LoadPixmap(cached=True, path=resolveFilename(SCOPE_ACTIVE_SKIN, "icons/folder.png")) if pic: self.l.setPixmap(self.l.picFolder, pic) pic = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/marker.png")) if pic: self.l.setPixmap(self.l.picMarker, pic) pic = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/ico_dvb-s.png")) if pic: self.l.setPixmap(self.l.picDVB_S, pic) pic = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/ico_dvb-c.png")) if pic: self.l.setPixmap(self.l.picDVB_C, pic) pic = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/ico_dvb-t.png")) if pic: self.l.setPixmap(self.l.picDVB_T, pic) pic = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/ico_stream.png")) if pic: self.l.setPixmap(self.l.picStream, pic) pic = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/ico_service_group.png")) if pic: self.l.setPixmap(self.l.picServiceGroup, pic) pic = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/icon_crypt.png")) if pic: self.l.setPixmap(self.l.picCrypto, pic) pic = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/record.png")) if pic: self.l.setPixmap(self.l.picRecord, pic) self.root = None self.mode = self.MODE_NORMAL self.listHeight = None self.listWidth = None self.ServiceNumberFontName = "Regular" self.ServiceNumberFontSize = 20 self.ServiceNameFontName = "Regular" self.ServiceNameFontSize = 22 self.ServiceInfoFontName = "Regular" self.ServiceInfoFontSize = 18 self.progressBarWidth = config.usage.serviceinfo_progressBarWidth.value self.fieldMargins = 10 self.onSelectionChanged = [ ]
def __init__(self, list, enableWrapAround=False, content=eListboxPythonStringContent, mode=eListbox.layoutVertical, itemSize=0, itemWidth=0, itemHeight=0): GUIComponent.__init__(self) self.list = list self.l = content() self.l.setList(self.list) self.onSelectionChanged = [ ] self.enableWrapAround = enableWrapAround self._mode = mode self._itemSize = itemSize self._itemWidth = itemWidth self._itemHeight = itemHeight
def __init__(self, helplist, callback): GUIComponent.__init__(self) self.onSelChanged = [ ] self.l = eListboxPythonMultiContent() self.callback = callback self.extendedHelp = False l = [ ] sizes = componentSizes[componentSizes.HELP_MENU_LIST] textX = sizes.get("textX", 5) textY = sizes.get("textY", 35) textWidth = sizes.get("textWidth", 1000) textHeight = sizes.get("textHeight", 35) for (actionmap, context, actions) in helplist: if not actionmap.enabled: continue for (action, help) in actions: 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]) if name is not None: break 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" entry.extend(( (eListboxPythonMultiContent.TYPE_TEXT, 0, 0, textWidth, textHeight, 0, RT_VALIGN_CENTER, help[0]), (eListboxPythonMultiContent.TYPE_TEXT, 0, textY, textWidth, textHeight, 1, RT_VALIGN_CENTER, help[1]) )) else: entry.append( (eListboxPythonMultiContent.TYPE_TEXT, textX, 0, textWidth, textHeight, 0, RT_VALIGN_CENTER, help) ) l.append(entry) self.l.setList(l) tlf = TemplatedListFonts() self.l.setFont(0, gFont(tlf.face(tlf.BIG), tlf.size(tlf.BIG))) self.l.setFont(1, gFont(tlf.face(tlf.MEDIUM), tlf.size(tlf.MEDIUM))) self.l.setItemHeight(sizes.get(componentSizes.ITEM_HEIGHT, 30))
def __init__(self, root, sort_type=None, descr_state=None): GUIComponent.__init__(self) self.list = [] self.screenwidth = getDesktop(0).size().width() self.descr_state = descr_state or self.HIDE_DESCRIPTION self.sort_type = sort_type or self.SORT_GROUPWISE self.firstFileEntry = 0 self.parentDirectory = 0 self.fontName = "Regular" if self.screenwidth and self.screenwidth == 1920: self.fontSize = 28 else: self.fontSize = 20 self.listHeight = None self.listWidth = None self.pbarShift = 5 self.pbarHeight = 16 self.pbarLargeWidth = 48 self.pbarColour = 0x206333 self.pbarColourSeen = 0xFFC71D self.pbarColourRec = 0xFF001D self.partIconeShift = 5 self.spaceRight = 2 self.spaceIconeText = 2 self.iconsWidth = 22 self.trashShift = 1 self.dirShift = 1 self.columns = (180, 200) self.reloadDelayTimer = None self.l = eListboxPythonMultiContent() self.tags = set() self.root = None self._playInBackground = None self._playInForeground = None self._char = "" if root is not None: self.reload(root) self.l.setBuildFunc(self.buildMovieListEntry) self.onSelectionChanged = [] self.iconPart = [] for part in range(5): self.iconPart.append(LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/part_%d_4.png" % part))) self.iconMovieRec = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/part_new.png")) self.iconMoviePlay = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/movie_play.png")) self.iconMoviePlayRec = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/movie_play_rec.png")) self.iconUnwatched = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/part_unwatched.png")) self.iconFolder = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/folder.png")) self.iconTrash = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/trashcan.png")) self.runningTimers = {} self.updateRecordings() self.updatePlayPosCache()
def __init__(self, text=""): GUIComponent.__init__(self) self.message = text self.instance = None self.long_text = None self.right_text = None self.scrollbar = None self.pages = None self.total = None self.split = False self.splitchar = "|" self.column = 0
def __init__(self, text = '', maxSize = False, visible_width = False, type = TEXT, currPos = 0, allMarked = True): NumericalTextInput.__init__(self, self.right) GUIComponent.__init__(self) VariableText.__init__(self) self.type = type self.allmarked = allMarked and text != '' and type != self.PIN self.maxSize = maxSize self.currPos = currPos self.visible_width = visible_width self.offset = 0 self.overwrite = maxSize self.setText(text)
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)) 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.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, serviceList): self.serviceList = serviceList GUIComponent.__init__(self) self.l = eListboxServiceContent() pic = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/folder.png")) if pic: self.l.setPixmap(self.l.picFolder, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/marker.png")) if pic: self.l.setPixmap(self.l.picMarker, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/ico_dvb_s-fs8.png")) if pic: self.l.setPixmap(self.l.picDVB_S, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/ico_dvb_c-fs8.png")) if pic: self.l.setPixmap(self.l.picDVB_C, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/ico_dvb_t-fs8.png")) if pic: self.l.setPixmap(self.l.picDVB_T, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/ico_stream-fs8.png")) if pic: self.l.setPixmap(self.l.picStream, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/ico_service_group-fs8.png")) if pic: self.l.setPixmap(self.l.picServiceGroup, pic) self.root = None self.mode = self.MODE_NORMAL self.ItemHeight = 28 self.ServiceNameFont = parseFont("Regular;22", ((1,1),(1,1))) self.ServiceInfoFont = parseFont("Regular;18", ((1,1),(1,1))) self.ServiceNumberFont = parseFont("Regular;20", ((1,1),(1,1))) self.onSelectionChanged = [ ]
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.itemHeight = 50 self.rowSplit = 25 self.iconMargin = 4 self.satPosLeft = 160 self.backupColor = self.backupColorSel = 0x00CCAC68 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 __init__(self, root, list_type=None, sort_type=None, descr_state=None): GUIComponent.__init__(self) self.list_type = list_type or self.LISTTYPE_ORIGINAL self.descr_state = descr_state or self.HIDE_DESCRIPTION self.sort_type = sort_type or self.SORT_RECORDED self.fontName = "Regular" self.fontSizesOriginal = (22, 18, 16) self.fontSizesCompact = (20, 14) self.fontSizesMinimal = (20, 16) self.itemHeights = (75, 37, 25) self.l = eListboxPythonMultiContent() self.tags = set() if root is not None: self.reload(root) # self.redrawList() self.l.setBuildFunc(self.buildMovieListEntry) self.onSelectionChanged = []
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.itemHeight = 50 self.rowSplit = 25 self.iconMargin = 4 self.satPosLeft = 160 self.iconWait = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, 'icons/timer_wait.png')) self.iconWidth = self.iconWait.size().width() self.iconHeight = self.iconWait.size().height() self.iconRecording = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, 'icons/timer_rec.png')) self.iconPrepared = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, 'icons/timer_prep.png')) self.iconDone = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, 'icons/timer_done.png')) self.iconRepeat = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, 'icons/timer_rep.png')) self.iconZapped = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, 'icons/timer_zap.png')) self.iconDisabled = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, 'icons/timer_off.png')) self.iconFailed = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, 'icons/timer_failed.png'))
def __init__(self): GUIComponent.__init__(self) self.l = eListboxServiceContent() pic = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/folder.png")) if pic: self.l.setPixmap(self.l.picFolder, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/marker.png")) if pic: self.l.setPixmap(self.l.picMarker, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "ico_dvb_s-fs8.png")) if pic: self.l.setPixmap(self.l.picDVB_S, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "ico_dvb_c-fs8.png")) if pic: self.l.setPixmap(self.l.picDVB_C, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "ico_dvb_t-fs8.png")) if pic: self.l.setPixmap(self.l.picDVB_T, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "ico_service_group-fs8.png")) if pic: self.l.setPixmap(self.l.picServiceGroup, pic) self.root = None self.mode = self.MODE_NORMAL self.listHeight = None self.listWidth = None self.ServiceNumberFontName = "Regular" self.ServiceNumberFontSize = 20 self.ServiceNameFontName = "Regular" self.ServiceNameFontSize = 22 self.ServiceInfoFontName = "Regular" self.ServiceInfoFontSize = 18 self.onSelectionChanged = [ ]
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 __init__(self, root, sort_type=None, descr_state=None): GUIComponent.__init__(self) self.list = [] self.descr_state = descr_state or self.HIDE_DESCRIPTION self.sort_type = sort_type or self.SORT_RECORDED self.firstFileEntry = 0 self.parentDirectory = 0 self.fontName = "Regular" self.fontSize = 20 self.listHeight = None self.listWidth = None self.reloadDelayTimer = None self.l = eListboxPythonMultiContent() self.tags = set() self.root = None self.list = None self._playInBackground = None self._playInForeground = None self._char = '' if root is not None: self.reload(root) self.l.setBuildFunc(self.buildMovieListEntry) self.onSelectionChanged = [ ] self.iconPart = [] for part in range(5): self.iconPart.append(LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/part_%d_4.png" % part))) self.iconMovieRec = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/part_new.png")) self.iconMoviePlay = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/movie_play.png")) self.iconMoviePlayRec = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/movie_play_rec.png")) self.iconUnwatched = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/part_unwatched.png")) self.iconFolder = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/folder.png")) self.iconTrash = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/trashcan.png")) self.runningTimers = {} self.updateRecordings() self.updatePlayPosCache()
def applySkin(self, desktop, parent): def warningWrongSkinParameter(string): print "[MovieList] wrong '%s' skin parameters" % string def fontName(value): self.fontName = value def fontSizesOriginal(value): self.fontSizesOriginal = map(int, value.split(",")) if len(self.fontSizesOriginal) != 3: warningWrongSkinParameter(attrib) def fontSizesCompact(value): self.fontSizesCompact = map(int, value.split(",")) if len(self.fontSizesCompact) != 2: warningWrongSkinParameter(attrib) def fontSizesMinimal(value): self.fontSizesMinimal = map(int, value.split(",")) if len(self.fontSizesMinimal) != 2: warningWrongSkinParameter(attrib) def itemHeights(value): self.itemHeights = map(int, value.split(",")) if len(self.itemHeights) != 3: warningWrongSkinParameter(attrib) def columnsOriginal(value): self.columnsOriginal = map(int, value.split(",")) if len(self.columnsOriginal) != 2: warningWrongSkinParameter(attrib) def columnsCompactDescription(value): self.columnsCompactDescription = map(int, value.split(",")) if len(self.columnsCompactDescription) != 3: warningWrongSkinParameter(attrib) def compactColumn(value): self.compactColumn = map(int, value.split(",")) if len(self.compactColumn) != 2: warningWrongSkinParameter(attrib) for (attrib, value) in self.skinAttributes[:]: try: locals().get(attrib)(value) self.skinAttributes.remove((attrib, value)) except: pass self.redrawList() return GUIComponent.applySkin(self, desktop, parent)
def __init__(self, serviceList): self.serviceList = serviceList GUIComponent.__init__(self) self.l = eListboxServiceContent() pic = LoadPixmap(cached=True, path=resolveFilename(SCOPE_ACTIVE_SKIN, 'icons/folder.png')) pic and self.l.setPixmap(self.l.picFolder, pic) pic = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, 'icons/marker.png')) pic and self.l.setPixmap(self.l.picMarker, pic) pic = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, 'icons/ico_dvb-s.png')) pic and self.l.setPixmap(self.l.picDVB_S, pic) pic = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, 'icons/ico_dvb-c.png')) pic and self.l.setPixmap(self.l.picDVB_C, pic) pic = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, 'icons/ico_dvb-t.png')) pic and self.l.setPixmap(self.l.picDVB_T, pic) pic = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, 'icons/ico_stream.png')) pic and self.l.setPixmap(self.l.picStream, pic) pic = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, 'icons/ico_service_group.png')) pic and self.l.setPixmap(self.l.picServiceGroup, pic) pic = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, 'icons/icon_crypt.png')) pic and self.l.setPixmap(self.l.picCrypto, pic) pic = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, 'icons/record.png')) pic and self.l.setPixmap(self.l.picRecord, pic) self.root = None self.mode = self.MODE_NORMAL self.listHeight = None self.listWidth = None self.ServiceNumberFontName = 'Regular' self.ServiceNumberFontSize = 20 self.ServiceNameFontName = 'Regular' self.ServiceNameFontSize = 22 self.ServiceInfoFontName = 'Regular' self.ServiceInfoFontSize = 18 self.progressBarWidth = 52 self.progressPercentWidth = 0 self.fieldMargins = 10 self.onSelectionChanged = [] return
def __init__(self, root, list_type=None, sort_type=None, descr_state=None): GUIComponent.__init__(self) self.list = [] self.list_type = list_type or self.LISTTYPE_MINIMAL self.descr_state = descr_state or self.HIDE_DESCRIPTION self.sort_type = sort_type or self.SORT_RECORDED self.firstFileEntry = 0 self.parentDirectory = 0 self.fontName = "Regular" self.fontSizesOriginal = (22,18,16) self.fontSizesCompact = (20,14) self.fontSizesMinimal = (20,16) self.itemHeights = (75,37,25) self.reloadDelayTimer = None self.l = eListboxPythonMultiContent() self.tags = set() self.root = None self._playInBackground = None self._char = '' if root is not None: self.reload(root) self.l.setBuildFunc(self.buildMovieListEntry) self.onSelectionChanged = [ ] self.iconPart = [] for part in range(5): self.iconPart.append(LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/part_%d_4.png" % part))) self.iconMovieRec = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/part_new.png")) self.iconMoviePlay = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/movie_play.png")) self.iconMoviePlayRec = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/movie_play_rec.png")) self.iconUnwatched = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/part_unwatched.png")) self.iconFolder = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/folder.png")) self.iconTrash = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/trashcan.png")) self.runningTimers = {} self.updateRecordings()
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 __init__(self, text=''): GUIComponent.__init__(self) self.step = 1 self.steptime = 40 self.startdelay = 3000 self._position = ePoint(0, 0) self._size = eSize(0, 0) self.animation = False self.astartdelay = 3000 self.aposition = ePoint(0, 0) self.asize = eSize(0, 0) self.message = text self.instance = None self.long_text = None self.right_text = None self.text_height = 0 self.page_height = 0 self.scrollbar = None self.pages = None self.total = None self.split = False self.splitchar = '|' self.column = 0 self.lineheight = None self.scrollbarmode = 'showOnDemand' self.autoScroll = False self.updateTimer = eTimer() self.updateTimer.callback.append(self.lineScroll) self.aupdateTimer = eTimer() self.aupdateTimer.callback.append(self.animationLabel) self.onAnimationEnd = [] self.onAnimationEnd.append(self._animationEnd) self.widget_attribs = [] self.longtext_attribs = [] self.scrollbar_attribs = [] return
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(50) self.l.setList(list) self.iconWait = LoadPixmap( resolveFilename(SCOPE_ACTIVE_SKIN, "icons/timer_wait.png")) self.iconRecording = LoadPixmap( resolveFilename(SCOPE_ACTIVE_SKIN, "icons/timer_rec.png")) self.iconPrepared = LoadPixmap( resolveFilename(SCOPE_ACTIVE_SKIN, "icons/timer_prep.png")) self.iconDone = LoadPixmap( resolveFilename(SCOPE_ACTIVE_SKIN, "icons/timer_done.png")) self.iconRepeat = LoadPixmap( resolveFilename(SCOPE_ACTIVE_SKIN, "icons/timer_rep.png")) self.iconZapped = LoadPixmap( resolveFilename(SCOPE_ACTIVE_SKIN, "icons/timer_zap.png")) self.iconDisabled = LoadPixmap( resolveFilename(SCOPE_ACTIVE_SKIN, "icons/timer_off.png")) self.iconFailed = LoadPixmap( resolveFilename(SCOPE_ACTIVE_SKIN, "icons/timer_failed.png"))
def __init__(self, serviceList): self.serviceList = serviceList GUIComponent.__init__(self) self.l = eListboxServiceContent() pic = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "icons/folder.png")) pic and self.l.setPixmap(self.l.picFolder, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "icons/marker.png")) pic and self.l.setPixmap(self.l.picMarker, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "icons/ico_dvb_s.png")) pic and self.l.setPixmap(self.l.picDVB_S, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "icons/ico_dvb_c.png")) pic and self.l.setPixmap(self.l.picDVB_C, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "icons/ico_dvb_t.png")) pic and self.l.setPixmap(self.l.picDVB_T, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "icons/ico_stream.png")) pic and self.l.setPixmap(self.l.picStream, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "icons/ico_service_group.png")) pic and self.l.setPixmap(self.l.picServiceGroup, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "icons/icon_crypt.png")) pic and self.l.setPixmap(self.l.picCrypto, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "icons/record.png")) pic and self.l.setPixmap(self.l.picRecord, pic) self.root = None self.mode = self.MODE_NORMAL self.ItemHeight = 28 self.ServiceNameFont = parseFont("Regular;22", ((1, 1), (1, 1))) self.ServiceInfoFont = parseFont("Regular;18", ((1, 1), (1, 1))) self.ServiceNextInfoFont = parseFont("Regular;15", ((1, 1), (1, 1))) self.ServiceNumberFont = parseFont("Regular;20", ((1, 1), (1, 1))) self.progressBarWidth = 52 self.progressPercentWidth = 0 self.fieldMargins = 10 self.onSelectionChanged = []
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 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): def setEventItemFont(value): self.eventItemFont = parseFont(value, ((1, 1), (1, 1))) def setEventTimeFont(value): self.eventTimeFont = parseFont(value, ((1, 1), (1, 1))) for (attrib, value) in [ x for x in self.skinAttributes if x[0] in dir() and callable(locals().get(x[0])) ]: locals().get(attrib)(value) self.skinAttributes.remove((attrib, value)) 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 == "foregroundColorMarked": self.l.setColor(eListboxServiceContent.markedForeground, parseColor(value)) elif attrib == "foregroundColorMarkedSelected": self.l.setColor(eListboxServiceContent.markedForegroundSelected, parseColor(value)) elif attrib == "backgroundColorMarked": self.l.setColor(eListboxServiceContent.markedBackground, parseColor(value)) elif attrib == "backgroundColorMarkedSelected": self.l.setColor(eListboxServiceContent.markedBackgroundSelected, parseColor(value)) elif attrib == "foregroundColorServiceNotAvail": self.l.setColor(eListboxServiceContent.serviceNotAvail, parseColor(value)) elif attrib == "foregroundColorEvent" or attrib == "colorServiceDescription": self.l.setColor(eListboxServiceContent.eventForeground, parseColor(value)) elif attrib == "foregroundColorEventSelected" or attrib == "colorServiceDescriptionSelected": self.l.setColor(eListboxServiceContent.eventForegroundSelected, parseColor(value)) elif attrib == "foregroundColorEventborder": self.l.setColor(eListboxServiceContent.eventborderForeground, parseColor(value)) elif attrib == "foregroundColorEventborderSelected": self.l.setColor(eListboxServiceContent.eventborderForegroundSelected, parseColor(value)) elif attrib == "colorEventProgressbar": self.l.setColor(eListboxServiceContent.serviceEventProgressbarColor, parseColor(value)) elif attrib == "colorEventProgressbarSelected": self.l.setColor(eListboxServiceContent.serviceEventProgressbarColorSelected, parseColor(value)) elif attrib == "colorEventProgressbarBorder": self.l.setColor(eListboxServiceContent.serviceEventProgressbarBorderColor, parseColor(value)) elif attrib == "colorEventProgressbarBorderSelected": self.l.setColor(eListboxServiceContent.serviceEventProgressbarBorderColorSelected, parseColor(value)) elif attrib == "picServiceEventProgressbar": pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, value)) if pic: self.l.setPixmap(self.l.picServiceEventProgressbar, pic) elif attrib == "serviceItemHeight": self.ItemHeight = int(value) elif attrib == "serviceNameFont": self.ServiceNameFont = parseFont(value, ((1,1),(1,1))) elif attrib == "serviceInfoFont": self.ServiceInfoFont = parseFont(value, ((1,1),(1,1))) elif attrib == "serviceNumberFont": self.ServiceNumberFont = parseFont(value, ((1,1),(1,1))) else: attribs.append((attrib, value)) self.skinAttributes = attribs 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 == "UnwatchedColor": self.UnwatchedColor = parseColor(value).argb() elif attrib == "WatchingColor": self.WatchingColor = parseColor(value).argb() elif attrib == "FinishedColor": self.FinishedColor = parseColor(value).argb() elif attrib == "RecordingColor": self.RecordingColor = parseColor(value).argb() elif attrib == "SelectedColor": self.SelectedColor = parseColor(value).argb() else: attribs.append((attrib, value)) 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 setFont(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.serviceNameFont) self.l.setFont(1, self.font) self.l.setItemHeight(self.itemHeight) return GUIComponent.applySkin(self, desktop, parent)
def applySkin(self, desktop, screen): # catch any "text" attribute setting so that it's properly applied if self.skinAttributes is not None and "text" in self.skinAttributes: self.__initText = _(self.skinAttributes["text"]) del self.skinAttributes["text"] retval = GUIComponent.applySkin(self, desktop, screen) # Test for whether self.__initText exists with a saved # initial ot skin text value. If it does, now use it to set # the instance's text value back to its intended value. # hasattr(self, "_DummySource__initText") tests # for self.__initText. if hasattr(self, "_DummySource__initText"): self.text = self.__initText del self.__initText return retval
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, 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 setColGap(value): self.colGap = 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, screen): if self.skinAttributes is not None: skin_path_prefix = getattr(screen, 'skin_path', path) attribs = [] for attrib, value in self.skinAttributes: if attrib == 'pixmaps': index = 0 pixmaps = value.split(',') for p in pixmaps: self.instance.setPixmap( loadPixmap( resolveFilename(SCOPE_CURRENT_SKIN, p, path_prefix=skin_path_prefix), desktop), index, 0) index += 1 else: attribs.append((attrib, value)) self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, screen)
def applySkin(self, desktop, parent): def itemHeight(value): self.itemHeight = parseScale(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 = parseScale(value) def iconMargin(value): self.iconMargin = parseScale(value) def satPosLeft(value): self.satPosLeft = parseScale(value) def backupColor(value): self.backupColor = int(value) def backupColorSel(value): self.backupColorSel = 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 == "foregroundColor": self.foreColor = parseColor(value).argb() elif attrib == "borderColor": self.borderColor = parseColor(value).argb() elif attrib == "backgroundColor": self.backColor = parseColor(value).argb() elif attrib == "font": self.l.setFont(0, parseFont(value, ((1,1),(1,1)) )) elif attrib == "borderWidth": self.borderWidth = int(value) elif attrib == "TimelineFont": font = parseFont(value, ((1,1),(1,1)) ) self.timelineFontName = font.family self.timelineFontSize = font.pointSize else: attribs.append((attrib,value)) self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, screen)
def applySkin(self, desktop, parent): def warningWrongSkinParameter(string): print "[MovieList] wrong '%s' skin parameters" % string def fontName(value): self.fontName = value def fontSizesOriginal(value): self.fontSizesOriginal = map(int, value.split(",")) if len(self.fontSizesOriginal) != 3: warningWrongSkinParameter(attrib) def fontSizesCompact(value): self.fontSizesCompact = map(int, value.split(",")) if len(self.fontSizesCompact) != 2: warningWrongSkinParameter(attrib) def fontSizesMinimal(value): self.fontSizesMinimal = map(int, value.split(",")) if len(self.fontSizesMinimal) != 2: warningWrongSkinParameter(attrib) def itemHeights(value): self.itemHeights = map(int, value.split(",")) if len(self.itemHeights) != 3: warningWrongSkinParameter(attrib) def pbarShift(value): self.pbarShift = int(value) def pbarHeight(value): self.pbarHeight = int(value) def pbarLargeWidth(value): self.pbarLargeWidth = int(value) def partIconeShiftMinimal(value): self.partIconeShiftMinimal = int(value) def partIconeShiftCompact(value): self.partIconeShiftCompact = int(value) def partIconeShiftOriginal(value): self.partIconeShiftOriginal = int(value) 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 columnsOriginal(value): self.columnsOriginal = map(int, value.split(",")) if len(self.columnsOriginal) != 2: warningWrongSkinParameter(attrib) def columnsCompactDescription(value): self.columnsCompactDescription = map(int, value.split(",")) if len(self.columnsCompactDescription) != 3: warningWrongSkinParameter(attrib) def compactColumn(value): self.compactColumn = int(value) def treeDescription(value): self.treeDescription = int(value) for (attrib, value) in self.skinAttributes[:]: try: locals().get(attrib)(value) self.skinAttributes.remove((attrib, value)) except: pass self.redrawList() return GUIComponent.applySkin(self, desktop, parent)
def __init__(self, root, list_type=None, sort_type=None, descr_state=None): GUIComponent.__init__(self) self.list = [] self.list_type = list_type or self.LISTTYPE_MINIMAL self.descr_state = descr_state or self.HIDE_DESCRIPTION self.sort_type = sort_type or self.SORT_GROUPWISE self.firstFileEntry = 0 self.parentDirectory = 0 self.fontName = "Regular" self.fontSizesOriginal = (22, 18, 16) self.fontSizesCompact = (20, 14) self.fontSizesMinimal = (20, 16) self.itemHeights = (75, 37, 25) self.pbarShift = 5 self.pbarHeight = 16 self.pbarLargeWidth = 48 self.partIconeShiftMinimal = 5 self.partIconeShiftCompact = 4 self.partIconeShiftOriginal = 5 self.spaceRight = 2 self.spaceIconeText = 2 self.iconsWidth = 22 self.trashShift = 1 self.dirShift = 1 self.columnsOriginal = (180, 200) self.columnsCompactDescription = (120, 140, 154) self.compactColumn = 200 self.treeDescription = 165 self.reloadDelayTimer = None self.l = eListboxPythonMultiContent() self.tags = set() self.root = None self._playInBackground = None self._char = '' if root is not None: self.reload(root) self.l.setBuildFunc(self.buildMovieListEntry) self.onSelectionChanged = [] self.iconPart = [] for part in range(5): self.iconPart.append( LoadPixmap( resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/part_%d_4.png" % part))) self.iconMovieRec = LoadPixmap( resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/part_new.png")) self.iconMoviePlay = LoadPixmap( resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/movie_play.png")) self.iconMoviePlayRec = LoadPixmap( resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/movie_play_rec.png")) self.iconUnwatched = LoadPixmap( resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/part_unwatched.png")) self.iconFolder = LoadPixmap( resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/folder.png")) self.iconTrash = LoadPixmap( resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/trashcan.png")) self.runningTimers = {} self.updateRecordings()
def applySkin(self, desktop, parent): attribs = [] if self.skinAttributes is not None: attribs = [] for (attrib, value) in self.skinAttributes: if attrib == "foregroundColorMarked": self.l.setColor(eListboxServiceContent.markedForeground, parseColor(value)) elif attrib == "foregroundColorMarkedSelected": self.l.setColor( eListboxServiceContent.markedForegroundSelected, parseColor(value)) elif attrib == "backgroundColorMarked": self.l.setColor(eListboxServiceContent.markedBackground, parseColor(value)) elif attrib == "backgroundColorMarkedSelected": self.l.setColor( eListboxServiceContent.markedBackgroundSelected, parseColor(value)) elif attrib == "foregroundColorServiceNotAvail": self.l.setColor(eListboxServiceContent.serviceNotAvail, parseColor(value)) elif attrib == "foregroundColorEvent" or attrib == "colorServiceDescription": self.l.setColor(eListboxServiceContent.eventForeground, parseColor(value)) elif attrib == "foregroundColorEventSelected" or attrib == "colorServiceDescriptionSelected": self.l.setColor( eListboxServiceContent.eventForegroundSelected, parseColor(value)) elif attrib == "foregroundColorEventborder": self.l.setColor( eListboxServiceContent.eventborderForeground, parseColor(value)) elif attrib == "foregroundColorEventborderSelected": self.l.setColor( eListboxServiceContent.eventborderForegroundSelected, parseColor(value)) elif attrib == "colorEventProgressbar": self.l.setColor( eListboxServiceContent.serviceEventProgressbarColor, parseColor(value)) elif attrib == "colorEventProgressbarSelected": self.l.setColor( eListboxServiceContent. serviceEventProgressbarColorSelected, parseColor(value)) elif attrib == "colorEventProgressbarBorder": self.l.setColor( eListboxServiceContent. serviceEventProgressbarBorderColor, parseColor(value)) elif attrib == "colorEventProgressbarBorderSelected": self.l.setColor( eListboxServiceContent. serviceEventProgressbarBorderColorSelected, parseColor(value)) elif attrib == "colorServiceRecorded": self.l.setColor(eListboxServiceContent.serviceRecorded, parseColor(value)) elif attrib == "colorServicePseudoRecorded": self.l.setColor( eListboxServiceContent.servicePseudoRecorded, parseColor(value)) elif attrib == "colorServiceStreamed": self.l.setColor(eListboxServiceContent.serviceStreamed, parseColor(value)) elif attrib == "colorFallbackItem": self.l.setColor(eListboxServiceContent.serviceItemFallback, parseColor(value)) elif attrib == "colorServiceSelectedFallback": self.l.setColor( eListboxServiceContent.serviceSelectedFallback, parseColor(value)) elif attrib == "colorServiceDescriptionFallback": self.l.setColor( eListboxServiceContent.eventForegroundFallback, parseColor(value)) elif attrib == "colorServiceDescriptionSelectedFallback": self.l.setColor( eListboxServiceContent.eventForegroundSelectedFallback, parseColor(value)) elif attrib == "picServiceEventProgressbar": pic = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, value)) if pic: self.l.setPixmap(self.l.picServiceEventProgressbar, pic) elif attrib == "serviceItemHeight": self.ItemHeight = int(value) elif attrib == "serviceNameFont": font = parseFont(value, ((1, 1), (1, 1))) self.ServiceNameFontName = font.family self.ServiceNameFontSize = font.pointSize elif attrib == "serviceInfoFont": font = parseFont(value, ((1, 1), (1, 1))) self.ServiceInfoFontName = font.family self.ServiceInfoFontSize = font.pointSize elif attrib == "serviceNumberFont": font = parseFont(value, ((1, 1), (1, 1))) self.ServiceNumberFontName = font.family self.ServiceNumberFontSize = font.pointSize elif attrib == "progressbarHeight": self.l.setProgressbarHeight(int(value)) elif attrib == "progressbarBorderWidth": self.l.setProgressbarBorderWidth(int(value)) else: attribs.append((attrib, value)) self.skinAttributes = attribs self.setServiceFontsize() rc = GUIComponent.applySkin(self, desktop, parent) self.listHeight = self.instance.size().height() self.listWidth = self.instance.size().width() self.setItemsPerPage() return rc
class MovieList(GUIComponent): SORT_ALPHANUMERIC = 1 SORT_RECORDED = 2 SHUFFLE = 3 SORT_ALPHANUMERIC_REVERSE = 4 SORT_RECORDED_REVERSE = 5 SORT_ALPHANUMERIC_FLAT = 6 SORT_ALPHANUMERIC_FLAT_REVERSE = 7 LISTTYPE_ORIGINAL = 1 LISTTYPE_COMPACT_DESCRIPTION = 2 LISTTYPE_COMPACT = 3 LISTTYPE_MINIMAL = 4 HIDE_DESCRIPTION = 1 SHOW_DESCRIPTION = 2 def __init__(self, root, list_type=None, sort_type=None, descr_state=None): GUIComponent.__init__(self) self.list = [] self.list_type = list_type or self.LISTTYPE_MINIMAL self.descr_state = descr_state or self.HIDE_DESCRIPTION self.sort_type = sort_type or self.SORT_RECORDED self.firstFileEntry = 0 self.parentDirectory = 0 self.fontName = "Regular" self.fontSizesOriginal = (22, 18, 16) self.fontSizesCompact = (20, 14) self.fontSizesMinimal = (20, 16) self.itemHeights = (75, 37, 25) self.reloadDelayTimer = None self.l = eListboxPythonMultiContent() self.tags = set() self.root = None self._playInBackground = None self._char = '' if root is not None: self.reload(root) self.l.setBuildFunc(self.buildMovieListEntry) self.onSelectionChanged = [] self.iconPart = [] for part in range(5): self.iconPart.append( LoadPixmap( resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/part_%d_4.png" % part))) self.iconMovieRec = LoadPixmap( resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/part_new.png")) self.iconMoviePlay = LoadPixmap( resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/movie_play.png")) self.iconMoviePlayRec = LoadPixmap( resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/movie_play_rec.png")) self.iconUnwatched = LoadPixmap( resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/part_unwatched.png")) self.iconFolder = LoadPixmap( resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/folder.png")) self.iconTrash = LoadPixmap( resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/trashcan.png")) self.runningTimers = {} self.updateRecordings() def get_playInBackground(self): return self._playInBackground def set_playInBackground(self, value): if self._playInBackground is not value: index = self.findService(self._playInBackground) if index is not None: self.invalidateItem(index) self.l.invalidateEntry(index) index = self.findService(value) if index is not None: self.invalidateItem(index) self.l.invalidateEntry(index) self._playInBackground = value playInBackground = property(get_playInBackground, set_playInBackground) def updateRecordings(self, timer=None): if timer is not None: if timer.justplay: return result = {} for timer in NavigationInstance.instance.RecordTimer.timer_list: if timer.isRunning() and not timer.justplay: result[os.path.split(timer.Filename)[1] + '.ts'] = timer if self.runningTimers == result: return self.runningTimers = result if timer is not None: if self.reloadDelayTimer is not None: self.reloadDelayTimer.stop() self.reloadDelayTimer = eTimer() self.reloadDelayTimer.callback.append(self.reload) self.reloadDelayTimer.start(5000, 1) def connectSelChanged(self, fnc): if not fnc in self.onSelectionChanged: self.onSelectionChanged.append(fnc) def disconnectSelChanged(self, fnc): if fnc in self.onSelectionChanged: self.onSelectionChanged.remove(fnc) def selectionChanged(self): for x in self.onSelectionChanged: x() def setListType(self, type): if type != self.list_type: self.list_type = type self.redrawList() def setDescriptionState(self, val): self.descr_state = val def setSortType(self, type): self.sort_type = type def applySkin(self, desktop, parent): attribs = [] if self.skinAttributes is not None: attribs = [] for (attrib, value) in self.skinAttributes: try: if attrib == "fontName": self.fontName = value elif attrib == "fontSizesOriginal": self.fontSizesOriginal = map(int, value.split(",")) elif attrib == "fontSizesCompact": self.fontSizesCompact = map(int, value.split(",")) elif attrib == "fontSizesMinimal": self.fontSizesMinimal = map(int, value.split(",")) elif attrib == "itemHeights": self.itemHeights = map(int, value.split(",")) else: attribs.append((attrib, value)) except Exception, e: print '[MovieList] Error "%s" parsing attribute: %s="%s"' % ( str(e), attrib, value) self.skinAttributes = attribs self.redrawList() return GUIComponent.applySkin(self, desktop, parent)