add 'weight' for menu entries (including plugins), so they can be sorted, patch by...
[enigma2.git] / lib / python / Plugins / SystemPlugins / PositionerSetup / plugin.py
index 40688df52bdfb6fc3102bc139db04387bf86d239..fccd2625b6d024ceb922d3e3f66c2fb90679878a 100644 (file)
@@ -532,7 +532,8 @@ class NimSelection(Screen):
                nimlist = nimmanager.getNimListOfType(nimmanager.nimType["DVB-S"])
                nimMenuList = []
                for x in nimlist:
-                       nimMenuList.append((_("NIM ") + (["A", "B", "C", "D"][x]) + ": " + nimmanager.getNimName(x) + " (" + nimmanager.getNimTypeName(x) + ")", x))
+                       n = nimmanager.nim_slots[x]
+                       nimMenuList.append((n.friendly_full_name, x))
                
                self["nimlist"] = MenuList(nimMenuList)
 
@@ -547,7 +548,7 @@ class NimSelection(Screen):
                self.session.open(PositionerSetup, selection[1])
 
 def PositionerMain(session, **kwargs):
-       nimList = nimmanager.getNimListOfType(nimmanager.nimType["DVB-S"])
+       nimList = nimmanager.getNimListOfType("DVB-S")
        if len(nimList) == 0:
                session.open(MessageBox, _("No positioner capable frontend found."), MessageBox.TYPE_ERROR)
        else:
@@ -566,12 +567,14 @@ def PositionerMain(session, **kwargs):
                        else:
                                session.open(MessageBox, _("No tuner is configured for use with a diseqc positioner!"), MessageBox.TYPE_ERROR)
 
-def PositionerSetupStart(menuid):
+def PositionerSetupStart(menuid, **kwargs):
        if menuid == "scan":
-               return [(_("Positioner setup"), PositionerMain)]
+               return [(_("Positioner setup"), PositionerMain, "positioner_setup", None)]
        else:
                return []
 
 def Plugins(**kwargs):
-       return PluginDescriptor(name=_("Positioner setup"), description="Setup your positioner", where = PluginDescriptor.WHERE_SETUP, fnc=PositionerSetupStart)
-       
\ No newline at end of file
+       if (nimmanager.hasNimType("DVB-S")):
+               return PluginDescriptor(name=_("Positioner setup"), description="Setup your positioner", where = PluginDescriptor.WHERE_MENU, fnc=PositionerSetupStart)
+       else:
+               return []