/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: David Planella
  • Date: 2010-08-21 09:32:13 UTC
  • mto: This revision was merged to the branch mainline in revision 719.
  • Revision ID: david.planella@ubuntu.com-20100821093213-njpqd5sploa8n71m
Adapted desktop entries for translation

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)
 
217
        self.goto_button = self._create_goto_button()
 
218
        hbox.pack_start(self.goto_button, expand=False, fill=True)
215
219
        hbox.show()
216
220
        vbox.pack_start(hbox, expand=False, fill=True)
217
221
        
234
238
 
235
239
        self.add(vbox)
236
240
 
237
 
    def _search_by_text(self, accel_group, window, key, modifiers):
 
241
    def _search_by_text(self, *ignored): # (accel_group, window, key, modifiers):
238
242
        self._search.show_for('text')
239
243
        self._search.set_target(self.annoview, TEXT_LINE_COL)
240
244
 
241
 
    def _search_by_line(self, accel_group, window, key, modifiers):
 
245
    def _search_by_line(self, *ignored): # accel_group, window, key, modifiers):
242
246
        self._search.show_for('line')
243
247
        self._search.set_target(self.annoview, LINE_NUM_COL)
244
248
 
344
348
        button.set_sensitive(False)
345
349
        return button
346
350
 
 
351
    def _create_find_button(self):
 
352
        button = gtk.Button()
 
353
        button.set_use_stock(True)
 
354
        button.set_label("gtk-find")
 
355
        button.set_tooltip_text("Search for text (Ctrl+F)")
 
356
        button.connect("clicked", self._search_by_text)
 
357
        button.set_relief(gtk.RELIEF_NONE)
 
358
        button.show()
 
359
        button.set_sensitive(True)
 
360
        return button
 
361
 
 
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
 
347
372
    def go_back(self):
348
373
        last_tree = self.tree
349
374
        rev_id = self._selected_revision()
389
414
                return j - i
390
415
 
391
416
 
392
 
class FakeRevision:
 
417
class FakeRevision(object):
393
418
    """ A fake revision.
394
419
 
395
420
    For when a revision is referenced but not present.
404
429
        self.timezone = 0
405
430
        self.properties = {}
406
431
 
407
 
    def get_apparent_author(self):
408
 
        return self.committer
 
432
    def get_apparent_authors(self):
 
433
        return [self.committer]
409
434
 
410
435
 
411
436
class RevisionCache(object):
412
437
    """A caching revision source"""
 
438
 
413
439
    def __init__(self, real_source, seed_cache=None):
414
440
        self.__real_source = real_source
415
441
        if seed_cache is None: