From 1f97344b2f7ea2bbb02697836fb186eefd8e65ed Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Fri, 11 Jul 2008 07:30:33 +0000 Subject: [PATCH] Fix showing 'Checking' state when doing a forced recheck --- deluge/core/torrent.py | 1 + deluge/core/torrentmanager.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index 2253e176d..448cf435f 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -240,6 +240,7 @@ class Torrent: if ltstate == LTSTATE["Queued"] or ltstate == LTSTATE["Checking"]: self.state = "Checking" + return elif ltstate == LTSTATE["Connecting"] or ltstate == LTSTATE["Downloading"] or\ ltstate == LTSTATE["Downloading Metadata"]: self.state = "Downloading" diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index 343a8c880..3174e3d6b 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -36,6 +36,7 @@ import cPickle import os.path import os +import time import gobject @@ -174,6 +175,7 @@ class TorrentManager(component.Component): self.torrents[key].handle.pause() self.shutdown_torrent_pause_list.append(key) while self.shutdown_torrent_pause_list: + time.sleep(0.1) # Wait for all alerts self.alerts.handle_alerts(True) @@ -709,5 +711,6 @@ class TorrentManager(component.Component): def on_alert_state_changed(self, alert): log.debug("on_alert_state_changed") torrent_id = str(alert.handle.info_hash()) + self.torrents[torrent_id].update_state() component.get("SignalManager").emit("torrent_state_changed", torrent_id)