/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 revisionview.py

  • Committer: Jelmer Vernooij
  • Date: 2011-08-23 23:53:59 UTC
  • Revision ID: jelmer@samba.org-20110823235359-0k7mlydx8txgvw9x
Mark as supporting bzr 2.5.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
17
 
18
 
from gi.repository import Gtk
19
 
from gi.repository import Pango
20
 
from gi.repository import GObject
 
18
import pygtk
 
19
pygtk.require("2.0")
 
20
import gtk
 
21
import pango
 
22
import gobject
21
23
import webbrowser
22
24
 
23
25
from bzrlib import trace
51
53
            webbrowser._tryorder.insert(0, '%s "%%s"' % cmd)
52
54
    webbrowser.open(uri)
53
55
 
 
56
if getattr(gtk, 'link_button_set_uri_hook', None) is not None:
 
57
    # Not available before PyGtk-2.10
 
58
    gtk.link_button_set_uri_hook(_open_link)
54
59
 
55
 
class BugsTab(Gtk.VBox):
 
60
class BugsTab(gtk.VBox):
56
61
 
57
62
    def __init__(self):
58
 
        super(BugsTab, self).__init__(homogeneous=False, spacing=6)
 
63
        super(BugsTab, self).__init__(False, 6)
59
64
 
60
 
        table = Gtk.Table(rows=2, columns=2)
 
65
        table = gtk.Table(rows=2, columns=2)
61
66
 
62
67
        table.set_row_spacings(6)
63
68
        table.set_col_spacing(0, 16)
64
69
 
65
 
        image = Gtk.Image()
 
70
        image = gtk.Image()
66
71
        image.set_from_file(icon_path("bug.png"))
67
 
        table.attach(image, 0, 1, 0, 1, Gtk.AttachOptions.FILL)
 
72
        table.attach(image, 0, 1, 0, 1, gtk.FILL)
68
73
 
69
 
        align = Gtk.Alignment.new(0.0, 0.1, 0, 0)
70
 
        self.label = Gtk.Label()
 
74
        align = gtk.Alignment(0.0, 0.1)
 
75
        self.label = gtk.Label()
71
76
        align.add(self.label)
72
 
        table.attach(align, 1, 2, 0, 1, Gtk.AttachOptions.FILL)
 
77
        table.attach(align, 1, 2, 0, 1, gtk.FILL)
73
78
 
74
79
        treeview = self.construct_treeview()
75
 
        table.attach(treeview, 1, 2, 1, 2, Gtk.AttachOptions.FILL | Gtk.AttachOptions.EXPAND)
 
80
        table.attach(treeview, 1, 2, 1, 2, gtk.FILL | gtk.EXPAND)
76
81
 
77
82
        self.set_border_width(6)
78
 
        self.pack_start(table, False, True, 0)
 
83
        self.pack_start(table, expand=False)
79
84
 
80
85
        self.clear()
81
86
        self.show_all()
103
108
                              "%d %s." % (self.num_bugs, label))
104
109
 
105
110
    def construct_treeview(self):
106
 
        self.bugs = Gtk.ListStore(GObject.TYPE_STRING, GObject.TYPE_STRING)
107
 
        self.treeview = Gtk.TreeView(model=self.bugs)
 
111
        self.bugs = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING)
 
112
        self.treeview = gtk.TreeView(self.bugs)
108
113
        self.treeview.set_headers_visible(False)
109
114
 
110
 
        uri_column = Gtk.TreeViewColumn('Bug URI', Gtk.CellRendererText(), text=0)
 
115
        uri_column = gtk.TreeViewColumn('Bug URI', gtk.CellRendererText(), text=0)
111
116
        self.treeview.append_column(uri_column)
112
117
 
113
118
        self.treeview.connect('row-activated', self.on_row_activated)
114
119
 
115
 
        win = Gtk.ScrolledWindow()
116
 
        win.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
117
 
        win.set_shadow_type(Gtk.ShadowType.IN)
 
120
        win = gtk.ScrolledWindow()
 
121
        win.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
 
122
        win.set_shadow_type(gtk.SHADOW_IN)
118
123
        win.add(self.treeview)
119
124
 
120
125
        return win
139
144
        _open_link(self, uri)
