Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

datamine: support searches of grep and annotate treeviews

give focus to the appropriate treeview, then start typing. It does
incremental searching of the word you type.

Changeset a3febfef1872

Parent 0eaeb3de76de

by Steve Borho

Changes to one file · Browse files at a3febfef1872 Showing diff from parent 0eaeb3de76de Diff from another changeset...

Change 1 of 4 Show Entire File hggtk/​datamine.py Stacked
 
222
223
224
 
225
226
227
 
273
274
275
 
 
 
 
 
 
 
 
 
 
 
276
277
278
 
454
455
456
 
457
458
459
 
516
517
518
 
 
 
 
 
 
 
 
 
 
 
519
520
521
 
222
223
224
225
226
227
228
 
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
 
466
467
468
469
470
471
472
 
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
@@ -222,6 +222,7 @@
    results = gtk.ListStore(str, str, str, str)   treeview.set_model(results) + treeview.set_search_equal_func(self.search_in_grep)   for title, width, col, emode in (   (_('Rev'), 10, self.COL_REVID, pango.ELLIPSIZE_NONE),   (_('File'), 25, self.COL_PATH, pango.ELLIPSIZE_START), @@ -273,6 +274,17 @@
  self.notebook.set_current_page(num)   regexp.grab_focus()   + def search_in_grep(self, model, column, key, iter): + """Searches all fields shown in the tree when the user hits crtr+f, + not just the ones that are set via tree.set_search_column. + Case insensitive + """ + key = key.lower() + for col in (self.COL_PATH, self.COL_TEXT): + if key in model.get_value(iter, col).lower(): + return False + return True +   def trigger_search(self, button, objs):   (model, frame, regexp, follow, ignorecase,   excludes, includes, linenum, showall, search_hbox) = objs @@ -454,6 +466,7 @@
    results = gtk.ListStore(str, str, str, str, str, str, str)   treeview.set_model(results) + treeview.set_search_equal_func(self.search_in_file)     context_menu = self.ann_header_context_menu(treeview)   for title, width, col, emode, visible in ( @@ -516,6 +529,17 @@
  self._ann_button_release)   graphview.treeview.connect('popup-menu', self._ann_popup_menu)   + def search_in_file(self, model, column, key, iter): + """Searches all fields shown in the tree when the user hits crtr+f, + not just the ones that are set via tree.set_search_column. + Case insensitive + """ + key = key.lower() + for col in (self.COL_USER, self.COL_TEXT): + if key in model.get_value(iter, col).lower(): + return False + return True +   def toggle_annatate_columns(self, button, treeview, col):   b = button.get_active()   treeview.get_column(col).set_visible(b)