/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to annotate/gannotate.py

  • Committer: Martin Pool
  • Date: 2010-05-27 02:02:26 UTC
  • mto: This revision was merged to the branch mainline in revision 689.
  • Revision ID: mbp@canonical.com-20100527020226-mel0eyh5ps2lstwn
Add 'Find' button to start text search

Show diffs side-by-side

added added

removed removed

Lines of Context:
214
214
        hbox.pack_start(self.forward_button, expand=False, fill=True)
215
215
        self.find_button = self._create_find_button()
216
216
        hbox.pack_start(self.find_button, expand=False, fill=True)
217
 
        self.goto_button = self._create_goto_button()
218
 
        hbox.pack_start(self.goto_button, expand=False, fill=True)
219
217
        hbox.show()
220
218
        vbox.pack_start(hbox, expand=False, fill=True)
221
219
        
242
240
        self._search.show_for('text')
243
241
        self._search.set_target(self.annoview, TEXT_LINE_COL)
244
242
 
245
 
    def _search_by_line(self, *ignored): # accel_group, window, key, modifiers):
 
243
    def _search_by_line(self, accel_group, window, key, modifiers):
246
244
        self._search.show_for('line')
247
245
        self._search.set_target(self.annoview, LINE_NUM_COL)
248
246
 
352
350
        button = gtk.Button()
353
351
        button.set_use_stock(True)
354
352
        button.set_label("gtk-find")
355
 
        button.set_tooltip_text("Search for text (Ctrl+F)")
356
353
        button.connect("clicked", self._search_by_text)
357
354
        button.set_relief(gtk.RELIEF_NONE)
358
355
        button.show()
359
356
        button.set_sensitive(True)
360
357
        return button
361
358
 
362
 
    def _create_goto_button(self):
363
 
        button = gtk.Button()
364
 
        button.set_label("Goto Line")
365
 
        button.set_tooltip_text("Scroll to a line by entering its number (Ctrl+G)")
366
 
        button.connect("clicked", self._search_by_line)
367
 
        button.set_relief(gtk.RELIEF_NONE)
368
 
        button.show()
369
 
        button.set_sensitive(True)
370
 
        return button
371
 
 
372
359
    def go_back(self):
373
360
        last_tree = self.tree
374
361
        rev_id = self._selected_revision()