140
145
 
141
146
 
142
 
class SignatureTab(Gtk.VBox):
 
147
class SignatureTab(gtk.VBox):
143
148
 
144
149
    def __init__(self, repository):
145
150
        self.key = None
146
151
        self.revision = None
147
152
        self.repository = repository
148
153
 
149
 
        super(SignatureTab, self).__init__(homogeneous=False, spacing=6)
150
 
        signature_box = Gtk.Table(rows=3, columns=3)
 
154
        super(SignatureTab, self).__init__(False, 6)
 
155
        signature_box = gtk.Table(rows=3, columns=3)
151
156
        signature_box.set_col_spacing(0, 16)
152
157
        signature_box.set_col_spacing(1, 12)
153
158
        signature_box.set_row_spacings(6)
154
159
 
155
 
        self.signature_image = Gtk.Image()
156
 
        signature_box.attach(self.signature_image, 0, 1, 0, 1, Gtk.AttachOptions.FILL)
 
160
        self.signature_image = gtk.Image()
 
161
        signature_box.attach(self.signature_image, 0, 1, 0, 1, gtk.FILL)
157
162
 
158
 
        align = Gtk.Alignment.new(0.0, 0.1, 0.0, 0.0)
159
 
        self.signature_label = Gtk.Label()
 
163
        align = gtk.Alignment(0.0, 0.1)
 
164
        self.signature_label = gtk.Label()
160
165
        align.add(self.signature_label)
161
 
        signature_box.attach(align, 1, 3, 0, 1, Gtk.AttachOptions.FILL)
 
166
        signature_box.attach(align, 1, 3, 0, 1, gtk.FILL)
162
167
 
163
 
        align = Gtk.Alignment.new(0.0, 0.5, 0.0, 0.0)
164
 
        self.signature_key_id_label = Gtk.Label()
 
168
        align = gtk.Alignment(0.0, 0.5)
 
169
        self.signature_key_id_label = gtk.Label()
165
170
        self.signature_key_id_label.set_markup("<b>Key Id:</b>")
166
171
        align.add(self.signature_key_id_label)
