define a search function that escapes text as it's escaped in treemodel. fixes #3668
This commit is contained in:
		
							parent
							
								
									907f64f021
								
							
						
					
					
						commit
						12fc03ecdc
					
				
					 1 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
					@ -5323,6 +5323,11 @@ class RosterWindow:
 | 
				
			||||||
			self._last_selected_contact.append((jid, account))
 | 
								self._last_selected_contact.append((jid, account))
 | 
				
			||||||
			self.draw_contact(jid, account, selected = True)
 | 
								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):
 | 
						def setup_for_osx(self):
 | 
				
			||||||
		# Massage the GTK menu so it will match up to the OS/X nib style menu
 | 
							# Massage the GTK menu so it will match up to the OS/X nib style menu
 | 
				
			||||||
		# when passed to sync-menu and merged
 | 
							# when passed to sync-menu and merged
 | 
				
			||||||
| 
						 | 
					@ -5565,6 +5570,9 @@ class RosterWindow:
 | 
				
			||||||
		col.set_visible(False)
 | 
							col.set_visible(False)
 | 
				
			||||||
		self.tree.set_expander_column(col)
 | 
							self.tree.set_expander_column(col)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							# set search function
 | 
				
			||||||
 | 
							self.tree.set_search_equal_func(self.search_roster_func)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		# signals
 | 
							# signals
 | 
				
			||||||
		self.TARGET_TYPE_URI_LIST = 80
 | 
							self.TARGET_TYPE_URI_LIST = 80
 | 
				
			||||||
		TARGETS = [('MY_TREE_MODEL_ROW', gtk.TARGET_SAME_APP | gtk.TARGET_SAME_WIDGET,
 | 
							TARGETS = [('MY_TREE_MODEL_ROW', gtk.TARGET_SAME_APP | gtk.TARGET_SAME_WIDGET,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue