def QuickSubMenuEntryComponent(name, description, long_description=None, width=540): return [ (_(name), _(long_description)), #MultiContentEntryText(pos=(20, 5), size=(width - 10, 25), font=0, text=_(name)), MultiContentEntryText(pos=(20, 15), size=(width - 10, 25), font=0, text=_(name)), #MultiContentEntryText(pos=(20, 26), size=(width - 10, 17), font=1, text=_(description)), MultiContentEntryText(pos=(20, 26), size=(0, 0), font=1, text=_(description)) ]
def PanelColorListEntry2(name, value, colorName, colorValue, sizePanelX): res = [(name)] res.append( MultiContentEntryText(pos=(0, 5), size=(sizePanelX, 30), font=Font.REGULAR_MEDIUM, flags=RT_HALIGN_LEFT, text=toString(name), color=colorName)) res.append( MultiContentEntryText(pos=(0, 5), size=(sizePanelX, 30), font=Font.REGULAR_MEDIUM, flags=RT_HALIGN_RIGHT, text=toString(value), color=colorValue)) return res
def PanelColorListEntry(name, value, color, sizePanelX): res = [(name)] res.append( MultiContentEntryText(pos=(0, resize(5)), size=(sizePanelX, resize(30)), font=Font.REGULAR_MEDIUM, flags=RT_HALIGN_LEFT, text=name, color=color)) res.append( MultiContentEntryText(pos=(0, resize(5)), size=(sizePanelX, resize(30)), font=Font.REGULAR_MEDIUM, flags=RT_HALIGN_RIGHT, text=value, color=color)) return res
def PluginCategoryComponent(name, png, width=440): x, y, h = skin.parameters.get("PluginBrowserDownloadName", (80, 5, 25)) ix, iy, iw, ih = skin.parameters.get("PluginBrowserDownloadIcon", (10, 0, 60, 50)) return [ name, MultiContentEntryText(pos=(x, y), size=(width - x, h), font=0, text=name), MultiContentEntryPixmapAlphaTest(pos=(ix, iy), size=(iw, ih), png=png) ]
def PanelListDownloadListEntry(pdownload): res = [(pdownload.name)] finishText = _('Finished: ') if pdownload.finish_time is not None: finishText = _('Finished: ') + time.strftime("%b %d %Y %H:%M:%S", time.localtime(pdownload.finish_time)) sizeKB = BtoKB(pdownload.size) if sizeKB <= 1024 and sizeKB >= 0: size = ("%d KB " % sizeKB) elif sizeKB <= 1024 * 1024: size = ("%d MB " % BtoMB(pdownload.size)) else: size = ("%.2f GB " % BtoGB(pdownload.size)) sizeText = _('Size: ') + size stateText = pdownload.textState res.append(MultiContentEntryPixmapAlphaTest(pos=(5, 5), size=(35, 25), png=loadPNG(pdownload.thumb))) res.append(MultiContentEntryText(pos=(60, 5), size=(760, 30), font=Font.REGULAR_MEDIUM, flags=RT_HALIGN_LEFT, text=toString(pdownload.name))) res.append(MultiContentEntryText(pos=(0, 38), size=(900, 18), font=Font.REGULAR_SMALL, flags=RT_VALIGN_TOP | RT_HALIGN_RIGHT, text=sizeText, color=0xE6A800)) if pdownload.state == 'success_finished': res.append(MultiContentEntryText(pos=(0, 38), size=(900, 18), font=Font.REGULAR_SMALL, flags=RT_VALIGN_TOP | RT_HALIGN_LEFT, text=finishText, color=0xE6A800)) res.append(MultiContentEntryText(pos=(0, 38), size=(900, 18), font=Font.REGULAR_SMALL, flags=RT_VALIGN_TOP | RT_HALIGN_CENTER, text=stateText, color=0x00FF00)) elif pdownload.state == 'error_finished': res.append(MultiContentEntryText(pos=(0, 38), size=(900, 18), font=Font.REGULAR_SMALL, flags=RT_VALIGN_TOP | RT_HALIGN_LEFT, text=finishText, color=0xE6A800)) res.append(MultiContentEntryText(pos=(0, 38), size=(900, 18), font=Font.REGULAR_SMALL, flags=RT_VALIGN_TOP | RT_HALIGN_CENTER, text=stateText, color=0xff0000)) elif pdownload.state == 'downloading': res.append(MultiContentEntryText(pos=(0, 38), size=(900, 18), font=Font.REGULAR_SMALL, flags=RT_VALIGN_TOP | RT_HALIGN_CENTER, text=stateText, color=0xE6A800)) return res
def show_listiptv(h, p, u, pw): print h, p, u, pw if dwidth == 1280: res = [(h, p, u, pw)] if 'Free Server Cccam' in h: res.append( MultiContentEntryText(pos=(2, 2), size=(425, 31), font=5, text=h, backcolor_sel=26214, backcolor=22503, flags=RT_HALIGN_CENTER)) return res else: res.append( MultiContentEntryText(pos=(2, 2), size=(425, 31), font=5, text=h, backcolor_sel=26214, backcolor=1090519040, flags=RT_HALIGN_CENTER)) return res else: res = [(h, p, u, pw)] if 'Free Server Cccam' in h: res.append( MultiContentEntryText(pos=(2, 2), size=(600, 31), font=7, text=h, backcolor_sel=26214, backcolor=22503, flags=RT_HALIGN_CENTER)) return res res.append( MultiContentEntryText(pos=(2, 2), size=(600, 31), font=7, text=h, backcolor_sel=26214, backcolor=1090519040, flags=RT_HALIGN_CENTER)) return res
def ARDMenuListSubEntry(movie, thumb): res = [(movie[3], movie)] if thumb: res.append( MultiContentEntryPixmapAlphaTest(pos=(0, 0), size=(75, 50), png=thumb)) res.append( MultiContentEntryText(pos=(80, 0), size=(500, 25), font=0, text=movie[2] + " - " + movie[0])) res.append( MultiContentEntryText(pos=(80, 25), size=(500, 25), font=0, text=movie[1])) return res
def PartitionEntry(description, size): res = [(description, size)] picture = resolveFilename( SCOPE_PLUGINS, 'SystemPlugins/PEPanel/pictures/partitionmanager.png') if fileExists(picture): res.append( MultiContentEntryPixmapAlphaTest(pos=(5, 0), size=(48, 48), png=loadPNG(picture))) res.append( MultiContentEntryText(pos=(65, 10), size=(360, 38), font=0, text=description)) res.append( MultiContentEntryText(pos=(435, 10), size=(125, 38), font=0, text=size)) return res
def PackagesListEntry(self,item_id,name,author="",rating="",date="",version="",total_votes="",item_type="",image_link="",icon_link="",description="",file_link="",downloads="",previouspackage="0",date_modified="",build=0,isinstalled=False,updateavailable=False): res = [[item_id,name,author,rating,date,version,total_votes,item_type,image_link,icon_link,description,file_link,downloads,date_modified,build,isinstalled,updateavailable]] path = metrixDefaults.pathRoot()+"packages/"+str(item_id) if isinstalled: pngtype = metrixDefaults.PLUGIN_DIR + "images/package-on.png" if updateavailable: res.append(MultiContentEntryText(pos=(70, 4), size=(365, 45), font=0, text=name,color=metrixDefaults.COLOR_UPDATE_AVAILABLE)) else: res.append(MultiContentEntryText(pos=(70, 4), size=(365, 45), font=0, text=name,color=metrixDefaults.COLOR_INSTALLED)) else: pngtype = metrixDefaults.PLUGIN_DIR + "images/package.png" res.append(MultiContentEntryText(pos=(70, 4), size=(365, 45), font=0, text=name)) png = metrixDefaults.PLUGIN_DIR + "images/vote"+rating+".png" pngicon = metrixTools.webPixmap(icon_link,"openStoreIcon"+str(item_id),{'width':54}) res.append(MultiContentEntryPixmapAlphaBlend(pos=(445, 9), size=(185, 32), png=loadPNG(png))) res.append(MultiContentEntryPixmapAlphaBlend(pos=(5, 1), size=(54, 54), png=loadPNG(pngicon))) return res
def PluginDownloadComponent(plugin, name, version = None, width = 440): if plugin.icon is None: png = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, 'icons/plugin.png')) else: png = plugin.icon if version: if '+git' in version: version = '+'.join(version.split('+')[:2]) elif version.startswith('experimental-'): version = version[13:] name += ' (' + version + ')' x, y, h = skin.parameters.get('PluginBrowserDownloadName', (80, 5, 25)) dx, dy, dh = skin.parameters.get('PluginBrowserDownloadDescr', (80, 26, 17)) ix, iy, iw, ih = skin.parameters.get('PluginBrowserDownloadIcon', (10, 0, 60, 50)) return [plugin, MultiContentEntryText(pos=(x, y), size=(width - x, h), font=0, text=name), MultiContentEntryText(pos=(dx, dy), size=(width - dx, dh), font=1, text=plugin.description), MultiContentEntryPixmapAlphaBlend(pos=(ix, iy), size=(iw, ih), png=png)]
def CharEntryComponent(char): return [ char, MultiContentEntryText(pos=(0, 0), size=(40, 50), font=1, flags=RT_HALIGN_CENTER | RT_VALIGN_CENTER, text=char) ]
def PluginDownloadComponent(plugin, name, version=None, width=440): png = plugin.icon or LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "icons/plugin.png")) if version: if "+git" in version: # remove git "hash" version = "+".join(version.split("+")[:2]) elif version.startswith('experimental-'): version = version[13:] name += " (" + version + ")" x, y, h = parameters.get("PluginBrowserDownloadName", applySkinFactor(80, 5, 25)) dx, dy, dh = parameters.get("PluginBrowserDownloadDescr", applySkinFactor(80, 26, 17)) ix, iy, iw, ih = parameters.get("PluginBrowserDownloadIcon", applySkinFactor(10, 0, 60, 50)) return [ plugin, MultiContentEntryText(pos=(x, y), size=(width - x, h), font=0, text=name), MultiContentEntryText(pos=(dx, dy), size=(width - dx, dh), font=1, text=plugin.description), MultiContentEntryPixmapAlphaBlend(pos=(ix, iy), size=(iw, ih), png=png) ]
def show_list_1(h): if Utils.isFHD(): res = [h] res.append( MultiContentEntryText(pos=(2, 2), size=(670, 40), font=0, text=h, flags=RT_HALIGN_LEFT)) else: res = [h] res.append( MultiContentEntryText(pos=(2, 2), size=(660, 30), font=0, text=h, flags=RT_HALIGN_LEFT)) return res
def GeneralSetupEntryComponent(name, description, long_description=None, endtext=">", width=540): return [ (_(name), _(long_description)), MultiContentEntryText(pos=(20, 10), size=(width - 120, 35), font=0, text=_(name)), #MultiContentEntryText(pos=(20, 26), size=(width - 120, 17), font=1, text=_(description)), MultiContentEntryText(pos=(20, 26), size=(0, 0), font=1, text=_(description)), MultiContentEntryText(pos=(350, 10), size=(35, 35), text=">") ]
def ListEntry(self, entry): return [ entry, MultiContentEntryText(pos=(10, 0), size=(1180, 25), font=0, flags=RT_HALIGN_LEFT | RT_VALIGN_CENTER, text=entry[0]) ]
def ARDMenuListEntry(url, name): res = [(url, name)] res.append( MultiContentEntryText(pos=(0, 0), size=(580, 20), font=0, text=name, color=0xffffff)) return res
def ZapStatisticBrowserListEntry(entry): res = [entry] t_begin = localtime(entry.begin) t_end = localtime(entry.end) res.append( MultiContentEntryText( pos=(0, 0), size=(240, 25), font=0, text="%02d.%02d. %02d:%02d:%02d - %02d:%02d:%02d" % (t_begin[2], t_begin[1], t_begin[3], t_begin[4], t_begin[5], t_end[3], t_end[4], t_end[5]))) res.append( MultiContentEntryText(pos=(250, 0), size=(310, 25), font=0, text=entry.name)) return res
def PluginCategoryComponent(name, png, width=440): return [ name, MultiContentEntryText(pos=(80, 5), size=(width - 80, 25), font=0, text=name), MultiContentEntryPixmapAlphaTest(pos=(10, 0), size=(60, 50), png=png) ]
def PluginDownloadComponent(plugin, name, version=None, width=440): screenwidth = getDesktop(0).size().width() if plugin.icon is None: png = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/plugin.png")) else: png = plugin.icon if version: if "+git" in version: # remove git "hash" version = "+".join(version.split("+")[:2]) elif version.startswith('experimental-'): version = version[13:] name += " (" + version + ")" if screenwidth and screenwidth == 1920: return [ plugin, MultiContentEntryText(pos=(110, 1), size=(width - 80, 35), font=2, text=name), MultiContentEntryText(pos=(110, 38), size=(width - 80, 25), font=3, text=plugin.description), MultiContentEntryPixmapAlphaBlend(pos=(10, 0), size=(90, 75), png=png) ] else: return [ plugin, MultiContentEntryText(pos=(80, 5), size=(width - 80, 25), font=0, text=name), MultiContentEntryText(pos=(80, 26), size=(width - 80, 17), font=1, text=plugin.description), MultiContentEntryPixmapAlphaBlend(pos=(10, 0), size=(60, 50), png=png) ]
def PluginEntryComponent(plugin, width=440): if plugin.icon is None: png = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, "icons/plugin.png")) else: png = plugin.icon return [ plugin, MultiContentEntryText(pos=(120, 5), size=(width - 120, 25), font=0, text=plugin.name), MultiContentEntryText(pos=(120, 26), size=(width - 120, 17), font=1, text=plugin.description), MultiContentEntryPixmapAlphaTest(pos=(10, 5), size=(100, 40), png=png) ]
def RSListEntry(download, state): res = [(download)] res.append(MultiContentEntryText(pos=(40, 0), size=(620, 25), font=0, text=download)) if state == 0: res.append(MultiContentEntryPixmapAlphaTest(pos=(5, 6), size=(25,25), png=LoadPixmap(cached=True, desktop=getDesktop(0), path=resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/buttons/button_green.png")))) else: res.append(MultiContentEntryPixmapAlphaTest(pos=(5, 6), size=(25,25), png=LoadPixmap(cached=True, desktop=getDesktop(0), path=resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/buttons/button_red.png")))) print "res =", res return res
def PluginCategoryComponent(name, png): x, y, w, h = skin.parameters.get("PluginListCategoryName", (120, 5, 700, 25)) x1, y1, w1, h1 = skin.parameters.get("PluginListCategoryIcon", (10, 0, 100, 50)) return [ name, MultiContentEntryText(pos=(120, 5), size=(700, 25), font=0, text=name), MultiContentEntryPixmapAlphaTest(pos=(10, 0), size=(100, 50), png=png) ]
def DesignsListEntry(self, name, title, author, likes, date): res = [[name, title, author, likes, date]] png = '/usr/lib/enigma2/python/Plugins/Extensions/MyMetrix/images/vote.png' res.append( MultiContentEntryPixmapAlphaTest(pos=(552, 9), size=(32, 32), png=loadPNG(png))) res.append( MultiContentEntryText(pos=(3, 4), size=(380, 45), font=0, text=title)) res.append( MultiContentEntryText(pos=(486, 9), size=(60, 40), font=1, flags=RT_HALIGN_RIGHT, text=likes)) return res
def YouTubePlaylistEntryComponent(entry): res = [entry] res.append( MultiContentEntryText(pos=(5, 5), size=(550, 18), font=0, flags=RT_HALIGN_LEFT | RT_VALIGN_TOP | RT_WRAP, text=entry.getTitle())) res.append( MultiContentEntryText(pos=(5, 23), size=(550, 14), font=1, color=0xFFA323, color_sel=0xFFA323, flags=RT_HALIGN_LEFT | RT_VALIGN_TOP | RT_WRAP, text=entry.getDescription())) return res
def _layoutFinish(self): self.setTitle(_("Accounts list")) accList = [] for acc in mailAccounts: if acc.isConnected(): color = 0x00FFFFFF else: color = 0x00888888 accList.append([acc, MultiContentEntryText(pos=(0, 0), size=(self.width, scaleV(20, 18) + 5), text=acc._name, color=color, color_sel=color)]) self["accounts"].l.setList(accList)
def MetrixListEntry(self, _name, _value): entry = [[_value, _name]] #png = "/usr/lib/enigma2/python/Plugins/Extensions/MyMetrix/images/vote"+rating+".png" #res.append(MultiContentEntryPixmapAlphaTest(pos=(412, 9), size=(170, 32), png=loadPNG(png))) entry.append( MultiContentEntryText(pos=(30, 5), size=(405, 50), font=0, text=_name)) return entry
def MenuEntry(name, picture): res = [(picture, name)] picture = resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/sifteam_panel/" + picture + ".png") #print picture if fileExists(picture): res.append(MultiContentEntryPixmapAlphaTest(pos=(0, 0), size=(48, 48), png=loadPNG(picture))) res.append(MultiContentEntryText(pos=(60, 10), size=(420, 38), font=0, text=name)) return res
def show_(name, link, img, session, description): res = [(name, link, img, session, description)] page1 = resolveFilename(SCOPE_PLUGINS, "Extensions/{}/skin/images_new/page_select.png".format('Filmon')) res.append(MultiContentEntryPixmapAlphaTest(pos = (10, 12), size = (34, 25), png = loadPNG(page1))) res.append(MultiContentEntryText(pos=(60, 0), size=(1000, 50), font=0, text=name, flags=RT_HALIGN_CENTER | RT_VALIGN_CENTER)) return res
def cMenuListEntry(name, idx): res = [name] png = '/usr/lib/enigma2/python/Plugins/Extensions/TuneinRadio/skin/icons/%s.png' % str(name) if fileExists(png): if enigmaos == 'oe2.0': res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 15), size=(278, 78), png=loadPNG(png))) else: res.append(MultiContentEntryPixmapAlphaTest(pos=(2, 15), size=(278, 78), png=loadPNG(png))) res.append(MultiContentEntryText(pos=(10, 3), size=(278, 90), font=0, text=' ')) return res
def MessageBoxEntry(name, picture): res = [(name, picture)] picture = '/usr/lib/enigma2/python/Plugins/SystemPlugins/EuroSatDevice/icons/' + picture if fileExists(picture): res.append( MultiContentEntryPixmapAlphaTest(pos=(5, 0), size=(48, 48), png=loadPNG(picture))) res.append( MultiContentEntryText(pos=(65, 10), size=(425, 38), font=0, text=name)) return res