From 229863bc0b4924886c569c01f6b3edd1108c6fca Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Fri, 13 May 2005 18:05:15 +0000 Subject: [PATCH] glade fixes in advanced window and applying patch to make filter work [thanks Vincent Hanquez] --- src/advanced.py | 10 ++++++++-- src/gtkgui.glade | 30 +++++++++--------------------- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/src/advanced.py b/src/advanced.py index f33b36279..8000d32b6 100644 --- a/src/advanced.py +++ b/src/advanced.py @@ -69,7 +69,8 @@ class Advanced_window: type = val[OPT_TYPE][0] model.append(iter, [name, val[OPT_VAL], type]) - def visible_func(self, model, iter, str): + def visible_func(self, model, iter): + str = self.entry.get_text() if str is None or str == '': return True # show all name = model.get_value(iter, 0) @@ -79,12 +80,15 @@ class Advanced_window: def on_advanced_entry_changed(self, widget): text = widget.get_text() + self.modelfilter.refilter() def __init__(self, plugin): self.plugin = plugin self.xml = gtk.glade.XML(GTKGUI_GLADE, 'advanced_window', None) self.window = self.xml.get_widget('advanced_window') + self.entry = self.xml.get_widget('advanced_entry') + self.xml.signal_autoconnect(self) treeview = self.xml.get_widget('advanced_treeview') @@ -92,6 +96,8 @@ class Advanced_window: gobject.TYPE_STRING, gobject.TYPE_STRING) self.model.set_sort_column_id(0, gtk.SORT_ASCENDING) + self.modelfilter = self.model.filter_new() + self.modelfilter.set_visible_func(self.visible_func) renderer_text = gtk.CellRendererText() treeview.insert_column_with_attributes(-1, 'Preference Name', @@ -112,7 +118,7 @@ class Advanced_window: # add data to model gajim.config.foreach(self.fill, self.model) - treeview.set_model(self.model) + treeview.set_model(self.modelfilter) self.plugin.windows['advanced_config'] = self self.window.show_all() diff --git a/src/gtkgui.glade b/src/gtkgui.glade index 54b604883..0104ec212 100644 --- a/src/gtkgui.glade +++ b/src/gtkgui.glade @@ -3611,17 +3611,17 @@ - + True True - Never + On every line True GTK_RELIEF_NORMAL True False False True - + 0 @@ -3641,7 +3641,7 @@ False False True - time_never_radiobutton + time_always_radiobutton @@ -3652,18 +3652,18 @@ - + True True - On every line + Never True GTK_RELIEF_NORMAL True False False True - time_never_radiobutton - + time_always_radiobutton + 0 @@ -10758,10 +10758,9 @@ send a chat message to - 5 True False - 10 + 5 @@ -10854,17 +10853,6 @@ send a chat message to - - - True - - - 0 - False - True - - - True