/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: Vincent Ladeuil
  • Date: 2009-05-06 11:51:38 UTC
  • mfrom: (628.1.2 gtk)
  • Revision ID: v.ladeuil+lp@free.fr-20090506115138-7abxvg2qz4gzraup
UpgradeĀ COMPATIBLE_BZR_VERSIONS

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 = ", ".join(revision.get_apparent_authors())
 
94
                    author = revision.get_apparent_author()
95
95
 
96
96
                if revision.revision_id not in self.revisions:
97
97
                    self.revisions[revision.revision_id] = 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)
219
215
        hbox.show()
220
216
        vbox.pack_start(hbox, expand=False, fill=True)
221
217
        
238
234
 
239
235
        self.add(vbox)
240
236
 
241
 
    def _search_by_text(self, *ignored): # (accel_group, window, key, modifiers):
 
237
    def _search_by_text(self, accel_group, window, key, modifiers):
242
238
        self._search.show_for('text')
243
239
        self._search.set_target(self.annoview, TEXT_LINE_COL)
244
240
 
245
 
    def _search_by_line(self, *ignored): # accel_group, window, key, modifiers):
 
241
    def _search_by_line(self, accel_group, window, key, modifiers):
246
242
        self._search.show_for('line')
247
243
        self._search.set_target(self.annoview, LINE_NUM_COL)
248
244
 
348
344
        button.set_sensitive(False)
349
345
        return button
350
346
 
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
 
 
372
347
    def go_back(self):
373
348
        last_tree = self.tree
374
349
        rev_id = self._selected_revision()
414
389
                return j - i
415
390
 
416
391
 
417
 
class FakeRevision(object):
 
392
class FakeRevision:
418
393
    """ A fake revision.
419
394
 
420
395
    For when a revision is referenced but not present.
429
404
        self.timezone = 0
430
405
        self.properties = {}
431
406
 
432
 
    def get_apparent_authors(self):
433
 
        return [self.committer]
 
407
    def get_apparent_author(self):
 
408
        return self.committer
434
409
 
435
410
 
436
411
class RevisionCache(object):
437
412
    """A caching revision source"""
438
 
 
439
413
    def __init__(self, real_source, seed_cache=None):
440
414
        self.__real_source = real_source
441
415
        if seed_cache is None: