From e43f2370e169dbd1e352a4cf040aed6b1b1b91cd Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Mon, 23 Jun 2008 03:12:28 +0000 Subject: [PATCH] Add queueing options to the Options tab Add setting auto managed from the torrent menu --- deluge/core/core.py | 16 + deluge/core/torrent.py | 29 +- deluge/core/torrentmanager.py | 24 +- deluge/ui/client.py | 4 +- deluge/ui/gtkui/glade/main_window.glade | 1247 ++++++++++++---------- deluge/ui/gtkui/glade/torrent_menu.glade | 7 + deluge/ui/gtkui/menubar.py | 17 + deluge/ui/gtkui/options_tab.py | 35 +- deluge/ui/gtkui/torrentdetails.py | 3 +- 9 files changed, 796 insertions(+), 586 deletions(-) diff --git a/deluge/core/core.py b/deluge/core/core.py index d7988c19b..60c8d9cdb 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -562,6 +562,22 @@ class Core( def export_set_torrent_prioritize_first_last(self, torrent_id, value): """Sets a higher priority to the first and last pieces""" return self.torrents[torrent_id].set_prioritize_first_last(value) + + def export_set_torrent_auto_managed(self, torrent_id, value): + """Sets the auto managed flag for queueing purposes""" + return self.torrents[torrent_id].set_auto_managed(value) + + def export_set_torrent_stop_at_ratio(self, torrent_id, value): + """Sets the torrent to stop at 'stop_ratio'""" + return self.torrents[torrent_id].set_stop_at_ratio(value) + + def export_set_torrent_stop_ratio(self, torrent_id, value): + """Sets the ratio when to stop a torrent if 'stop_at_ratio' is set""" + return self.torrents[torrent_id].set_stop_ratio(value) + + def export_set_torrent_remove_at_ratio(self, torrent_id, value): + """Sets the torrent to be removed at 'stop_ratio'""" + return self.torrents[torrent_id].set_remove_at_ratio(value) def export_block_ip_range(self, range): """Block an ip range""" diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index c0e65225c..3e56d4dcf 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -75,7 +75,9 @@ class Torrent: self.total_uploaded = 0 # Set default auto_managed value - self.set_auto_managed(options["auto_managed"]) + self.auto_managed = options["auto_managed"] + if not handle.is_paused(): + handle.auto_managed(self.auto_managed) # We need to keep track if the torrent is finished in the state to prevent # some weird things on state load. @@ -90,6 +92,10 @@ class Torrent: # Set the filename self.filename = state.filename self.is_finished = state.is_finished + # Set the per-torrent queue options + self.set_stop_at_ratio(state.stop_at_ratio) + self.set_stop_ratio(state.stop_ratio) + self.set_remove_at_ratio(state.remove_at_ratio) else: # Tracker list self.trackers = [] @@ -160,14 +166,22 @@ class Torrent: def set_auto_managed(self, auto_managed): self.auto_managed = auto_managed - if not self.handle.is_paused(): - self.handle.auto_managed(auto_managed) - + self.handle.auto_managed(auto_managed) + self.update_state() + + def set_stop_ratio(self, stop_ratio): + self.stop_ratio = stop_ratio + + def set_stop_at_ratio(self, stop_at_ratio): + self.stop_at_ratio = stop_at_ratio + + def set_remove_at_ratio(self, remove_at_ratio): + self.remove_at_ratio = remove_at_ratio + def set_file_priorities(self, file_priorities): log.debug("setting %s's file priorities: %s", self.torrent_id, file_priorities) self.handle.prioritize_files(file_priorities) - # XXX: I don't think this is needed anymore since we have torrent_resumed alert if 0 in self.file_priorities: # We have previously marked a file 'Do Not Download' # Check to see if we have changed any 0's to >0 and change state accordingly @@ -390,7 +404,10 @@ class Torrent: "active_time": self.status.active_time, "seeding_time": self.status.seeding_time, "seed_rank": self.status.seed_rank, - "is_auto_managed": self.auto_managed + "is_auto_managed": self.auto_managed, + "stop_ratio": self.stop_ratio, + "stop_at_ratio": self.stop_at_ratio, + "remove_at_ratio": self.remove_at_ratio } fns = { diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index c2162a50b..01844b3ad 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -65,7 +65,10 @@ class TorrentState: file_priorities=None, queue=None, auto_managed=None, - is_finished=False + is_finished=False, + stop_ratio=2.00, + stop_at_ratio=False, + remove_at_ratio=True ): self.torrent_id = torrent_id self.filename = filename @@ -85,6 +88,9 @@ class TorrentState: self.prioritize_first_last = prioritize_first_last self.file_priorities = file_priorities self.auto_managed = auto_managed + self.stop_ratio = stop_ratio + self.stop_at_ratio = stop_at_ratio + self.remove_at_ratio = remove_at_ratio class TorrentManagerState: def __init__(self): @@ -158,13 +164,14 @@ class TorrentManager(component.Component): self.alerts.handle_alerts(True) def update(self): - if self.config["stop_seed_at_ratio"]: - for torrent in self.torrents: - if torrent.get_ratio() >= self.config["stop_seed_ratio"] and torrent.is_finished: + for torrent in self.torrents: + if self.config["stop_seed_at_ratio"] or torrent.stop_at_ratio: + if (torrent.get_ratio() >= self.config["stop_seed_ratio"] or\ + torrent.get_ratio() > torrent.stop_ratio) and torrent.is_finished: torrent.pause() - if self.config["remove_seed_at_ratio"]: + if self.config["remove_seed_at_ratio"] or torrent.remove_at_ratio: self.remove(torrent.torrent_id) - + def __getitem__(self, torrent_id): """Return the Torrent with torrent_id""" return self.torrents[torrent_id] @@ -504,7 +511,10 @@ class TorrentManager(component.Component): torrent.file_priorities, torrent.get_queue_position(), torrent.auto_managed, - torrent.is_finished + torrent.is_finished, + torrent.stop_ratio, + torrent.stop_at_ratio, + torrent.remove_at_ratio ) state.torrents.append(torrent_state) diff --git a/deluge/ui/client.py b/deluge/ui/client.py index e2c000882..aa76fe44a 100644 --- a/deluge/ui/client.py +++ b/deluge/ui/client.py @@ -164,7 +164,9 @@ class BaseClient(object): "block_ip_range", "remove_torrent", "pause_torrent", "move_storage", "resume_torrent", "force_reannounce", "force_recheck", "deregister_client", "register_client", "add_torrent_file", - "set_torrent_prioritize_first_last"] + "set_torrent_prioritize_first_last", "set_torrent_auto_managed", + "set_torrent_stop_ratio", "set_torrent_stop_at_ratio", + "set_torrent_remove_at_ratio"] def __init__(self): self.core = _core diff --git a/deluge/ui/gtkui/glade/main_window.glade b/deluge/ui/gtkui/glade/main_window.glade index 4f1ecab98..6be5f9d80 100644 --- a/deluge/ui/gtkui/glade/main_window.glade +++ b/deluge/ui/gtkui/glade/main_window.glade @@ -646,191 +646,276 @@ - + True - 0 - - - 1 - 2 - GTK_FILL - - - - - True - 0 - - - 3 - 4 - GTK_FILL - - - - - True - 0 - - - 1 - 2 - 1 - 2 - GTK_FILL - - - - - True - 0 - - - 3 - 4 - 1 - 2 - GTK_FILL - - - - - True - 5 - - - True - 0 - <b>Downloaded:</b> - True - - - - - GTK_FILL - - - - - True - 5 - - - True - 0 - <b>Uploaded:</b> - True - - - - - 1 - 2 - GTK_FILL - - - - - True - 5 - - - True - 0 - <b>Share Ratio:</b> - True - - - - - 2 - 3 - GTK_FILL - - - - - True - 5 - - - True - 0 - <b>Next Announce:</b> - True - - + 5 + 6 3 4 GTK_FILL - + True - 15 - 5 - - - True - 0 - <b>Speed:</b> - True - - + 0 + <b>Auto Managed:</b> + True - 2 - 3 + 4 + 5 + 3 + 4 GTK_FILL - + True - 15 - 5 - - - True - 0 - <b>Speed:</b> - True - - - 2 - 3 + 7 + 8 + 2 + 3 + GTK_FILL + + + + + True + + + 7 + 8 1 2 GTK_FILL - + True - 15 - 5 - - - True - 0 - <b>ETA:</b> - True - - + 0 + <b>Seed Rank:</b> + True - 2 - 3 + 6 + 7 2 3 GTK_FILL + + + True + 0 + <b>Seeding Time:</b> + True + + + 6 + 7 + 1 + 2 + GTK_FILL + + + + + True + + + 7 + 8 + GTK_FILL + + + + + True + 0 + <b>Active Time:</b> + True + + + 6 + 7 + GTK_FILL + + + + + True + 0 + True + True + + + 1 + 2 + 3 + 4 + GTK_FILL + + + + + True + 0 + + + 3 + 4 + 3 + 4 + GTK_FILL + + + + + True + 0 + PANGO_WRAP_CHAR + True + + + 1 + 6 + 4 + 5 + GTK_FILL + + + + + True + 0 + <b>Tracker Status:</b> + True + + + 4 + 5 + GTK_FILL + + + + + + True + 0 + True + PANGO_WRAP_WORD_CHAR + + + 5 + 6 + 2 + 3 + GTK_FILL + + + + + + True + 0 + 1 + <b>Availability:</b> + True + + + 4 + 5 + 2 + 3 + GTK_FILL + + + + + True + 0 + + + 3 + 4 + 2 + 3 + GTK_FILL + + + + + True + 0 + + + 1 + 2 + 2 + 3 + GTK_FILL + + + + + True + 0 + + + 5 + 6 + 1 + 2 + GTK_FILL + + + + + True + 0 + <b>Peers:</b> + True + + + 4 + 5 + 1 + 2 + GTK_FILL + + + + + True + 0 + + + 5 + 6 + GTK_FILL + + + + + True + 0 + <b>Seeders:</b> + True + + + 4 + 5 + GTK_FILL + + True @@ -854,273 +939,188 @@ - + True - 0 - <b>Seeders:</b> - True + 15 + 5 + + + True + 0 + <b>ETA:</b> + True + + - 4 - 5 - GTK_FILL - - - - - True - 0 - - - 5 - 6 - GTK_FILL - - - - - True - 0 - <b>Peers:</b> - True - - - 4 - 5 - 1 - 2 - GTK_FILL - - - - - True - 0 - - - 5 - 6 - 1 - 2 - GTK_FILL - - - - - True - 0 - - - 1 - 2 + 2 + 3 2 3 GTK_FILL - + + True + 15 + 5 + + + True + 0 + <b>Speed:</b> + True + + + + + 2 + 3 + 1 + 2 + GTK_FILL + + + + + True + 15 + 5 + + + True + 0 + <b>Speed:</b> + True + + + + + 2 + 3 + GTK_FILL + + + + + True + 5 + + + True + 0 + <b>Next Announce:</b> + True + + + + + 3 + 4 + GTK_FILL + + + + + True + 5 + + + True + 0 + <b>Share Ratio:</b> + True + + + + + 2 + 3 + GTK_FILL + + + + + True + 5 + + + True + 0 + <b>Uploaded:</b> + True + + + + + 1 + 2 + GTK_FILL + + + + + True + 5 + + + True + 0 + <b>Downloaded:</b> + True + + + + + GTK_FILL + + + + True 0 3 4 - 2 - 3 + 1 + 2 GTK_FILL - + True 0 - 1 - <b>Availability:</b> - True - - - 4 - 5 - 2 - 3 - GTK_FILL - - - - - True - 0 - True - PANGO_WRAP_WORD_CHAR - - - 5 - 6 - 2 - 3 - GTK_FILL - - - - - - True - 0 - <b>Tracker Status:</b> - True - - - 4 - 5 - GTK_FILL - - - - - - True - 0 - PANGO_WRAP_CHAR - True 1 - 6 - 4 - 5 + 2 + 1 + 2 GTK_FILL - + True 0 3 4 - 3 - 4 GTK_FILL - + True 0 - True - True 1 2 - 3 - 4 - GTK_FILL - - - - - True - 0 - <b>Active Time:</b> - True - - - 6 - 7 - GTK_FILL - - - - - True - - - 7 - 8 - GTK_FILL - - - - - True - 0 - <b>Seeding Time:</b> - True - - - 6 - 7 - 1 - 2 - GTK_FILL - - - - - True - 0 - <b>Seed Rank:</b> - True - - - 6 - 7 - 2 - 3 - GTK_FILL - - - - - True - - - 7 - 8 - 1 - 2 - GTK_FILL - - - - - True - - - 7 - 8 - 2 - 3 - GTK_FILL - - - - - True - 0 - <b>Auto Managed:</b> - True - - - 4 - 5 - 3 - 4 - GTK_FILL - - - - - True - - - 5 - 6 - 3 - 4 GTK_FILL @@ -1207,7 +1207,7 @@ - + True 0 True @@ -1215,42 +1215,28 @@ 1 2 - 3 - 4 + 4 + 5 - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - - - 1 - 4 - 5 - 6 - - - - - + True 0 1 - <b>Status:</b> + <b># of files:</b> True - 5 - 6 + 4 + 5 GTK_FILL - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 @@ -1261,65 +1247,52 @@ 1 4 - 2 - 3 + 1 + 2 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 5 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - <b>Path:</b> - True - - + 0 + <b>Hash:</b> + True - 2 - 3 + 1 + 2 GTK_FILL - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 5 - - - True - 0 - 0 - 1 - <b>Name:</b> - True - - - - - GTK_FILL - - - - - + True 0 - True - PANGO_WRAP_CHAR True 1 4 + 6 + 7 + + + + + + True + 0 + 1 + <b>Tracker:</b> + True + + + 6 + 7 + GTK_FILL @@ -1346,51 +1319,64 @@ - - True - 0 - 1 - <b>Tracker:</b> - True - - - 6 - 7 - GTK_FILL - - - - - + True 0 + True + PANGO_WRAP_CHAR True 1 4 - 6 - 7 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - <b>Hash:</b> - True + 5 + + + True + 0 + 0 + 1 + <b>Name:</b> + True + + - 1 - 2 GTK_FILL - + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + <b>Path:</b> + True + + + + + 2 + 3 + GTK_FILL + + + + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 @@ -1401,28 +1387,42 @@ 1 4 - 1 - 2 + 2 + 3 - + True 0 1 - <b># of files:</b> + <b>Status:</b> True - 4 - 5 + 5 + 6 GTK_FILL - + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + + + 1 + 4 + 5 + 6 + + + + + True 0 True @@ -1430,8 +1430,8 @@ 1 2 - 4 - 5 + 3 + 4 @@ -1614,7 +1614,7 @@ - + True True 6 @@ -1624,100 +1624,8 @@ 1 2 - 3 - 4 - - - - - - - True - 0 - Max Upload Slots: - - - 3 - 4 - GTK_FILL - - - - - - True - KiB/s - - - 2 - 3 - 1 - 2 - - - - - - - True - KiB/s - - - 2 - 3 - - - - - - - True - 0 - Max Download Speed: - - - GTK_FILL - - - - - - True - 0 - Max Upload Speed: - - - 1 - 2 - GTK_FILL - - - - - - True - 0 - Max Connections: - - 2 3 - GTK_FILL - - - - - - True - True - 6 - 1 - -1 -1 999999 1 10 10 - 1 - - - 1 - 2 @@ -1741,7 +1649,99 @@ - + + True + True + 6 + 1 + -1 -1 999999 1 10 10 + 1 + + + 1 + 2 + + + + + + + True + 0 + Max Connections: + + + 2 + 3 + GTK_FILL + + + + + + True + 0 + Max Upload Speed: + + + 1 + 2 + GTK_FILL + + + + + + True + 0 + Max Download Speed: + + + GTK_FILL + + + + + + True + KiB/s + + + 2 + 3 + + + + + + + True + KiB/s + + + 2 + 3 + 1 + 2 + + + + + + + True + 0 + Max Upload Slots: + + + 3 + 4 + GTK_FILL + + + + + True True 6 @@ -1751,8 +1751,8 @@ 1 2 - 2 - 3 + 3 + 4 @@ -1777,6 +1777,118 @@ False + + + True + 0 + GTK_SHADOW_NONE + + + True + 5 + 12 + + + True + + + True + True + Auto Managed + 0 + True + + + False + False + + + + + True + + + True + 5 + + + True + True + Stop seed at ratio: + 0 + True + + + False + False + + + + + True + True + 1 + 2 0 999 0.10000000000000001 10 10 + 2 + + + False + False + 1 + + + + + False + False + + + + + True + 10 + + + True + True + Remove at ratio + 0 + True + + + + + False + False + 1 + + + + + 1 + + + + + + + + + True + <b>Queue</b> + True + + + label_item + + + + + False + False + 1 + + True @@ -1788,6 +1900,7 @@ True + 5 12 @@ -1921,7 +2034,7 @@ False False - 1 + 2 diff --git a/deluge/ui/gtkui/glade/torrent_menu.glade b/deluge/ui/gtkui/glade/torrent_menu.glade index e232e10a3..60fa3fb99 100644 --- a/deluge/ui/gtkui/glade/torrent_menu.glade +++ b/deluge/ui/gtkui/glade/torrent_menu.glade @@ -306,6 +306,13 @@ + + + True + _Auto Managed + True + + True diff --git a/deluge/ui/gtkui/menubar.py b/deluge/ui/gtkui/menubar.py index 1a8937f6e..262877c34 100644 --- a/deluge/ui/gtkui/menubar.py +++ b/deluge/ui/gtkui/menubar.py @@ -84,6 +84,16 @@ class MenuBar(component.Component): submenu.show_all() self.torrentmenu_glade.get_widget(menuitem).set_submenu(submenu) + submenu = gtk.Menu() + item = gtk.MenuItem(_("On")) + item.connect("activate", self.on_menuitem_set_automanaged_on) + submenu.append(item) + item = gtk.MenuItem(_("Off")) + item.connect("activate", self.on_menuitem_set_automanaged_off) + submenu.append(item) + submenu.show_all() + self.torrentmenu_glade.get_widget("menuitem_auto_managed").set_submenu(submenu) + self.torrentmenu = self.torrentmenu_glade.get_widget("torrent_menu") self.menu_torrent = self.window.main_glade.get_widget("menu_torrent") @@ -422,3 +432,10 @@ class MenuBar(component.Component): for torrent in component.get("TorrentView").get_selected_torrents(): funcs[widget.name](torrent, value) + def on_menuitem_set_automanaged_on(self, widget): + for torrent in component.get("TorrentView").get_selected_torrents(): + client.set_torrent_auto_managed(torrent, True) + + def on_menuitem_set_automanaged_off(self, widget): + for torrent in component.get("TorrentView").get_selected_torrents(): + client.set_torrent_auto_managed(torrent, False) diff --git a/deluge/ui/gtkui/options_tab.py b/deluge/ui/gtkui/options_tab.py index 39ec57bbf..d88ec240e 100644 --- a/deluge/ui/gtkui/options_tab.py +++ b/deluge/ui/gtkui/options_tab.py @@ -49,6 +49,10 @@ class OptionsTab(Tab): self.spin_max_upload_slots = glade.get_widget("spin_max_upload_slots") self.chk_private = glade.get_widget("chk_private") self.chk_prioritize_first_last = glade.get_widget("chk_prioritize_first_last") + self.chk_auto_managed = glade.get_widget("chk_auto_managed") + self.chk_stop_at_ratio = glade.get_widget("chk_stop_at_ratio") + self.chk_remove_at_ratio = glade.get_widget("chk_remove_at_ratio") + self.spin_stop_ratio = glade.get_widget("spin_stop_ratio") self.prev_torrent_id = None self.prev_status = None @@ -78,19 +82,24 @@ class OptionsTab(Tab): "max_connections", "max_upload_slots", "private", - "prioritize_first_last"]) + "prioritize_first_last", + "is_auto_managed", + "stop_at_ratio", + "stop_ratio", + "remove_at_ratio"]) self.prev_torrent_id = torrent_id def clear(self): - pass + self.prev_torrent_id = None + self.prev_status = None def _on_get_torrent_status(self, status): # We only want to update values that have been applied in the core. This # is so we don't overwrite the user changes that haven't been applied yet. if self.prev_status == None: self.prev_status = {}.fromkeys(status.keys(), None) - - if status != self.prev_status and status.keys() == self.prev_status.keys(): + + if status != self.prev_status: if status["max_download_speed"] != self.prev_status["max_download_speed"]: self.spin_max_download.set_value(status["max_download_speed"]) if status["max_upload_speed"] != self.prev_status["max_upload_speed"]: @@ -103,6 +112,15 @@ class OptionsTab(Tab): self.chk_private.set_active(status["private"]) if status["prioritize_first_last"] != self.prev_status["prioritize_first_last"]: self.chk_prioritize_first_last.set_active(status["prioritize_first_last"]) + if status["is_auto_managed"] != self.prev_status["is_auto_managed"]: + self.chk_auto_managed.set_active(status["is_auto_managed"]) + if status["stop_at_ratio"] != self.prev_status["stop_at_ratio"]: + self.chk_stop_at_ratio.set_active(status["stop_at_ratio"]) + if status["stop_ratio"] != self.prev_status["stop_ratio"]: + self.spin_stop_ratio.set_value(status["stop_ratio"]) + if status["remove_at_ratio"] != self.prev_status["remove_at_ratio"]: + self.chk_remove_at_ratio.set_active(status["remove_at_ratio"]) + self.prev_status = status def _on_button_apply_clicked(self, button): @@ -116,6 +134,15 @@ class OptionsTab(Tab): client.set_torrent_max_upload_slots(self.prev_torrent_id, self.spin_max_upload_slots.get_value_as_int()) if self.chk_prioritize_first_last.get_active() != self.prev_status["prioritize_first_last"]: client.set_torrent_prioritize_first_last(self.prev_torrent_id, self.chk_prioritize_first_last.get_active()) + if self.chk_auto_managed.get_active() != self.prev_status["is_auto_managed"]: + client.set_torrent_auto_managed(self.prev_torrent_id, self.chk_auto_managed.get_active()) + if self.chk_stop_at_ratio.get_active() != self.prev_status["stop_at_ratio"]: + client.set_torrent_stop_at_ratio(self.prev_torrent_id, self.chk_stop_at_ratio.get_active()) + if self.spin_stop_ratio.get_value() != self.prev_status["stop_ratio"]: + client.set_torrent_stop_ratio(self.prev_torrent_id, self.spin_stop_ratio.get_value()) + if self.chk_remove_at_ratio.get_active() != self.prev_status["remove_at_ratio"]: + client.set_torrent_remove_at_ratio(self.prev_torrent_id, self.chk_remove_at_ratio.get_active()) + def _on_button_edit_trackers_clicked(self, button): from edittrackersdialog import EditTrackersDialog diff --git a/deluge/ui/gtkui/torrentdetails.py b/deluge/ui/gtkui/torrentdetails.py index 2c0427763..86658ab01 100644 --- a/deluge/ui/gtkui/torrentdetails.py +++ b/deluge/ui/gtkui/torrentdetails.py @@ -234,7 +234,7 @@ class TorrentDetails(component.Component): if len(component.get("TorrentView").get_selected_torrents()) == 0: # No torrents selected, so just clear self.clear() - + if self.notebook.get_property("visible"): if page_num == None: page_num = self.notebook.get_current_page() @@ -244,6 +244,7 @@ class TorrentDetails(component.Component): except IndexError: return # Update the tab that is in view + log.debug("tab_name: %s", name) self.tabs[name].update() def clear(self):