add enq cancel
[enigma2.git] / lib / python / Components / NimManager.py
index 14517d75e9abcd306fc4c836c53678782fd790f0..2baf50b3b8e3ce688ab6dc1f2ef1ebbb49f9bdab 100644 (file)
@@ -189,10 +189,10 @@ class NimManager:
                self.transponders = { }
                self.transponderscable = { }
                self.transpondersterrestrial = { }              
-
+               
+               parser = make_parser()
                if (self.hasNimType(self.nimType["DVB-S"])):
                        print "Reading satellites.xml"
-                       parser = make_parser()
                        satHandler = self.parseSats(self.satList, self.satellites, self.transponders)
                        parser.setContentHandler(satHandler)
                        parser.parse('/etc/tuxbox/satellites.xml')
@@ -253,6 +253,13 @@ class NimManager:
                        if (chktype == self.nimType[str(type)]):
                                return True
                return False
+       
+       def getNimListOfType(self, type, exception = -1):
+               list = []
+               for x in self.nimslots:
+                       if ((x.nimType == type) and (x.slotid != exception)):
+                               list.append(x.slotid)
+               return list
 
        def getConfigPrefix(self, slotid):
                return "config.Nim" + ("A","B","C","D")[slotid] + "."
@@ -359,7 +366,7 @@ def InitNimManager(nimmgr):
                nim = config.Nims[x]
                
                if slot.nimType == nimmgr.nimType["DVB-S"]:
-                       nim.configMode = configElement(cname + "configMode", configSelection, 0, (_("Simple"), _("Advanced")));
+                       nim.configMode = configElement(cname + "configMode", configSelection, 0, (_("Simple"), _("Linked tuner"))) # _("Advanced")));
                        nim.diseqcMode = configElement(cname + "diseqcMode", configSelection, 2, (_("Single"), _("Toneburst A/B"), _("DiSEqC A/B"), _("DiSEqC A/B/C/D"), _("Positioner")));
                        nim.diseqcA = configElement(cname + "diseqcA", configSatlist, 192, nimmgr.satList);
                        nim.diseqcB = configElement(cname + "diseqcB", configSatlist, 130, nimmgr.satList);
@@ -368,6 +375,12 @@ def InitNimManager(nimmgr):
                        nim.longitude = configElement(cname + "longitude", configSequence, [0,0], configsequencearg.get("FLOAT", [(0,90),(0,999)]));
                        nim.latitude = configElement(cname + "latitude", configSequence, [0,0], configsequencearg.get("FLOAT", [(0,90),(0,999)]));
                        
+                       satNimList = nimmgr.getNimListOfType(nimmgr.nimType["DVB-S"], slot.slotid)
+                       satNimListNames = []
+                       for x in satNimList:
+                               satNimListNames.append(_("Slot ") + ("A", "B", "C", "D")[x] + ": " + nimmgr.getNimName(x))
+                       nim.linkedTo = configElement(cname + "linkedTo", configSelection, 0, satNimListNames);
+                       
                        #perhaps the instance of the slot is more useful?
                        nim.configMode.addNotifier(boundFunction(nimConfigModeChanged,x))
                        nim.diseqcMode.addNotifier(boundFunction(nimDiseqcModeChanged,x))