revert some no more needed bug_258_sorting_of_configsatlist changes
[enigma2.git] / lib / python / Components / NimManager.py
index 6222afeaa6e65656d31e8f78b6be0c02457fe0be..8d6cff165b9cd4182800040499d51b220612c038 100644 (file)
@@ -46,7 +46,7 @@ class SecConfigure:
                if self.equal.has_key(slotid):
                        for slot in self.equal[slotid]:
                                tunermask |= (1 << slot)
-               elif self.linked.has_key(slotid):
+               if self.linked.has_key(slotid):
                        for slot in self.linked[slotid]:
                                tunermask |= (1 << slot)
                sec.setLNBSatCR(-1)
@@ -262,7 +262,7 @@ class SecConfigure:
                                if self.equal.has_key(slotid):
                                        for slot in self.equal[slotid]:
                                                tunermask |= (1 << slot)
-                               elif self.linked.has_key(slotid):
+                               if self.linked.has_key(slotid):
                                        for slot in self.linked[slotid]:
                                                tunermask |= (1 << slot)
 
@@ -321,9 +321,9 @@ class SecConfigure:
                                elif dm == "1_2":
                                        sec.setDiSEqCMode(diseqcParam.V1_2)
 
-                               if self.satposdepends.has_key(slotid):
-                                       for slot in self.satposdepends[slotid]:
-                                               tunermask |= (1 << slot)
+                                       if self.satposdepends.has_key(slotid):
+                                               for slot in self.satposdepends[slotid]:
+                                                       tunermask |= (1 << slot)
 
                                if dm != "none":
                                        if currLnb.toneburst.value == "none":
@@ -565,9 +565,10 @@ class NimManager:
                if self.hasNimType("DVB-S"):
                        print "Reading satellites.xml"
                        db.readSatellites(self.satList, self.satellites, self.transponders)
-#                      print "SATLIST", self.satList
-#                      print "SATS", self.satellites
-#                      print "TRANSPONDERS", self.transponders
+                       self.satList.sort(key = lambda x: x[0]) # sort by orbpos
+                       #print "SATLIST", self.satList
+                       #print "SATS", self.satellites
+                       #print "TRANSPONDERS", self.transponders
 
                if self.hasNimType("DVB-C"):
                        print "Reading cables.xml"
@@ -759,6 +760,22 @@ class NimManager:
 
        def getSatList(self):
                return self.satList
+       
+       # returns True if something is configured to be connected to this nim
+       # if slotid == -1, returns if something is connected to ANY nim
+       def somethingConnected(self, slotid = -1):
+               if (slotid == -1):
+                       connected = False
+                       for id in range(self.getSlotCount()):
+                               if self.somethingConnected(id):
+                                       connected = True
+                       return connected
+               else:
+                       nim = config.Nims[slotid]
+                       configMode = nim.configMode.value
+               
+                       if self.nim_slots[slotid].isCompatible("DVB-S") or self.nim_slots[slotid].isCompatible("DVB-T") or self.nim_slots[slotid].isCompatible("DVB-C"):
+                               return not (configMode == "nothing")            
 
        def getSatListForNim(self, slotid):
                list = []
@@ -856,7 +873,7 @@ def InitSecParams():
        config.sec.delay_after_last_diseqc_command = x
 
        x = ConfigInteger(default=50, limits = (0, 9999))
-       x.addNotifier(lambda configElement: secClass.setParam(secClass.DELAY_AFTER_TONEBURST, configElement.value), initial_call = False)
+       x.addNotifier(lambda configElement: secClass.setParam(secClass.DELAY_AFTER_TONEBURST, configElement.value))
        config.sec.delay_after_toneburst = x
 
        x = ConfigInteger(default=20, limits = (0, 9999))
@@ -923,7 +940,7 @@ def InitNimManager(nimmgr):
 
        lnb_choices = {
                "universal_lnb": _("Universal LNB"),
-               "unicable": _("Unicable"),
+#              "unicable": _("Unicable"),
                "c_band": _("C-Band"),
                "user_defined": _("User defined")}