def loadPluginSkin(skin_file): default_skin = resolveFilename(SCOPE_SKIN, "Default-FHD/MediaCockpit") current_skin = resolveFilename(SCOPE_CURRENT_SKIN, "MediaCockpit") plugin_skin = resolveFilename(SCOPE_PLUGINS, "Extensions/MediaCockpit") print("MDC-I: plugin: loadPluginSkin: current_skin: %s" % current_skin) print("MDC-I: plugin: loadPluginSkin: default_skin: %s" % default_skin) print("MDC-I: plugin: loadPluginSkin: plugin_skin: %s" % plugin_skin) if not (os.path.islink(default_skin) or os.path.isdir(default_skin)): print("MDC-I: plugin: loadPluginSkin: ln -s " + plugin_skin + " " + resolveFilename(SCOPE_SKIN, "Default-FHD")) os.system("ln -s " + plugin_skin + " " + resolveFilename(SCOPE_SKIN, "Default-FHD")) loadSkin(getSkinPath(skin_file), "") path, dom_skin = dom_skins[-1:][0] loadSingleSkinData(getDesktop(0), dom_skin, path)
def reloadSkin(self): path = os.path.dirname(XML_FILE) + "/" print "[ModifyPLiFullHD] parsing %s" % XML_FILE # remove disabled items in plugin's setup from xml before reloading skin root = ET.parse(XML_FILE).getroot() windowstyle = root.find('windowstyle') for borderset in windowstyle.findall("borderset"): for pixmap in borderset.findall("pixmap"): if borderset.attrib.get("name", None) == "bsListboxEntry": if pixmap.attrib.get("pos") == "bpLeft": if cfg.selector_vertical.value in ("no", "right"): borderset.remove(pixmap) if pixmap.attrib.get("pos") == "bpRight": if cfg.selector_vertical.value in ("no", "left"): borderset.remove(pixmap) # call reload skin try: skin.loadSingleSkinData(enigma.getDesktop(0), root, path) print "[ModifyPLiFullHD] skin reload - old skin code" except: skin.loadSingleSkinData(enigma.getDesktop(0), skin.GUI_SKIN_ID, root, path) print "[ModifyPLiFullHD] skin reload - new skin code" for elem in root: if elem.tag == 'screen': name = elem.attrib.get('name', None) if name: sid = elem.attrib.get('id', None) if sid and (sid != skin.display_skin_id): elem.clear() continue if name in skin.dom_screens: skin.dom_screens[name][0].clear() skin.dom_screens[name] = (elem, path) else: elem.clear() else: elem.clear()
dSize = getDesktop(0).size() # Load Skin, first try to find it, if not found reset to default skin skinLoaded = False try: if config.plugins.pvmc.skin.value[0:1] == "~": #Enigma2 Skin skinPath = resolveFilename( SCOPE_SKIN) + config.plugins.pvmc.skin.value[1:] + "/" skinXml = skinPath + "skin_valerie.xml" else: skinPath = config.plugins.pvmc.skinfolderpath.value + config.plugins.pvmc.skin.value + "/" + str( dSize.width()) + "x" + str(dSize.height()) + "/" skinXml = skinPath + "skin.xml" printl("__init__:: loading Skin " + skinXml, None, "I") loadSkin(skinXml) loadSingleSkinData(getDesktop(0), findSkin(skinPath), skinPath) skinLoaded = True except Exception, ex: printl("__init__:: Exception(" + str(type(ex)) + "): " + str(ex), None, "W") skinLoaded = False config.plugins.pvmc.skinfolderpath.value = defaultSkinFolderPath config.plugins.pvmc.skin.value = defaultSkin if skinLoaded == False: try: skinPath = config.plugins.pvmc.skinfolderpath.value + config.plugins.pvmc.skin.value + "/" + str( dSize.width()) + "x" + str(dSize.height()) + "/" skinXml = skinPath + "skin.xml" printl("__init__:: loading Skin " + skinXml, None, "I") loadSkin(skinXml)
config.plugins.pvmc.version.value = currentVersion dSize = getDesktop(0).size() # Load Skin, first try to find it, if not found reset to default skin skinLoaded = False try: if config.plugins.pvmc.skin.value[0:1] == "~": #Enigma2 Skin skinPath = resolveFilename(SCOPE_SKIN) + config.plugins.pvmc.skin.value[1:] + "/" skinXml = skinPath + "skin_valerie.xml" else: skinPath = config.plugins.pvmc.skinfolderpath.value + config.plugins.pvmc.skin.value + "/" + str(dSize.width()) + "x" + str(dSize.height()) + "/" skinXml = skinPath + "skin.xml" printl("__init__:: loading Skin " + skinXml, None, "I") loadSkin(skinXml) loadSingleSkinData(getDesktop(0), findSkin(skinPath), skinPath) skinLoaded = True except Exception, ex: printl("__init__:: Exception(" + str(type(ex)) + "): " + str(ex), None, "W") skinLoaded = False config.plugins.pvmc.skinfolderpath.value = defaultSkinFolderPath config.plugins.pvmc.skin.value = defaultSkin if skinLoaded == False: try: skinPath = config.plugins.pvmc.skinfolderpath.value + config.plugins.pvmc.skin.value + "/" + str(dSize.width()) + "x" + str(dSize.height()) + "/" skinXml = skinPath + "skin.xml" printl("__init__:: loading Skin " + skinXml, None, "I") loadSkin(skinXml) loadSingleSkinData(getDesktop(0), findSkin(skinPath), skinPath) skinLoaded = True
def loadPluginSkin(skin_file): loadSkin(getSkinPath(skin_file), "") path, dom_skin = dom_skins[-1:][0] loadSingleSkinData(getDesktop(0), dom_skin, path)