make menu text translatable
[enigma2.git] / lib / python / Plugins / SystemPlugins / SkinSelector / plugin.py
index fdb2683..060a4f3 100755 (executable)
@@ -9,7 +9,6 @@ from Components.Pixmap import Pixmap
 from Components.MenuList import MenuList
 from Plugins.Plugin import PluginDescriptor
 from Components.config import config
-from Components.config import config
 
 from os import path, walk
 
@@ -51,7 +50,20 @@ class SkinSelector(Screen):
                        "info": self.info,
                }, -1)
                
-               self.onLayoutFinish.append(self.loadPreview)
+               self.onLayoutFinish.append(self.layoutFinished)
+
+       def layoutFinished(self):
+               tmp = config.skin.primary_skin.value.find('/skin.xml')
+               if tmp != -1:
+                       tmp = config.skin.primary_skin.value[:tmp]
+                       idx = 0
+                       for skin in self.skinlist:
+                               if skin == tmp:
+                                       break
+                               idx += 1
+                       if idx < len(self.skinlist):
+                               self["SkinList"].moveToIndex(idx)
+               self.loadPreview()
 
        def up(self):
                self["SkinList"].up()
@@ -117,11 +129,11 @@ class SkinSelector(Screen):
 def SkinSelMain(session, **kwargs):
        session.open(SkinSelector)
 
-def SkinSelSetup(menuid):
+def SkinSelSetup(menuid, **kwargs):
        if menuid == "system":
-               return [("Skin...", SkinSelMain)]
+               return [(_("Skin..."), SkinSelMain, "skin_selector", None)]
        else:
                return []
 
 def Plugins(**kwargs):
-       return PluginDescriptor(name="Skinselector", description="Select Your Skin", where = PluginDescriptor.WHERE_SETUP, fnc=SkinSelSetup)
+       return PluginDescriptor(name="Skinselector", description="Select Your Skin", where = PluginDescriptor.WHERE_MENU, fnc=SkinSelSetup)