ScanSetup.py: fix abort in transpondersearch when the external transponder tool is...
authorghost <andreas.monzner@multimedia-labs.de>
Mon, 8 Nov 2010 14:45:29 +0000 (15:45 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Mon, 8 Nov 2010 14:45:53 +0000 (15:45 +0100)
lib/python/Screens/ScanSetup.py

index e52f8b8767009e8835f86d9f3ebbc4569bf4da8d..6c142c51fa9059f62878f4734b0e59aa2de19731 100644 (file)
@@ -118,10 +118,14 @@ class CableTransponderSearchSupport:
                self.resetTimeout()
                self.cable_search_container.appClosed.remove(self.cableTransponderSearchClosed)
                self.cable_search_container.dataAvail.remove(self.getCableTransponderData)
+               if val and len(val):
+                       if val[0]:
+                               self.setCableTransponderSearchResult(self.__tlist)
+                       else:
+                               self.cable_search_container.sendCtrlC()
+                               self.setCableTransponderSearchResult(None)
                self.cable_search_container = None
                self.cable_search_session = None
-               if val and len(val) and val[0]:
-                       self.setCableTransponderSearchResult(self.__tlist)
                self.__tlist = None
                self.cableTransponderSearchFinished()
 
@@ -846,7 +850,10 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport):
                self.tlist = tlist
 
        def cableTransponderSearchFinished(self):
-               self.startScan(self.tlist, self.flags, self.feid)
+               if self.tlist is None:
+                       self.tlist = []
+               else:
+                       self.startScan(self.tlist, self.flags, self.feid)
 
        def startScan(self, tlist, flags, feid):
                if len(tlist):
@@ -1012,7 +1019,8 @@ class ScanSimple(ConfigListScreen, Screen, CableTransponderSearchSupport):
                                self.session.open(MessageBox, _("Nothing to scan!\nPlease setup your tuner settings before you start a service scan."), MessageBox.TYPE_ERROR)
 
        def setCableTransponderSearchResult(self, tlist):
-               self.scanList.append({"transponders": tlist, "feid": self.feid, "flags": self.flags})
+               if tlist is not None:
+                       self.scanList.append({"transponders": tlist, "feid": self.feid, "flags": self.flags})
 
        def cableTransponderSearchFinished(self):
                self.buildTransponderList()