/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:
91
91
                    revno = author = ""
92
92
                else:
93
93
                    last_seen = revision.revision_id
94
 
                    author = revision.get_apparent_author()
 
94
                    author = ", ".join(revision.get_apparent_authors())
95
95
 
96
96
                if revision.revision_id not in self.revisions:
97
97
                    self.revisions[revision.revision_id] = revision
139
139
        current_revision.timestamp = time.time()
140
140
        current_revision.message = '[Not yet committed]'
141
141
        current_revision.parent_ids = tree.get_parent_ids()
142
 
        current_revision.properties['branch-nick'] = self.branch.nick
 
142
        current_revision.properties['branch-nick'] = self.branch._get_nick(local=True)
143
143
        current_revno = '%d?' % (self.branch.revno() + 1)
144
144
        repository = self.branch.repository
145
145
        if self.revision_id == CURRENT_REVISION:
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()
389
401
                return j - i
390
402
 
391
403
 
392
 
class FakeRevision:
 
404
class FakeRevision(object):
393
405
    """ A fake revision.
394
406
 
395
407
    For when a revision is referenced but not present.
404
416
        self.timezone = 0
405
417
        self.properties = {}
406
418
 
407
 
    def get_apparent_author(self):
408
 
        return self.committer
 
419
    def get_apparent_authors(self):
 
420
        return [self.committer]
409
421
 
410
422
 
411
423
class RevisionCache(object):
412
424
    """A caching revision source"""
 
425
 
413
426
    def __init__(self, real_source, seed_cache=None):
414
427
        self.__real_source = real_source
415
428
        if seed_cache is None: