From 8c3ab96db9c404f6ad568ecae55d7babc39300f2 Mon Sep 17 00:00:00 2001 From: Zach Tibbitts Date: Mon, 19 Feb 2007 21:19:23 +0000 Subject: [PATCH] selective downloading --- src/deluge.py | 2 +- src/delugegtk.py | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/deluge.py b/src/deluge.py index 9b1faaefa..f56aca8d6 100644 --- a/src/deluge.py +++ b/src/deluge.py @@ -492,7 +492,7 @@ class Manager: self.unique_IDs[unique_ID].file_filter = file_filter[:] - deluge_core.set_filter_out(file_filter) + deluge_core.set_filter_out(unique_ID, file_filter) def get_file_filter(self, unique_ID): try: diff --git a/src/delugegtk.py b/src/delugegtk.py index a3c63b9e0..3a0b68a1c 100644 --- a/src/delugegtk.py +++ b/src/delugegtk.py @@ -330,9 +330,23 @@ class DelugeGTK(dbus.service.Object): dgtk.add_text_column(self.file_view, _("Size"), 1) dgtk.add_text_column(self.file_view, _("Offset"), 2) dgtk.add_text_column(self.file_view, _("Progress"), 3) - dgtk.add_toggle_column(self.file_view, _("Download"), 4) + dgtk.add_toggle_column(self.file_view, _("Download"), 4, toggled_signal=self.file_toggled) filename_col.set_expand(True) + + def file_toggled(self, renderer, path): + file_iter = self.file_store.get_iter_from_string(path) + value = not renderer.get_active() + self.file_store.set_value(file_iter, 4, value) + print "old",self.manager.get_file_filter(self.get_selected_torrent()) + file_filter = [] + itr = self.file_store.get_iter_first() + while itr is not None: + file_filter.append(self.file_store.get_value(itr, 4)) + itr = self.file_store.iter_next(itr) + print file_filter + self.manager.set_file_filter(self.get_selected_torrent(), file_filter) + def load_default_settings(self): self.pref.set("enable_system_tray", True)