define a search function that escapes text as it's escaped in treemodel. fixes #3668

This commit is contained in:
Yann Leboulanger 2008-01-17 22:48:34 +00:00
parent 907f64f021
commit 12fc03ecdc
1 changed files with 8 additions and 0 deletions

View File

@ -5323,6 +5323,11 @@ class RosterWindow:
self._last_selected_contact.append((jid, account))
self.draw_contact(jid, account, selected = True)
def search_roster_func(self, model, column, key, iter):
if model[iter][C_NAME].decode('utf-8').startswith(gobject.markup_escape_text(key)):
return False
return True
def setup_for_osx(self):
# Massage the GTK menu so it will match up to the OS/X nib style menu
# when passed to sync-menu and merged
@ -5565,6 +5570,9 @@ class RosterWindow:
col.set_visible(False)
self.tree.set_expander_column(col)
# set search function
self.tree.set_search_equal_func(self.search_roster_func)
# signals
self.TARGET_TYPE_URI_LIST = 80
TARGETS = [('MY_TREE_MODEL_ROW', gtk.TARGET_SAME_APP | gtk.TARGET_SAME_WIDGET,