167
 
        signature_box.attach(align, 1, 2, 1, 2, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
172
        signature_box.attach(align, 1, 2, 1, 2, gtk.FILL, gtk.FILL)
168
173
 
169
 
        align = Gtk.Alignment.new(0.0, 0.5, 0.0, 0.0)
170
 
        self.signature_key_id = Gtk.Label()
 
174
        align = gtk.Alignment(0.0, 0.5)
 
175
        self.signature_key_id = gtk.Label()
171
176
        self.signature_key_id.set_selectable(True)
172
177
        align.add(self.signature_key_id)
173
 
        signature_box.attach(align, 2, 3, 1, 2, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
178
        signature_box.attach(align, 2, 3, 1, 2, gtk.EXPAND | gtk.FILL, gtk.FILL)
174
179
 
175
 
        align = Gtk.Alignment.new(0.0, 0.5, 0.0, 0.0)
176
 
        self.signature_fingerprint_label = Gtk.Label()
 
180
        align = gtk.Alignment(0.0, 0.5)
 
181
        self.signature_fingerprint_label = gtk.Label()
177
182
        self.signature_fingerprint_label.set_markup("<b>Fingerprint:</b>")
178
183
        align.add(self.signature_fingerprint_label)
179
 
        signature_box.attach(align, 1, 2, 2, 3, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
184
        signature_box.attach(align, 1, 2, 2, 3, gtk.FILL, gtk.FILL)
180
185
 
181
 
        align = Gtk.Alignment.new(0.0, 0.5, 0.0, 0.0)
182
 
        self.signature_fingerprint = Gtk.Label()
 
186
        align = gtk.Alignment(0.0, 0.5)
 
187
        self.signature_fingerprint = gtk.Label()
183
188
        self.signature_fingerprint.set_selectable(True)
184
189
        align.add(self.signature_fingerprint)
185
 
        signature_box.attach(align, 2, 3, 2, 3, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
190
        signature_box.attach(align, 2, 3, 2, 3, gtk.EXPAND | gtk.FILL, gtk.FILL)
186
191
 
187
 
        align = Gtk.Alignment.new(0.0, 0.5, 0.0, 0.0)
188
 
        self.signature_trust_label = Gtk.Label()
 
192
        align = gtk.Alignment(0.0, 0.5)
 
193
        self.signature_trust_label = gtk.Label()
189
194
        self.signature_trust_label.set_markup("<b>Trust:</b>")
190
195
        align.add(self.signature_trust_label)
191
 
        signature_box.attach(align, 1, 2, 3, 4, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
196
        signature_box.attach(align, 1, 2, 3, 4, gtk.FILL, gtk.FILL)
192
197
 
193
 
        align = Gtk.Alignment.new(0.0, 0.5, 0.0, 0.0)
194
 
        self.signature_trust = Gtk.Label()
 
198
        align = gtk.Alignment(0.0, 0.5)
 
199
        self.signature_trust = gtk.Label()
195
200
        self.signature_trust.set_selectable(True)
196
201
        align.add(self.signature_trust)
197
 
        signature_box.attach(align, 2, 3, 3, 4, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
202
        signature_box.attach(align, 2, 3, 3, 4, gtk.EXPAND | gtk.FILL, gtk.FILL)
198
203
 
199
204
        self.set_border_width(6)
200
 
        self.pack_start(signature_box, False, True, 0)
 
205
        self.pack_start(signature_box, expand=False)
201
206
        self.show_all()
202
207
 
203
208
    def set_revision(self, revision):
287
292
        self.signature_trust.set_text('This key is ' + trust_text)
288
293
 
289
294
 
290
 
class RevisionView(Gtk.Notebook):
 
295
class RevisionView(gtk.Notebook):
291
296
    """ Custom widget for commit log details.
292
297
 
293
298
    A variety of bzr tools may need to implement such a thing. This is a
296
301
 
297
302
    __gproperties__ = {
298
303
        'branch': (
299
 
            GObject.TYPE_PYOBJECT,
 
304
            gobject.TYPE_PYOBJECT,
300
305
            'Branch',
301
306
            'The branch holding the revision being displayed',
302
 
            GObject.PARAM_CONSTRUCT_ONLY | GObject.PARAM_WRITABLE
 
307
            gobject.PARAM_CONSTRUCT_ONLY | gobject.PARAM_WRITABLE
303
308
        ),
304
309
 
305
310
        'revision': (
306
 
            GObject.TYPE_PYOBJECT,
 
311
            gobject.TYPE_PYOBJECT,
307
312
            'Revision',
308
313
            'The revision being displayed',
309
 
            GObject.PARAM_READWRITE
 
314
            gobject.PARAM_READWRITE
310
315
        ),
311
316
 
312
317
        'children': (
313
 
            GObject.TYPE_PYOBJECT,
 
318
            gobject.TYPE_PYOBJECT,
314
319
            'Children',
315
320
            'Child revisions',
316
 
            GObject.PARAM_READWRITE
 
321
            gobject.PARAM_READWRITE
317
322
        ),
318
323
 
319
324
        'file-id': (
320
 
            GObject.TYPE_PYOBJECT,
 
325
            gobject.TYPE_PYOBJECT,
321
326
            'File Id',
322
327
            'The file id',
323
 
            GObject.PARAM_READWRITE
 
328
            gobject.PARAM_READWRITE
324
329
        )
325
330
    }
326
331
 
327
332
    def __init__(self, branch=None, repository=None):
328
 
        super(RevisionView, self).__init__()
 
333
        gtk.Notebook.__init__(self)
329
334
 
330
335
        self._revision = None
331
336
        self._branch = branch
333
338
            self._repository = branch.repository
334
339
        else:
335
340
            self._repository = repository
336
 
        self.signature_table = None
337
341
 
338
342
        self._create_general()
339
343
        self._create_relations()
473
477
        self._add_tags()
474
478
 
475
479
    def _update_signature(self, widget, param):
476
 
        if not has_seahorse:
477
 
            return
478
480
        if self.get_current_page() == PAGE_SIGNATURE:
479
481
            self.signature_table.set_revision(self._revision)
480
482
 
489
491
                                      self.children_table)
490
492
 
491
493
    def _switch_page_cb(self, notebook, page, page_num):
492
 
        if not has_seahorse:
493
 
            return
494
494
        if page_num == PAGE_SIGNATURE:
495
495
            self.signature_table.set_revision(self._revision)
496
496
 
530
530
        table.resize(max(len(revids), 1), 2)
531
531
 
532
532
        for idx, revid in enumerate(revids):
533
 
            align = Gtk.Alignment.new(0.0, 0.0, 1, 1)
 
533
            align = gtk.Alignment(0.0, 0.0, 1, 1)
534
534
            widgets.append(align)
535
535
            table.attach(align, 1, 2, idx, idx + 1,
536
 
                                      Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
536
                                      gtk.EXPAND | gtk.FILL, gtk.FILL)
537
537
            align.show()
538
538
 
539
 
            hbox = Gtk.HBox(homogeneous=False, spacing=6)
 
539
            hbox = gtk.HBox(False, spacing=6)
540
540
            align.add(hbox)
541
541
            hbox.show()
542
542
 
543
 
            image = Gtk.Image()
 
543
            image = gtk.Image()
544
544
            image.set_from_stock(
545
 
                Gtk.STOCK_FIND, Gtk.IconSize.SMALL_TOOLBAR)
 
545
                gtk.STOCK_FIND, gtk.ICON_SIZE_SMALL_TOOLBAR)
546
546
            image.show()
547
547
 
548
548
            if self._show_callback is not None:
549
 
                button = Gtk.Button()
 
549
                button = gtk.Button()
550
550
                button.add(image)
551
551
                button.connect("clicked", self._show_clicked_cb,
552
552
                               self._revision.revision_id, revid)
553
 
                hbox.pack_start(button, False, True, 0)
 
553
                hbox.pack_start(button, expand=False, fill=True)
554
554
                button.show()
555
555
 
556
 
            button = Gtk.Button()
557
 
            revid_label = Gtk.Label(label=str(revid))
558
 
            revid_label.set_ellipsize(Pango.EllipsizeMode.MIDDLE)
 
556
            button = gtk.Button()
 
557
            revid_label = gtk.Label(str(revid))
 
558
            revid_label.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
559
559
            revid_label.set_alignment(0.0, 0.5)
560
560
            button.add(revid_label)
561
561
            button.connect("clicked",
562
 
                    lambda w, r: self.set_revision(
563
 
                        self._repository.get_revision(r)), revid)
 
562
                    lambda w, r: self.set_revision(self._repository.get_revision(r)), revid)
564
563
            button.set_use_underline(False)
565
 
            hbox.pack_start(button, True, True, 0)
 
564
            hbox.pack_start(button, expand=True, fill=True)
566
565
            button.show_all()
567
566
 
568
567
    def _create_general(self):
569
 
        vbox = Gtk.VBox(homogeneous=False, spacing=6)
 
568
        vbox = gtk.VBox(False, 6)
570
569
        vbox.set_border_width(6)
571
 
        vbox.pack_start(self._create_headers(), False, True, 0)
572
 
        vbox.pack_start(self._create_message_view(), True, True, 0)
573
 
        self.append_page(vbox, Gtk.Label(label="General"))
 
570
        vbox.pack_start(self._create_headers(), expand=False, fill=True)
 
571
        vbox.pack_start(self._create_message_view())
 
572
        self.append_page(vbox, tab_label=gtk.Label("General"))
574
573
        vbox.show()
575
574
 
576
575
    def _create_relations(self):
577
 
        vbox = Gtk.VBox(homogeneous=False, spacing=6)
 
576
        vbox = gtk.VBox(False, 6)
578
577
        vbox.set_border_width(6)
579
 
        vbox.pack_start(self._create_parents(), False, True, 0)
580
 
        vbox.pack_start(self._create_children(), False, True, 0)
581
 
        self.append_page(vbox, Gtk.Label(label="Relations"))
 
578
        vbox.pack_start(self._create_parents(), expand=False, fill=True)
 
579
        vbox.pack_start(self._create_children(), expand=False, fill=True)
 
580
        self.append_page(vbox, tab_label=gtk.Label("Relations"))
582
581
        vbox.show()
583
582
 
584
583
    def _create_signature(self):
585
584
        self.signature_table = SignatureTab(self._repository)
586
 
        self.append_page(
587
 
            self.signature_table, Gtk.Label(label='Signature'))
 
585
        self.append_page(self.signature_table, tab_label=gtk.Label('Signature'))
588
586
        self.connect_after('notify::revision', self._update_signature)
589
587
 
590
588
    def _create_headers(self):
591
589
        self.avatarsbox = AvatarsBox()
592
590
        
593
 
        self.table = Gtk.Table(rows=5, columns=2)
 
591
        self.table = gtk.Table(rows=5, columns=2)
594
592
        self.table.set_row_spacings(6)
595
593
        self.table.set_col_spacings(6)
596
594
        self.table.show()
597
595
        
598
 
        self.avatarsbox.pack_start(self.table, True, True, 0)
 
596
        self.avatarsbox.pack_start(self.table)
599
597
        self.avatarsbox.show()
600
598
 
601
599
        row = 0
602
600
 
603
 
        label = Gtk.Label()
 
601
        label = gtk.Label()
604
602
        label.set_alignment(1.0, 0.5)
605
603
        label.set_markup("<b>Revision Id:</b>")
606
 
        self.table.attach(label, 0, 1, row, row+1, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
604
        self.table.attach(label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
607
605
        label.show()
608
606
 
609
 
        revision_id = Gtk.Label()
610
 
        revision_id.set_ellipsize(Pango.EllipsizeMode.MIDDLE)
 
607
        revision_id = gtk.Label()
 
608
        revision_id.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
611
609
        revision_id.set_alignment(0.0, 0.5)
612
610
        revision_id.set_selectable(True)
613
611
        self.connect('notify::revision', 
614
612
                lambda w, p: revision_id.set_text(self._revision.revision_id))
615
 
        self.table.attach(revision_id, 1, 2, row, row+1, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
613
        self.table.attach(revision_id, 1, 2, row, row+1, gtk.EXPAND | gtk.FILL, gtk.FILL)
616
614
        revision_id.show()
617
615
 
618
616
        row += 1
619
 
        self.author_label = Gtk.Label()
 
617
        self.author_label = gtk.Label()
620
618
        self.author_label.set_alignment(1.0, 0.5)
621
619
        self.author_label.set_markup("<b>Author:</b>")
622
 
        self.table.attach(self.author_label, 0, 1, row, row+1, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
620
        self.table.attach(self.author_label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
623
621
        self.author_label.show()
624
622
 
625
 
        self.author = Gtk.Label()
626
 
        self.author.set_ellipsize(Pango.EllipsizeMode.END)
 
623
        self.author = gtk.Label()
 
624
        self.author.set_ellipsize(pango.ELLIPSIZE_END)
627
625
        self.author.set_alignment(0.0, 0.5)
628
626
        self.author.set_selectable(True)
629
 
        self.table.attach(self.author, 1, 2, row, row+1, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
627
        self.table.attach(self.author, 1, 2, row, row+1, gtk.EXPAND | gtk.FILL, gtk.FILL)
630
628
        self.author.show()
631
629
        self.author.hide()
632
630
 
633
631
        row += 1
634
 
        label = Gtk.Label()
 
632
        label = gtk.Label()
635
633
        label.set_alignment(1.0, 0.5)
636
634
        label.set_markup("<b>Committer:</b>")
637
 
        self.table.attach(label, 0, 1, row, row+1, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
635
        self.table.attach(label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
638
636
        label.show()
639
637
 
640
 
        self.committer = Gtk.Label()
641
 
        self.committer.set_ellipsize(Pango.EllipsizeMode.END)
 
638
        self.committer = gtk.Label()
 
639
        self.committer.set_ellipsize(pango.ELLIPSIZE_END)
642
640
        self.committer.set_alignment(0.0, 0.5)
643
641
        self.committer.set_selectable(True)
644
 
        self.table.attach(self.committer, 1, 2, row, row+1, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
642
        self.table.attach(self.committer, 1, 2, row, row+1, gtk.EXPAND | gtk.FILL, gtk.FILL)
645
643
        self.committer.show()
646
644
 
647
645
        row += 1
648
 
        self.branchnick_label = Gtk.Label()
 
646
        self.branchnick_label = gtk.Label()
649
647
        self.branchnick_label.set_alignment(1.0, 0.5)
650
648
        self.branchnick_label.set_markup("<b>Branch nick:</b>")
651
 
        self.table.attach(self.branchnick_label, 0, 1, row, row+1, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
649
        self.table.attach(self.branchnick_label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
652
650
        self.branchnick_label.show()
653
651
 
654
 
        self.branchnick = Gtk.Label()
655
 
        self.branchnick.set_ellipsize(Pango.EllipsizeMode.MIDDLE)
 
652
        self.branchnick = gtk.Label()
 
653
        self.branchnick.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
656
654
        self.branchnick.set_alignment(0.0, 0.5)
657
655
        self.branchnick.set_selectable(True)
658
 
        self.table.attach(self.branchnick, 1, 2, row, row+1, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
656
        self.table.attach(self.branchnick, 1, 2, row, row+1, gtk.EXPAND | gtk.FILL, gtk.FILL)
659
657
        self.branchnick.show()
660
658
 
661
659
        row += 1
662
 
        label = Gtk.Label()
 
660
        label = gtk.Label()
663
661
        label.set_alignment(1.0, 0.5)
664
662
        label.set_markup("<b>Timestamp:</b>")
665
 
        self.table.attach(label, 0, 1, row, row+1, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
663
        self.table.attach(label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
666
664
        label.show()
667
665
 
668
 
        self.timestamp = Gtk.Label()
669
 
        self.timestamp.set_ellipsize(Pango.EllipsizeMode.END)
 
666
        self.timestamp = gtk.Label()
 
667
        self.timestamp.set_ellipsize(pango.ELLIPSIZE_END)
670
668
        self.timestamp.set_alignment(0.0, 0.5)
671
669
        self.timestamp.set_selectable(True)
672
 
        self.table.attach(self.timestamp, 1, 2, row, row+1, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
670
        self.table.attach(self.timestamp, 1, 2, row, row+1, gtk.EXPAND | gtk.FILL, gtk.FILL)
673
671
        self.timestamp.show()
674
672
 
675
673
        row += 1
676
 
        self.tags_label = Gtk.Label()
 
674
        self.tags_label = gtk.Label()
677
675
        self.tags_label.set_alignment(1.0, 0.5)
678
676
        self.tags_label.set_markup("<b>Tags:</b>")
679
 
        self.table.attach(self.tags_label, 0, 1, row, row+1, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
677
        self.table.attach(self.tags_label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
680
678
        self.tags_label.show()
681
679
 
682
 
        self.tags_list = Gtk.Label()
683
 
        self.tags_list.set_ellipsize(Pango.EllipsizeMode.MIDDLE)
 
680
        self.tags_list = gtk.Label()
 
681
        self.tags_list.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
684
682
        self.tags_list.set_alignment(0.0, 0.5)
685
 
        self.table.attach(self.tags_list, 1, 2, row, row+1, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
683
        self.table.attach(self.tags_list, 1, 2, row, row+1, gtk.EXPAND | gtk.FILL, gtk.FILL)
686
684
        self.tags_list.show()
687
685
 
688
686
        self.connect('notify::revision', self._add_tags)
689
687
 
 
688
        self.avatarsbox.show()
690
689
        return self.avatarsbox
691
690
    
692
691
    def _create_parents(self):
693
 
        hbox = Gtk.HBox(homogeneous=True, spacing=3)
 
692
        hbox = gtk.HBox(True, 3)
694
693
        
695
694
        self.parents_table = self._create_parents_or_children_table(
696
695
            "<b>Parents:</b>")
697
696
        self.parents_widgets = []
698
 
        hbox.pack_start(self.parents_table, True, True, 0)
 
697
        hbox.pack_start(self.parents_table)
699
698
 
700
699
        hbox.show()
701
700
        return hbox
702
701
 
703
702
    def _create_children(self):
704
 
        hbox = Gtk.HBox(homogeneous=True, spacing=3)
 
703
        hbox = gtk.HBox(True, 3)
705
704
        self.children_table = self._create_parents_or_children_table(
706
705
            "<b>Children:</b>")
707
706
        self.children_widgets = []
708
 
        hbox.pack_start(self.children_table, True, True, 0)
 
707
        hbox.pack_start(self.children_table)
709
708
        hbox.show()
710
709
        return hbox
711
710
        
712
711
    def _create_parents_or_children_table(self, text):
713
 
        table = Gtk.Table(rows=1, columns=2)
 
712
        table = gtk.Table(rows=1, columns=2)
714
713
        table.set_row_spacings(3)
715
714
        table.set_col_spacings(6)
716
715
        table.show()
717
716
 
718
 
        label = Gtk.Label()
 
717
        label = gtk.Label()
719
718
        label.set_markup(text)
720
 
        align = Gtk.Alignment.new(0.0, 0.5, 0, 0)
 
719
        align = gtk.Alignment(0.0, 0.5)
721
720
        align.add(label)
722
 
        table.attach(align, 0, 1, 0, 1, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
721
        table.attach(align, 0, 1, 0, 1, gtk.FILL, gtk.FILL)
723
722
        label.show()
724
723
        align.show()
725
724
 
726
725
        return table
727
726
 
728
727
    def _create_message_view(self):
729
 
        msg_buffer = Gtk.TextBuffer()
 
728
        msg_buffer = gtk.TextBuffer()
730
729
        self.connect('notify::revision',
731
730
                lambda w, p: msg_buffer.set_text(self._revision.message))
732
 
        window = Gtk.ScrolledWindow()
733
 
        window.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
734
 
        window.set_shadow_type(Gtk.ShadowType.IN)
735
 
        tv = Gtk.TextView(buffer=msg_buffer)
 
731
        window = gtk.ScrolledWindow()
 
732
        window.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
 
733
        window.set_shadow_type(gtk.SHADOW_IN)
 
734
        tv = gtk.TextView(msg_buffer)
736
735
        tv.set_editable(False)
737
 
        tv.set_wrap_mode(Gtk.WrapMode.WORD)
 
736
        tv.set_wrap_mode(gtk.WRAP_WORD)
738
737
 
739
 
        tv.modify_font(Pango.FontDescription("Monospace"))
 
738
        tv.modify_font(pango.FontDescription("Monospace"))
740
739
        tv.show()
741
740
        window.add(tv)
742
741
        window.show()
745
744
    def _create_bugs(self):
746
745
        self.bugs_page = BugsTab()
747
746
        self.connect_after('notify::revision', self._update_bugs) 
748
 
        self.append_page(self.bugs_page, Gtk.Label(label='Bugs'))
 
747
        self.append_page(self.bugs_page, tab_label=gtk.Label('Bugs'))
749
748
 
750
749
    def _create_file_info_view(self):
751
 
        self.file_info_box = Gtk.VBox(homogeneous=False, spacing=6)
 
750
        self.file_info_box = gtk.VBox(False, 6)
752
751
        self.file_info_box.set_border_width(6)
753
 
        self.file_info_buffer = Gtk.TextBuffer()
754
 
        window = Gtk.ScrolledWindow()
755
 
        window.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
756
 
        window.set_shadow_type(Gtk.ShadowType.IN)
757
 
        tv = Gtk.TextView(buffer=self.file_info_buffer)
 
752
        self.file_info_buffer = gtk.TextBuffer()
 
753
        window = gtk.ScrolledWindow()
 
754
        window.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
 
755
        window.set_shadow_type(gtk.SHADOW_IN)
 
756
        tv = gtk.TextView(self.file_info_buffer)
758
757
        tv.set_editable(False)
759
 
        tv.set_wrap_mode(Gtk.WrapMode.WORD)
760
 
        tv.modify_font(Pango.FontDescription("Monospace"))
 
758
        tv.set_wrap_mode(gtk.WRAP_WORD)
 
759
        tv.modify_font(pango.FontDescription("Monospace"))
761
760
        tv.show()
762
761
        window.add(tv)
763
762
        window.show()
764
 
        self.file_info_box.pack_start(window, True, True, 0)
 
763
        self.file_info_box.pack_start(window)
765
764
        self.file_info_box.hide() # Only shown when there are per-file messages
766
 
        self.append_page(self.file_info_box, Gtk.Label(label='Per-file'))
 
765
        self.append_page(self.file_info_box, tab_label=gtk.Label('Per-file'))
767
766