From: Stefan Pluecken Date: Tue, 8 Sep 2009 09:19:12 +0000 (+0200) Subject: don't offer scanning on nims where nothing is connected X-Git-Tag: 2.6.0~70^2 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/cfeea5d7bda036654206eefdb2ae96b03bd31969?hp=6d424e7cd304f215e1e40a135033321509db09ec don't offer scanning on nims where nothing is connected --- diff --git a/data/startwizard.xml b/data/startwizard.xml index c004a5e6..70a6e0dc 100644 --- a/data/startwizard.xml +++ b/data/startwizard.xml @@ -73,7 +73,8 @@ self.selectKey("RIGHT") -self.condition = config.misc.startwizard.doservicescan.value +from Components.NimManager import nimmanager +self.condition = config.misc.startwizard.doservicescan.value and nimmanager.somethingConnected() self.hideRc() @@ -87,7 +88,8 @@ self.hideRc() -self.condition = config.misc.startwizard.doservicescan.value +from Components.NimManager import nimmanager +self.condition = config.misc.startwizard.doservicescan.value and nimmanager.somethingConnected() self.hideRc() @@ -100,21 +102,24 @@ self.hideRc() -self.condition = config.misc.startwizard.doservicescan.value +from Components.NimManager import nimmanager +self.condition = config.misc.startwizard.doservicescan.value and nimmanager.somethingConnected() -self.condition = config.misc.startwizard.doservicescan.value +from Components.NimManager import nimmanager +self.condition = config.misc.startwizard.doservicescan.value and nimmanager.somethingConnected() -self.condition = config.misc.startwizard.doservicescan.value +from Components.NimManager import nimmanager +self.condition = config.misc.startwizard.doservicescan.value and nimmanager.somethingConnected() diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index c278213c..70cde47c 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -759,6 +759,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 = [] diff --git a/lib/python/Screens/ScanSetup.py b/lib/python/Screens/ScanSetup.py index 2e48a969..d0af8f7e 100644 --- a/lib/python/Screens/ScanSetup.py +++ b/lib/python/Screens/ScanSetup.py @@ -883,6 +883,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)