X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fpython%2FPlugins%2FSystemPlugins%2FSkinSelector%2Fplugin.py;h=fd2b5e1f470ba8984fa560b315856547ea8fecfb;hp=5b29b0d534dce1e38529f3e057979170832230a1;hb=e1cd84473da2da0d23f4cea1d4143f17a8fb5a2c;hpb=601d6f20152532574b5d60aed5ba862afa21ba1c diff --git a/lib/python/Plugins/SystemPlugins/SkinSelector/plugin.py b/lib/python/Plugins/SystemPlugins/SkinSelector/plugin.py old mode 100755 new mode 100644 index 5b29b0d..fd2b5e1 --- a/lib/python/Plugins/SystemPlugins/SkinSelector/plugin.py +++ b/lib/python/Plugins/SystemPlugins/SkinSelector/plugin.py @@ -6,35 +6,30 @@ from Screens.Standby import TryQuitMainloop from Screens.MessageBox import MessageBox from Components.ActionMap import NumberActionMap from Components.Pixmap import Pixmap +from Components.Sources.StaticText import StaticText from Components.MenuList import MenuList from Plugins.Plugin import PluginDescriptor from Components.config import config - +from Tools.Directories import resolveFilename, SCOPE_PLUGINS from os import path, walk +from enigma import eEnv class SkinSelector(Screen): # for i18n: # _("Choose your Skin") - skin = """ - - - - - """ - skinlist = [] - root = "/usr/share/enigma2/" + root = eEnv.resolve("${datadir}/enigma2/") def __init__(self, session, args = None): - self.skin = SkinSelector.skin Screen.__init__(self, session) self.skinlist = [] self.previewPath = "" - path.walk(self.root, self.find, "") + self["key_red"] = StaticText(_("Close")) + self["introduction"] = StaticText(_("Press OK to activate the selected skin.")) self.skinlist.sort() self["SkinList"] = MenuList(self.skinlist) self["Preview"] = Pixmap() @@ -43,13 +38,14 @@ class SkinSelector(Screen): { "ok": self.ok, "back": self.close, + "red": self.close, "up": self.up, "down": self.down, "left": self.left, "right": self.right, "info": self.info, }, -1) - + self.onLayoutFinish.append(self.layoutFinished) def layoutFinished(self): @@ -82,7 +78,7 @@ class SkinSelector(Screen): self.loadPreview() def info(self): - aboutbox = self.session.open(MessageBox,_("Enigma2 Skinselector v0.5 BETA\n\nIf you experience any problems please contact\nstephan@reichholf.net\n\n\xA9 2006 - Stephan Reichholf"), MessageBox.TYPE_INFO) + aboutbox = self.session.open(MessageBox,_("Enigma2 Skinselector\n\nIf you experience any problems please contact\nstephan@reichholf.net\n\n\xA9 2006 - Stephan Reichholf"), MessageBox.TYPE_INFO) aboutbox.setTitle(_("About...")) def find(self, arg, dirname, names): @@ -114,8 +110,7 @@ class SkinSelector(Screen): pngpath = self.root+self["SkinList"].getCurrent()+"/prev.png" if not path.exists(pngpath): - # FIXME: don't use hardcoded path - pngpath = "/usr/lib/enigma2/python/Plugins/SystemPlugins/SkinSelector/noprev.png" + pngpath = resolveFilename(SCOPE_PLUGINS, "SystemPlugins/SkinSelector/noprev.png") if self.previewPath != pngpath: self.previewPath = pngpath @@ -131,9 +126,9 @@ def SkinSelMain(session, **kwargs): def SkinSelSetup(menuid, **kwargs): if menuid == "system": - return [("Skin...", SkinSelMain, "skin_selector", None)] + return [(_("Skin"), SkinSelMain, "skin_selector", None)] else: return [] def Plugins(**kwargs): - return PluginDescriptor(name="Skinselector", description="Select Your Skin", where = PluginDescriptor.WHERE_MENU, fnc=SkinSelSetup) + return PluginDescriptor(name="Skinselector", description="Select Your Skin", where = PluginDescriptor.WHERE_MENU, needsRestart = False, fnc=SkinSelSetup)