Fix showing 'Checking' state when doing a forced recheck

This commit is contained in:
Andrew Resch 2008-07-11 07:30:33 +00:00
parent 2b9663edce
commit 1f97344b2f
2 changed files with 4 additions and 0 deletions

View File

@ -240,6 +240,7 @@ class Torrent:
if ltstate == LTSTATE["Queued"] or ltstate == LTSTATE["Checking"]: if ltstate == LTSTATE["Queued"] or ltstate == LTSTATE["Checking"]:
self.state = "Checking" self.state = "Checking"
return
elif ltstate == LTSTATE["Connecting"] or ltstate == LTSTATE["Downloading"] or\ elif ltstate == LTSTATE["Connecting"] or ltstate == LTSTATE["Downloading"] or\
ltstate == LTSTATE["Downloading Metadata"]: ltstate == LTSTATE["Downloading Metadata"]:
self.state = "Downloading" self.state = "Downloading"

View File

@ -36,6 +36,7 @@
import cPickle import cPickle
import os.path import os.path
import os import os
import time
import gobject import gobject
@ -174,6 +175,7 @@ class TorrentManager(component.Component):
self.torrents[key].handle.pause() self.torrents[key].handle.pause()
self.shutdown_torrent_pause_list.append(key) self.shutdown_torrent_pause_list.append(key)
while self.shutdown_torrent_pause_list: while self.shutdown_torrent_pause_list:
time.sleep(0.1)
# Wait for all alerts # Wait for all alerts
self.alerts.handle_alerts(True) self.alerts.handle_alerts(True)
@ -709,5 +711,6 @@ class TorrentManager(component.Component):
def on_alert_state_changed(self, alert): def on_alert_state_changed(self, alert):
log.debug("on_alert_state_changed") log.debug("on_alert_state_changed")
torrent_id = str(alert.handle.info_hash()) torrent_id = str(alert.handle.info_hash())
self.torrents[torrent_id].update_state()
component.get("SignalManager").emit("torrent_state_changed", torrent_id) component.get("SignalManager").emit("torrent_state_changed", torrent_id)