use number keys for predefined pip positions
[enigma2.git] / lib / python / Screens / Satconfig.py
index be32763a04919dba56b5576ce8bc0900c7bfa534..11091f1ae985b6b584593ba40b7233c91ca08ac0 100644 (file)
@@ -21,14 +21,14 @@ class NimSetup(Screen):
                                list.append(getConfigListEntry(_("Port D"), self.nimConfig.diseqcD))
 
        def createPositionerSetup(self, list):
-               list.append(getConfigListEntry(_("Positioner mode"), self.nimConfig.positionerMode))
-               if (currentConfigSelectionElement(self.nimConfig.positionerMode) == "usals"): # USALS
-                       list.append(getConfigListEntry(_("Longitude"), self.nimConfig.longitude))
-                       list.append(getConfigListEntry(" ", self.nimConfig.longitudeOrientation))
-                       list.append(getConfigListEntry(_("Latitude"), self.nimConfig.latitude))
-                       list.append(getConfigListEntry(" ", self.nimConfig.latitudeOrientation))
-               elif (currentConfigSelectionElement(self.nimConfig.positionerMode) == "manual"): # manual
-                       pass
+#              list.append(getConfigListEntry(_("Positioner mode"), self.nimConfig.positionerMode))
+#              if (currentConfigSelectionElement(self.nimConfig.positionerMode) == "usals"): # USALS
+               list.append(getConfigListEntry(_("Longitude"), self.nimConfig.longitude))
+               list.append(getConfigListEntry(" ", self.nimConfig.longitudeOrientation))
+               list.append(getConfigListEntry(_("Latitude"), self.nimConfig.latitude))
+               list.append(getConfigListEntry(" ", self.nimConfig.latitudeOrientation))
+#              elif (currentConfigSelectionElement(self.nimConfig.positionerMode) == "manual"): # manual
+#                      pass
 
        def createSetup(self):
                print "Creating setup"
@@ -42,8 +42,10 @@ class NimSetup(Screen):
                self.advancedUsalsEntry = None
                self.advancedLof = None
                self.advancedPowerMeasurement = None
+               
+               self.nim_type = nimmanager.getNimType(self.nim.slotid)
 
-               if (nimmanager.getNimType(self.nim.slotid) == nimmanager.nimType["DVB-S"]):
+               if self.nim_type == nimmanager.nimType["DVB-S"]:
                        self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.configMode)
                        self.list.append(self.configMode)
 
@@ -62,10 +64,15 @@ class NimSetup(Screen):
                                self.list.append(self.advancedSatsEntry)
                                currSat = self.nimConfig.advanced.sat[nimmanager.satList[self.nimConfig.advanced.sats.value][1]]
                                self.fillListWithAdvancedSatEntrys(currSat)
-               elif (nimmanager.getNimType(self.nim.slotid) == nimmanager.nimType["DVB-C"]):
+                       self.have_advanced = True
+               elif self.nim_type == nimmanager.nimType["DVB-C"]:
                        self.list.append(getConfigListEntry(_("Cable provider"), self.nimConfig.cable))
-               elif (nimmanager.getNimType(self.nim.slotid) == nimmanager.nimType["DVB-T"]):
+                       self.have_advanced = False
+               elif self.nim_type == nimmanager.nimType["DVB-T"]:
+                       self.have_advanced = False
                        self.list.append(getConfigListEntry(_("Terrestrial provider"), self.nimConfig.terrestrial))
+               else:
+                       self.have_advanced = False
 
                self["config"].list = self.list
                self["config"].l.setList(self.list)
@@ -90,6 +97,8 @@ class NimSetup(Screen):
                        self["config"].handleKey(config.key[str(number)])
 
        def run(self):
+               if self.have_advanced and currentConfigSelectionElement(config.Nims[self.nim.slotid].configMode) == "advanced":
+                       self.fillAdvancedList()
                for x in self["config"].list:
                        x[1].save()
                nimmanager.sec.update()
@@ -142,6 +151,8 @@ class NimSetup(Screen):
 
        def fillAdvancedList(self):
                self.list = [ ]
+               self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.configMode)
+               self.list.append(self.configMode)
                self.advancedSatsEntry = getConfigListEntry(_("Satellite"), self.nimConfig.advanced.sats)
                self.list.append(self.advancedSatsEntry)
                for x in nimmanager.satList:
@@ -150,8 +161,6 @@ class NimSetup(Screen):
                self["config"].list = self.list
 
        def keySave(self):
-               if currentConfigSelectionElement(config.Nims[self.nim.slotid].configMode) == "advanced":
-                       self.fillAdvancedList()
                self.run()
                self.close()