code: def scan_tasks(self, ignore_shutdown=False):
          '''扫描所有下载任务, 并在需要时启动新的下载.'''
          for row in self.liststore:
              if len(self.workers.keys()) >= self.app.profile['concurr-download']:
                  break
              if row[STATE_COL] == State.WAITING:
                  self.start_worker(row)
  
          if not self.shutdown_button.get_active() or ignore_shutdown:
              return
          # Shutdown system after all tasks have finished
          for row in self.liststore:
              if (row[STATE_COL] not in
                      (State.PAUSED, State.FINISHED, State.CANCELED)):
                  return
          self.shutdown.shutdown(f scan_tasks(self, ignore_shutdown=False):
          '''扫描所有下载任务, 并在需要时启动新的下载.'''
          for row in self.liststore:
              if len(self.workers.keys()) >= self.app.profile['concurr-download']:
                  break
              if row[STATE_COL] == State.WAITING:
                  self.start_worker(row)
  
          if not self.shutdown_button.get_active() or ignore_shutdown:
              return
          # Shutdown system after all tasks have finished
          for row in self.liststore:
              if (row[STATE_COL] not in
                      (State.PAUSED, State.FINISHED, State.CANCELED)):
                  return
          self.shutdown.shutdown()
docs: 扫描所有下载任务, 并在需要时启动新的下载.