fixes bug #291
[enigma2.git] / lib / python / Screens / ScanSetup.py
index 2e48a969981da7a16424163ec5ab4b555a4c219a..fa787a7043500f63583d329b159e90039557fb04 100644 (file)
@@ -295,9 +295,11 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport):
 
                self.list = []
                ConfigListScreen.__init__(self, self.list)
-               self.createSetup()
-
-               self["introduction"] = Label(_("Press OK to start the scan"))
+               if not self.scan_nims.value == "":
+                       self.createSetup()
+                       self["introduction"] = Label(_("Press OK to start the scan"))
+               else:
+                       self["introduction"] = Label(_("Nothing to scan!\nPlease setup your tuner settings before you start a service scan."))
 
        def runAsync(self, finished_cb):
                self.finished_cb = finished_cb
@@ -522,6 +524,8 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport):
                        for n in nimmanager.nim_slots:
                                if n.config_mode == "nothing":
                                        continue
+                               if n.config_mode == "advanced" and len(nimmanager.getSatListForNim(n.slot)) < 1:
+                                       continue
                                if n.config_mode in ("loopthrough", "satposdepends"):
                                        root_id = nimmanager.sec.getRoot(n.slot_id, int(n.config.connectedTo.value))
                                        if n.type == nimmanager.nim_slots[root_id].type: # check if connected from a DVB-S to DVB-S2 Nim or vice versa
@@ -709,6 +713,8 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport):
                tlist.append(buildTerTransponder(*args, **kwargs))
 
        def keyGo(self):
+               if self.scan_nims.value == "":
+                       return
                tlist = []
                flags = None
                startScan = True
@@ -883,6 +889,10 @@ class ScanSimple(ConfigListScreen, Screen, CableTransponderSearchSupport):
                                        need_scan = True
                                        print x, "not in ", known_networks
                                        known_networks.append(x)
+                                       
+                       # don't offer to scan nims if nothing is connected
+                       if not nimmanager.somethingConnected(nim.slot):
+                               need_scan = False                               
 
                        if need_scan:
                                nims_to_scan.append(nim)