From 66e8b34a54bcfe2b3e964d6ac135036f51ee6175 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 6 Jun 2011 19:33:27 +0100 Subject: [PATCH] GTK UI un-select row on torrentview shutdown and filter change. This is specially useful when multiple torrents are selected. This way, the "changed" signal won't be triggered for every row. --- deluge/ui/gtkui/torrentview.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deluge/ui/gtkui/torrentview.py b/deluge/ui/gtkui/torrentview.py index 0414e082c..595ec5572 100644 --- a/deluge/ui/gtkui/torrentview.py +++ b/deluge/ui/gtkui/torrentview.py @@ -450,6 +450,7 @@ class TorrentView(listview.ListView, component.Component): def stop(self): """Stops the torrentview""" # We need to clear the liststore + self.treeview.unselect_all() self.liststore.clear() self.prev_status = {} self.filter = None @@ -467,9 +468,12 @@ class TorrentView(listview.ListView, component.Component): listview.ListView.save_state(self, "torrentview.state") def set_filter(self, filter_dict): - """Sets filters for the torrentview.. + """ + Sets filters for the torrentview.. + see: core.get_torrents_status """ + self.treeview.unselect_all() search_filter = self.filter and self.filter.get('name', None) or None self.filter = dict(filter_dict) #copied version of filter_dict. if search_filter and 'name' not in filter_dict: