Fix filtertreeview behaviour when stopping to clear the treestore
This commit is contained in:
parent
da120c744d
commit
a73928c231
|
@ -73,7 +73,6 @@ class FilterTreeView(component.Component):
|
||||||
self.config = ConfigManager("gtkui.conf")
|
self.config = ConfigManager("gtkui.conf")
|
||||||
self.tracker_icons = TrackerIcons()
|
self.tracker_icons = TrackerIcons()
|
||||||
|
|
||||||
self.filters = {}
|
|
||||||
self.label_view = gtk.TreeView()
|
self.label_view = gtk.TreeView()
|
||||||
self.sidebar.add_tab(self.label_view, "filters", _("Filters"))
|
self.sidebar.add_tab(self.label_view, "filters", _("Filters"))
|
||||||
|
|
||||||
|
@ -96,9 +95,6 @@ class FilterTreeView(component.Component):
|
||||||
#cat, value, label, count, pixmap, visible
|
#cat, value, label, count, pixmap, visible
|
||||||
self.treestore = gtk.TreeStore(str, str, str, int, gtk.gdk.Pixbuf, bool)
|
self.treestore = gtk.TreeStore(str, str, str, int, gtk.gdk.Pixbuf, bool)
|
||||||
|
|
||||||
#add Cat nodes:
|
|
||||||
self.cat_nodes = {}
|
|
||||||
|
|
||||||
# Create the column
|
# Create the column
|
||||||
column = gtk.TreeViewColumn(_("Filters"))
|
column = gtk.TreeViewColumn(_("Filters"))
|
||||||
column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
|
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_insensitive = style.base[gtk.STATE_INSENSITIVE]
|
||||||
self.color_sensitive = style.base[gtk.STATE_NORMAL]
|
self.color_sensitive = style.base[gtk.STATE_NORMAL]
|
||||||
|
|
||||||
|
def start(self):
|
||||||
|
#add Cat nodes:
|
||||||
|
self.cat_nodes = {}
|
||||||
|
self.filters = {}
|
||||||
|
|
||||||
#initial order of state filter:
|
#initial order of state filter:
|
||||||
self.cat_nodes["state"] = self.treestore.append(None, ["cat", "state", _("State"), 0, None, False])
|
self.cat_nodes["state"] = self.treestore.append(None, ["cat", "state", _("State"), 0, None, False])
|
||||||
self.update_row("state", "All" , 0)
|
self.update_row("state", "All" , 0)
|
||||||
|
@ -143,6 +144,9 @@ class FilterTreeView(component.Component):
|
||||||
|
|
||||||
self.selected_path = None
|
self.selected_path = None
|
||||||
|
|
||||||
|
def stop(self):
|
||||||
|
self.treestore.clear()
|
||||||
|
|
||||||
def create_model_filter(self):
|
def create_model_filter(self):
|
||||||
self.model_filter = self.treestore.filter_new()
|
self.model_filter = self.treestore.filter_new()
|
||||||
self.model_filter.set_visible_column(FILTER_COLUMN)
|
self.model_filter.set_visible_column(FILTER_COLUMN)
|
||||||
|
|
Loading…
Reference in New Issue