Tweaks to Peers and Files tabs plugins to handle removal of torrents. Patch is
from eternalswd, thanks.
This commit is contained in:
parent
9d17d21804
commit
cdf3011c81
|
@ -41,6 +41,7 @@ class TorrentFiles:
|
||||||
def __init__(self, path, core, interface):
|
def __init__(self, path, core, interface):
|
||||||
print "Loading TorrentFiles plugin..."
|
print "Loading TorrentFiles plugin..."
|
||||||
self.parent = interface
|
self.parent = interface
|
||||||
|
self.manager = core
|
||||||
|
|
||||||
tree_view = gtk.TreeView()
|
tree_view = gtk.TreeView()
|
||||||
scrolled_window = gtk.ScrolledWindow()
|
scrolled_window = gtk.ScrolledWindow()
|
||||||
|
@ -73,7 +74,8 @@ class TorrentFiles:
|
||||||
if tab_page == current_page:
|
if tab_page == current_page:
|
||||||
unique_id = self.parent.get_selected_torrent()
|
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
|
# If no torrents added or more than one torrent selected
|
||||||
self.tab_files.clear_file_store()
|
self.tab_files.clear_file_store()
|
||||||
self.tab_files.set_unique_id(None)
|
self.tab_files.set_unique_id(None)
|
||||||
|
|
|
@ -41,6 +41,7 @@ class TorrentPeers:
|
||||||
def __init__(self, path, core, interface):
|
def __init__(self, path, core, interface):
|
||||||
print "Loading TorrentPeers plugin..."
|
print "Loading TorrentPeers plugin..."
|
||||||
self.parent = interface
|
self.parent = interface
|
||||||
|
self.manager = core
|
||||||
self.config_file = deluge.common.CONFIG_DIR + "/peers.conf"
|
self.config_file = deluge.common.CONFIG_DIR + "/peers.conf"
|
||||||
self.config = deluge.pref.Preferences(self.config_file)
|
self.config = deluge.pref.Preferences(self.config_file)
|
||||||
try:
|
try:
|
||||||
|
@ -139,7 +140,8 @@ class TorrentPeers:
|
||||||
|
|
||||||
if tab_page == current_page:
|
if tab_page == current_page:
|
||||||
unique_id = self.parent.get_selected_torrent()
|
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
|
#if no torrents added or more than one torrent selected
|
||||||
self.tab_peers.clear_peer_store()
|
self.tab_peers.clear_peer_store()
|
||||||
self.tab_peers.set_unique_id(None)
|
self.tab_peers.set_unique_id(None)
|
||||||
|
|
Loading…
Reference in New Issue