Tweaks to Peers and Files tabs plugins to handle removal of torrents. Patch is

from eternalswd, thanks.
This commit is contained in:
Alex Dedul 2007-08-06 04:02:42 +00:00
parent 9d17d21804
commit cdf3011c81
2 changed files with 7 additions and 3 deletions

View File

@ -41,7 +41,8 @@ class TorrentFiles:
def __init__(self, path, core, interface):
print "Loading TorrentFiles plugin..."
self.parent = interface
self.manager = core
tree_view = gtk.TreeView()
scrolled_window = gtk.ScrolledWindow()
scrolled_window.add(tree_view)
@ -73,7 +74,8 @@ class TorrentFiles:
if tab_page == current_page:
unique_id = self.parent.get_selected_torrent()
if unique_id is None:
if unique_id is None or \
unique_id in self.manager.removed_unique_ids:
# If no torrents added or more than one torrent selected
self.tab_files.clear_file_store()
self.tab_files.set_unique_id(None)

View File

@ -41,6 +41,7 @@ class TorrentPeers:
def __init__(self, path, core, interface):
print "Loading TorrentPeers plugin..."
self.parent = interface
self.manager = core
self.config_file = deluge.common.CONFIG_DIR + "/peers.conf"
self.config = deluge.pref.Preferences(self.config_file)
try:
@ -139,7 +140,8 @@ class TorrentPeers:
if tab_page == current_page:
unique_id = self.parent.get_selected_torrent()
if unique_id is None:
if unique_id is None or \
unique_id in self.manager.removed_unique_ids:
#if no torrents added or more than one torrent selected
self.tab_peers.clear_peer_store()
self.tab_peers.set_unique_id(None)