From a73928c23140c9fbb8c7e6bd454a8952ac2618dd Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Fri, 28 Nov 2008 19:09:04 +0000 Subject: [PATCH] Fix filtertreeview behaviour when stopping to clear the treestore --- deluge/ui/gtkui/filtertreeview.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/deluge/ui/gtkui/filtertreeview.py b/deluge/ui/gtkui/filtertreeview.py index c061ab267..0b09ee276 100644 --- a/deluge/ui/gtkui/filtertreeview.py +++ b/deluge/ui/gtkui/filtertreeview.py @@ -73,7 +73,6 @@ class FilterTreeView(component.Component): self.config = ConfigManager("gtkui.conf") self.tracker_icons = TrackerIcons() - self.filters = {} self.label_view = gtk.TreeView() self.sidebar.add_tab(self.label_view, "filters", _("Filters")) @@ -96,9 +95,6 @@ class FilterTreeView(component.Component): #cat, value, label, count, pixmap, visible self.treestore = gtk.TreeStore(str, str, str, int, gtk.gdk.Pixbuf, bool) - #add Cat nodes: - self.cat_nodes = {} - # Create the column column = gtk.TreeViewColumn(_("Filters")) column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) @@ -129,6 +125,11 @@ class FilterTreeView(component.Component): self.color_insensitive = style.base[gtk.STATE_INSENSITIVE] self.color_sensitive = style.base[gtk.STATE_NORMAL] + def start(self): + #add Cat nodes: + self.cat_nodes = {} + self.filters = {} + #initial order of state filter: self.cat_nodes["state"] = self.treestore.append(None, ["cat", "state", _("State"), 0, None, False]) self.update_row("state", "All" , 0) @@ -143,6 +144,9 @@ class FilterTreeView(component.Component): self.selected_path = None + def stop(self): + self.treestore.clear() + def create_model_filter(self): self.model_filter = self.treestore.filter_new() self.model_filter.set_visible_column(FILTER_COLUMN)