fix more ConfigSatlist defaults
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Fri, 13 Oct 2006 01:16:16 +0000 (01:16 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Fri, 13 Oct 2006 01:16:16 +0000 (01:16 +0000)
lib/python/Components/NimManager.py
lib/python/Plugins/SystemPlugins/Satfinder/plugin.py
lib/python/Screens/ScanSetup.py

index 5b3b853fb7ffdcd32003383a7cf03a5b291af309..2ac7b8deda84de85e0b3cf8af46ae2ea4d3f2025 100644 (file)
@@ -16,6 +16,14 @@ from xml.sax.handler import ContentHandler
 
 from Tools.BoundFunction import boundFunction
 
+def getConfigSatlist(orbpos, satlist):
+       default_orbpos = None
+       for x in satlist:
+               if x[0] == orbpos:
+                       default_orbpos = orbpos
+                       break
+       return ConfigSatlist(satlist, default_orbpos)
+
 def tryOpen(filename):
        try:
                procFile = open(filename)
@@ -698,8 +706,9 @@ def InitNimManager(nimmgr):
                                        ("diseqc_a_b_c_d", _("DiSEqC A/B/C/D")),
                                        ("positioner", _("Positioner"))],
                                default = "diseqc_a_b")
-                       nim.diseqcA = ConfigSatlist(default = 192, list = nimmgr.satList)
-                       nim.diseqcB = ConfigSatlist(default = 130, list = nimmgr.satList)
+
+                       nim.diseqcA = getConfigSatlist(192, nimmgr.satList)
+                       nim.diseqcB = getConfigSatlist(130, nimmgr.satList)
                        nim.diseqcC = ConfigSatlist(list = nimmgr.satList)
                        nim.diseqcD = ConfigSatlist(list = nimmgr.satList)
                        nim.positionerMode = ConfigSelection(
@@ -730,7 +739,7 @@ def InitNimManager(nimmgr):
                        
                        # advanced config:
                        nim.advanced = ConfigSubsection()
-                       nim.advanced.sats = ConfigSatlist(default = 192, list = nimmgr.satList)
+                       nim.advanced.sats = getConfigSatlist(192,nimmgr.satList)
                        nim.advanced.sat = ConfigSubDict()
                        lnbs = [("0", "not available")]
                        for y in range(1, 33):
index 487dcd7284f3158aa2e90016ed736d4d5b2f2af8..40a655770135dede271137341064dd5d1e934e4f 100644 (file)
@@ -8,7 +8,7 @@ from Components.Label import Label
 from Components.ConfigList import ConfigList
 from Components.TunerInfo import TunerInfo
 from Components.ActionMap import ActionMap
-from Components.NimManager import nimmanager
+from Components.NimManager import nimmanager, getConfigSatlist
 from Components.MenuList import MenuList
 from Components.config import ConfigSelection, ConfigSatlist, getConfigListEntry
 
@@ -170,7 +170,7 @@ class Satfinder(ScanSetup):
 
                self.tuning_transponder = None
                self.tuning_type = ConfigSelection(choices = [("manual_transponder", _("Manual transponder")), ("predefined_transponder", _("Predefined transponder"))])
-               self.tuning_sat = ConfigSatlist(default = 192, list = nimmanager.getSatListForNim(self.feid))
+               self.tuning_sat = getConfigSatlist(192, nimmanager.getSatListForNim(self.feid))
                ScanSetup.createConfig(self, None)
                
                self.updateSats()
index d749e1e7617918fd3618d9b4a684af80c64afa19..1dd71a4872d73f1d33f5288cbbb575cffada65a1 100644 (file)
@@ -3,7 +3,7 @@ from ServiceScan import *
 from Components.config import config, ConfigSubsection, ConfigSelection, ConfigYesNo, ConfigInteger, getConfigListEntry, ConfigSlider, ConfigSatlist, ConfigEnableDisable
 from Components.ActionMap import NumberActionMap
 from Components.ConfigList import ConfigList, ConfigListScreen
-from Components.NimManager import nimmanager
+from Components.NimManager import nimmanager, getConfigSatlist
 from Components.Label import Label
 from Screens.MessageBox import MessageBox
 from enigma import eTimer, eDVBFrontendParametersSatellite, eComponentScan, eDVBSatelliteEquipmentControl, eDVBFrontendParametersTerrestrial, eDVBFrontendParametersCable
@@ -396,14 +396,7 @@ class ScanSetup(ConfigListScreen, Screen):
                        for slot in nimmanager.nimslots:
                                if (nimmanager.getNimType(slot.slotid) == nimmanager.nimType["DVB-S"]):
                                        print str(slot.slotid) + " : " + str(self.satList)
-                                       default_orbpos = None
-                                       orbpos = defaultSat["orbpos"]
-                                       satlist = self.satList[slot.slotid]
-                                       for x in satlist:
-                                               if x[0] == orbpos:
-                                                       default_orbpos = orbpos
-                                                       break
-                                       self.scan_satselection.append(ConfigSatlist(default = default_orbpos, list = satlist))
+                                       self.scan_satselection.append(getConfigSatlist(defaultSat["orbpos"],self.satList[slot.slotid]))
                                else:
                                        self.scan_satselection.append(None)