/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:
212
212
        hbox.pack_start(self.back_button, expand=False, fill=True)
213
213
        self.forward_button = self._create_forward_button()
214
214
        hbox.pack_start(self.forward_button, expand=False, fill=True)
 
215
        self.find_button = self._create_find_button()
 
216
        hbox.pack_start(self.find_button, expand=False, fill=True)
215
217
        hbox.show()
216
218
        vbox.pack_start(hbox, expand=False, fill=True)
217
219
        
234
236
 
235
237
        self.add(vbox)
236
238
 
237
 
    def _search_by_text(self, accel_group, window, key, modifiers):
 
239
    def _search_by_text(self, *ignored): # (accel_group, window, key, modifiers):
238
240
        self._search.show_for('text')
239
241
        self._search.set_target(self.annoview, TEXT_LINE_COL)
240
242
 
344
346
        button.set_sensitive(False)
345
347
        return button
346
348
 
 
349
    def _create_find_button(self):
 
350
        button = gtk.Button()
 
351
        button.set_use_stock(True)
 
352
        button.set_label("gtk-find")
 
353
        button.connect("clicked", self._search_by_text)
 
354
        button.set_relief(gtk.RELIEF_NONE)
 
355
        button.show()
 
356
        button.set_sensitive(True)
 
357
        return button
 
358
 
347
359
    def go_back(self):
348
360
        last_tree = self.tree
349
361
        rev_id = self._selected_revision()