/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: Daniel Schierbeck
  • Date: 2008-04-01 22:27:50 UTC
  • mto: (461.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 462.
  • Revision ID: daniel.schierbeck@gmail.com-20080401222750-a9ta5rbydf7fy8ew
Made the bug icon be installed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import gtk
21
21
import pango
22
22
import gobject
23
 
import webbrowser
 
23
import subprocess
24
24
 
25
 
from bzrlib import trace
 
25
from bzrlib.plugins.gtk import icon_path
26
26
from bzrlib.osutils import format_date
27
 
try:
28
 
    from bzrlib.bencode import bdecode
29
 
except ImportError:
30
 
    from bzrlib.util.bencode import bdecode
31
 
from bzrlib.testament import Testament
32
 
 
33
 
from bzrlib.plugins.gtk import icon_path
34
 
 
35
 
try:
36
 
    from bzrlib.plugins.gtk import seahorse
37
 
except ImportError:
38
 
    has_seahorse = False
39
 
else:
40
 
    has_seahorse = True
41
 
 
42
 
PAGE_GENERAL = 0
43
 
PAGE_RELATIONS = 1
44
 
PAGE_SIGNATURE = 2
45
 
PAGE_BUGS = 3
46
 
 
 
27
from bzrlib.util.bencode import bdecode
47
28
 
48
29
def _open_link(widget, uri):
49
 
    for cmd in ['sensible-browser', 'xdg-open']:
50
 
        if webbrowser._iscommand(cmd):
51
 
            webbrowser._tryorder.insert(0, '%s "%%s"' % cmd)
52
 
    webbrowser.open(uri)
 
30
    subprocess.Popen(['sensible-browser', uri], close_fds=True)
53
31
 
54
32
gtk.link_button_set_uri_hook(_open_link)
55
33
 
56
34
class BugsTab(gtk.VBox):
57
 
 
58
35
    def __init__(self):
59
36
        super(BugsTab, self).__init__(False, 6)
60
 
    
 
37
 
61
38
        table = gtk.Table(rows=2, columns=2)
62
39
 
63
40
        table.set_row_spacings(6)
64
 
        table.set_col_spacing(0, 16)
 
41
        table.set_col_spacings(12)
65
42
 
66
43
        image = gtk.Image()
67
44
        image.set_from_file(icon_path("bug.png"))
68
45
        table.attach(image, 0, 1, 0, 1, gtk.FILL)
69
46
 
70
47
        align = gtk.Alignment(0.0, 0.1)
71
 
        self.label = gtk.Label()
72
 
        align.add(self.label)
 
48
        label = gtk.Label()
 
49
        label.set_markup("<b>Bugs</b>\nThis revision has one or more bug associations.")
 
50
        align.add(label)
73
51
        table.attach(align, 1, 2, 0, 1, gtk.FILL)
74
52
 
75
53
        treeview = self.construct_treeview()
78
56
        self.set_border_width(6)
79
57
        self.pack_start(table, expand=False)
80
58
 
81
 
        self.clear()
82
 
        self.show_all()
83
 
 
84
 
    def set_revision(self, revision):
85
 
        if revision is None:
86
 
            return
87
 
 
88
 
        self.clear()
89
 
        bugs_text = revision.properties.get('bugs', '')
90
 
        for bugline in bugs_text.splitlines():
91
 
                (url, status) = bugline.split(" ")
92
 
                if status == "fixed":
93
 
                    self.add_bug(url, status)
94
 
        
95
 
        if self.num_bugs == 0:
96
 
            return
97
 
        elif self.num_bugs == 1:
98
 
            label = "bug"
99
 
        else:
100
 
            label = "bugs"
101
 
 
102
 
        self.label.set_markup("<b>Bugs fixed</b>\n" +
103
 
                              "This revision claims to fix " +
104
 
                              "%d %s." % (self.num_bugs, label))
 
59
        self.hide_all()
105
60
 
106
61
    def construct_treeview(self):
107
62
        self.bugs = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING)
108
63
        self.treeview = gtk.TreeView(self.bugs)
109
 
        self.treeview.set_headers_visible(False)
110
64
 
111
65
        uri_column = gtk.TreeViewColumn('Bug URI', gtk.CellRendererText(), text=0)
 
66
        status_column = gtk.TreeViewColumn('Status', gtk.CellRendererText(), text=1)
 
67
 
112
68
        self.treeview.append_column(uri_column)
113
 
 
114
 
        self.treeview.connect('row-activated', self.on_row_activated)
 
69
        self.treeview.append_column(status_column)
115
70
 
116
71
        win = gtk.ScrolledWindow()
117
72
        win.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
121
76
        return win
122
77
 
123
78
    def clear(self):
124
 
        self.num_bugs = 0
125
79
        self.bugs.clear()
126
 
        self.set_sensitive(False)
127
 
        self.label.set_markup("<b>No bugs fixed</b>\n" +
128
 
                              "This revision does not claim to fix any bugs.")
 
80
        self.hide_all() # Only shown when there are bugs
129
81
 
130
82
    def add_bug(self, url, status):
131
 
        self.num_bugs += 1
132
83
        self.bugs.append([url, status])
133
 
        self.set_sensitive(True)
134
 
 
135
 
    def get_num_bugs(self):
136
 
        return self.num_bugs
137
 
 
138
 
    def on_row_activated(self, treeview, path, column):
139
 
        uri = self.bugs.get_value(self.bugs.get_iter(path), 0)
140
 
        _open_link(self, uri)
 
84
        self.show_all()
141
85
 
142
86
 
143
87
class SignatureTab(gtk.VBox):
144
 
 
145
 
    def __init__(self, repository):
146
 
        self.key = None
147
 
        self.revision = None
148
 
        self.repository = repository
149
 
 
 
88
    def __init__(self):
 
89
        from gpg import GPGSubprocess
 
90
        self.gpg = GPGSubprocess()
150
91
        super(SignatureTab, self).__init__(False, 6)
151
 
        signature_box = gtk.Table(rows=3, columns=3)
152
 
        signature_box.set_col_spacing(0, 16)
153
 
        signature_box.set_col_spacing(1, 12)
154
 
        signature_box.set_row_spacings(6)
 
92
        signature_box = gtk.Table(rows=1, columns=2)
 
93
        signature_box.set_col_spacing(0, 12)
155
94
 
156
95
        self.signature_image = gtk.Image()
157
96
        signature_box.attach(self.signature_image, 0, 1, 0, 1, gtk.FILL)
158
97
 
159
 
        align = gtk.Alignment(0.0, 0.1)
160
98
        self.signature_label = gtk.Label()
161
 
        align.add(self.signature_label)
162
 
        signature_box.attach(align, 1, 3, 0, 1, gtk.FILL)
163
 
 
164
 
        align = gtk.Alignment(0.0, 0.5)
165
 
        self.signature_key_id_label = gtk.Label()
166
 
        self.signature_key_id_label.set_markup("<b>Key Id:</b>")
167
 
        align.add(self.signature_key_id_label)
168
 
        signature_box.attach(align, 1, 2, 1, 2, gtk.FILL, gtk.FILL)
 
99
        signature_box.attach(self.signature_label, 1, 2, 0, 1, gtk.FILL)
 
100
 
 
101
        signature_info = gtk.Table(rows=1, columns=2)
 
102
        signature_info.set_row_spacings(6)
 
103
        signature_info.set_col_spacings(6)
 
104
 
 
105
        align = gtk.Alignment(1.0, 0.5)
 
106
        label = gtk.Label()
 
107
        label.set_markup("<b>Key Id:</b>")
 
108
        align.add(label)
 
109
        signature_info.attach(align, 0, 1, 0, 1, gtk.FILL, gtk.FILL)
169
110
 
170
111
        align = gtk.Alignment(0.0, 0.5)
171
112
        self.signature_key_id = gtk.Label()
172
113
        self.signature_key_id.set_selectable(True)
173
114
        align.add(self.signature_key_id)
174
 
        signature_box.attach(align, 2, 3, 1, 2, gtk.EXPAND | gtk.FILL, gtk.FILL)
175
 
 
176
 
        align = gtk.Alignment(0.0, 0.5)
177
 
        self.signature_fingerprint_label = gtk.Label()
178
 
        self.signature_fingerprint_label.set_markup("<b>Fingerprint:</b>")
179
 
        align.add(self.signature_fingerprint_label)
180
 
        signature_box.attach(align, 1, 2, 2, 3, gtk.FILL, gtk.FILL)
181
 
 
182
 
        align = gtk.Alignment(0.0, 0.5)
183
 
        self.signature_fingerprint = gtk.Label()
184
 
        self.signature_fingerprint.set_selectable(True)
185
 
        align.add(self.signature_fingerprint)
186
 
        signature_box.attach(align, 2, 3, 2, 3, gtk.EXPAND | gtk.FILL, gtk.FILL)
187
 
 
188
 
        align = gtk.Alignment(0.0, 0.5)
189
 
        self.signature_trust_label = gtk.Label()
190
 
        self.signature_trust_label.set_markup("<b>Trust:</b>")
191
 
        align.add(self.signature_trust_label)
192
 
        signature_box.attach(align, 1, 2, 3, 4, gtk.FILL, gtk.FILL)
193
 
 
194
 
        align = gtk.Alignment(0.0, 0.5)
195
 
        self.signature_trust = gtk.Label()
196
 
        self.signature_trust.set_selectable(True)
197
 
        align.add(self.signature_trust)
198
 
        signature_box.attach(align, 2, 3, 3, 4, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
115
        signature_info.attach(align, 1, 2, 0, 1, gtk.EXPAND | gtk.FILL, gtk.FILL)
199
116
 
200
117
        self.set_border_width(6)
201
118
        self.pack_start(signature_box, expand=False)
 
119
        self.pack_start(signature_info, expand=False)
202
120
        self.show_all()
203
121
 
204
 
    def set_revision(self, revision):
205
 
        self.revision = revision
206
 
        revid = revision.revision_id
207
 
 
208
 
        if self.repository.has_signature_for_revision_id(revid):
209
 
            crypttext = self.repository.get_signature_text(revid)
210
 
            self.show_signature(crypttext)
211
 
        else:
212
 
            self.show_no_signature()
213
 
 
214
122
    def show_no_signature(self):
215
 
        self.signature_key_id_label.hide()
216
123
        self.signature_key_id.set_text("")
217
 
 
218
 
        self.signature_fingerprint_label.hide()
219
 
        self.signature_fingerprint.set_text("")
220
 
 
221
 
        self.signature_trust_label.hide()
222
 
        self.signature_trust.set_text("")
223
 
 
224
124
        self.signature_image.set_from_file(icon_path("sign-unknown.png"))
225
 
        self.signature_label.set_markup("<b>Authenticity unknown</b>\n" +
226
 
                                        "This revision has not been signed.")
227
 
 
228
 
    def show_signature(self, crypttext):
229
 
        (cleartext, key) = seahorse.verify(crypttext)
230
 
 
231
 
        assert cleartext is not None
232
 
 
233
 
        inv = self.repository.get_inventory(self.revision.revision_id)
234
 
        expected_testament = Testament(self.revision, inv).as_short_text()
235
 
        if expected_testament != cleartext:
236
 
            self.signature_image.set_from_file(icon_path("sign-bad.png"))
237
 
            self.signature_label.set_markup("<b>Signature does not match repository data</b>\n" +
238
 
                        "The signature plaintext is different from the expected testament plaintext.")
239
 
            return
240
 
 
241
 
        if key and key.is_available():
242
 
            if key.is_trusted():
243
 
                if key.get_display_name() == self.revision.committer:
244
 
                    self.signature_image.set_from_file(icon_path("sign-ok.png"))
245
 
                    self.signature_label.set_markup("<b>Authenticity confirmed</b>\n" +
246
 
                                                    "This revision has been signed with " +
247
 
                                                    "a trusted key.")
248
 
                else:
249
 
                    self.signature_image.set_from_file(icon_path("sign-bad.png"))
250
 
                    self.signature_label.set_markup("<b>Authenticity cannot be confirmed</b>\n" +
251
 
                                                    "Revision committer is not the same as signer.")
252
 
            else:
253
 
                self.signature_image.set_from_file(icon_path("sign-bad.png"))
254
 
                self.signature_label.set_markup("<b>Authenticity cannot be confirmed</b>\n" +
255
 
                                                "This revision has been signed, but the " +
256
 
                                                "key is not trusted.")
 
125
        self.signature_label.set_text("This revision has not been signed.")
 
126
 
 
127
    def show_signature(self, text):
 
128
        signature = self.gpg.verify(text)
 
129
 
 
130
        if signature.key_id is not None:
 
131
            self.signature_key_id.set_text(signature.key_id)
 
132
 
 
133
        if signature.is_valid():
 
134
            self.signature_image.set_from_file(icon_path("sign-ok.png"))
 
135
            self.signature_label.set_text("This revision has been signed.")
257
136
        else:
258
 
            self.show_no_signature()
259
137
            self.signature_image.set_from_file(icon_path("sign-bad.png"))
260
 
            self.signature_label.set_markup("<b>Authenticity cannot be confirmed</b>\n" +
261
 
                                            "Signature key not available.")
262
 
            return
263
 
 
264
 
        trust = key.get_trust()
265
 
 
266
 
        if trust <= seahorse.TRUST_NEVER:
267
 
            trust_text = 'never trusted'
268
 
        elif trust == seahorse.TRUST_UNKNOWN:
269
 
            trust_text = 'not trusted'
270
 
        elif trust == seahorse.TRUST_MARGINAL:
271
 
            trust_text = 'marginally trusted'
272
 
        elif trust == seahorse.TRUST_FULL:
273
 
            trust_text = 'fully trusted'
274
 
        elif trust == seahorse.TRUST_ULTIMATE:
275
 
            trust_text = 'ultimately trusted'
276
 
 
277
 
        self.signature_key_id_label.show()
278
 
        self.signature_key_id.set_text(key.get_id())
279
 
 
280
 
        fingerprint = key.get_fingerprint()
281
 
        if fingerprint == "":
282
 
            fingerprint = '<span foreground="dim grey">N/A</span>'
283
 
 
284
 
        self.signature_fingerprint_label.show()
285
 
        self.signature_fingerprint.set_markup(fingerprint)
286
 
 
287
 
        self.signature_trust_label.show()
288
 
        self.signature_trust.set_text('This key is ' + trust_text)
 
138
            self.signature_label.set_text("This revision has been signed, " + 
 
139
                    "but the authenticity of the signature cannot be verified.")
289
140
 
290
141
 
291
142
class RevisionView(gtk.Notebook):
325
176
        )
326
177
    }
327
178
 
328
 
    def __init__(self, branch=None, repository=None):
 
179
 
 
180
    def __init__(self, branch=None):
329
181
        gtk.Notebook.__init__(self)
330
182
 
331
 
        self._revision = None
332
 
        self._branch = branch
333
 
        if branch is not None:
334
 
            self._repository = branch.repository
335
 
        else:
336
 
            self._repository = repository
337
 
 
338
183
        self._create_general()
339
184
        self._create_relations()
340
 
        # Disabled because testaments aren't verified yet:
341
 
        if has_seahorse:
342
 
            self._create_signature()
 
185
        self._create_signature()
343
186
        self._create_file_info_view()
344
187
        self._create_bugs()
345
188
 
346
 
        self.set_current_page(PAGE_GENERAL)
347
 
        self.connect_after('switch-page', self._switch_page_cb)
 
189
        self.set_current_page(0)
348
190
        
349
191
        self._show_callback = None
350
192
        self._clicked_callback = None
419
261
            self.timestamp.set_text(format_date(revision.timestamp,
420
262
                                                revision.timezone))
421
263
        try:
422
 
            self.branchnick.show()
423
 
            self.branchnick_label.show()
424
 
            self.branchnick.set_text(revision.properties['branch-nick'])
 
264
            self.branchnick_label.set_text(revision.properties['branch-nick'])
425
265
        except KeyError:
426
 
            self.branchnick.hide()
427
 
            self.branchnick_label.hide()
 
266
            self.branchnick_label.set_text("")
428
267
 
429
268
        self._add_parents_or_children(revision.parent_ids,
430
269
                                      self.parents_widgets,
431
270
                                      self.parents_table)
432
 
 
 
271
        
433
272
        file_info = revision.properties.get('file-info', None)
434
273
        if file_info is not None:
435
 
            try:
436
 
                file_info = bdecode(file_info.encode('UTF-8'))
437
 
            except ValueError:
438
 
                trace.note('Invalid per-file info for revision:%s, value: %r',
439
 
                           revision.revision_id, file_info)
440
 
                file_info = None
 
274
            file_info = bdecode(file_info.encode('UTF-8'))
441
275
 
442
276
        if file_info:
443
277
            if self._file_id is None:
459
293
        else:
460
294
            self.file_info_box.hide()
461
295
 
 
296
        self.bugs_table.clear()
 
297
        bugs_text = revision.properties.get('bugs', None)
 
298
        if bugs_text:
 
299
            for bugline in bugs_text.splitlines():
 
300
                (url, status) = bugline.split(" ")
 
301
                self.bugs_table.add_bug(url, status)
 
302
 
462
303
    def update_tags(self):
463
304
        if self._branch is not None and self._branch.supports_tags():
464
305
            self._tagdict = self._branch.tags.get_reverse_tag_dict()
468
309
        self._add_tags()
469
310
 
470
311
    def _update_signature(self, widget, param):
471
 
        if self.get_current_page() == PAGE_SIGNATURE:
472
 
            self.signature_table.set_revision(self._revision)
 
312
        revid = self._revision.revision_id
473
313
 
474
 
    def _update_bugs(self, widget, param):
475
 
        self.bugs_page.set_revision(self._revision)
476
 
        label = self.get_tab_label(self.bugs_page)
477
 
        label.set_sensitive(self.bugs_page.get_num_bugs() != 0)
 
314
        if self._branch.repository.has_signature_for_revision_id(revid):
 
315
            signature_text = self._branch.repository.get_signature_text(revid)
 
316
            self.signature_table.show_signature(signature_text)
 
317
        else:
 
318
            self.signature_table.show_no_signature()
478
319
 
479
320
    def set_children(self, children):
480
321
        self._add_parents_or_children(children,
481
322
                                      self.children_widgets,
482
323
                                      self.children_table)
483
324
 
484
 
    def _switch_page_cb(self, notebook, page, page_num):
485
 
        if page_num == PAGE_SIGNATURE:
486
 
            self.signature_table.set_revision(self._revision)
487
 
 
488
 
 
489
 
 
490
325
    def _show_clicked_cb(self, widget, revid, parentid):
491
326
        """Callback for when the show button for a parent is clicked."""
492
327
        self._show_callback(revid, parentid)
521
356
        table.resize(max(len(revids), 1), 2)
522
357
 
523
358
        for idx, revid in enumerate(revids):
524
 
            align = gtk.Alignment(0.0, 0.0, 1, 1)
 
359
            align = gtk.Alignment(0.0, 0.0)
525
360
            widgets.append(align)
526
361
            table.attach(align, 1, 2, idx, idx + 1,
527
362
                                      gtk.EXPAND | gtk.FILL, gtk.FILL)
544
379
                hbox.pack_start(button, expand=False, fill=True)
545
380
                button.show()
546
381
 
547
 
            button = gtk.Button()
548
 
            revid_label = gtk.Label(str(revid))
549
 
            revid_label.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
550
 
            revid_label.set_alignment(0.0, 0.5)
551
 
            button.add(revid_label)
 
382
            button = gtk.Button(revid)
552
383
            button.connect("clicked",
553
 
                    lambda w, r: self.set_revision(self._repository.get_revision(r)), revid)
 
384
                    lambda w, r: self.set_revision(self._branch.repository.get_revision(r)), revid)
554
385
            button.set_use_underline(False)
555
 
            hbox.pack_start(button, expand=True, fill=True)
556
 
            button.show_all()
 
386
            hbox.pack_start(button, expand=False, fill=True)
 
387
            button.show()
557
388
 
558
389
    def _create_general(self):
559
390
        vbox = gtk.VBox(False, 6)
572
403
        vbox.show()
573
404
 
574
405
    def _create_signature(self):
575
 
        self.signature_table = SignatureTab(self._repository)
 
406
        try:
 
407
            self.signature_table = SignatureTab()
 
408
        except ValueError: # No GPG found
 
409
            self.signature_table = None
 
410
            return
576
411
        self.append_page(self.signature_table, tab_label=gtk.Label('Signature'))
577
412
        self.connect_after('notify::revision', self._update_signature)
578
413
 
582
417
        self.table.set_col_spacings(6)
583
418
        self.table.show()
584
419
 
585
 
        row = 0
586
 
 
 
420
        align = gtk.Alignment(1.0, 0.5)
587
421
        label = gtk.Label()
588
 
        label.set_alignment(1.0, 0.5)
589
422
        label.set_markup("<b>Revision Id:</b>")
590
 
        self.table.attach(label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
 
423
        align.add(label)
 
424
        self.table.attach(align, 0, 1, 0, 1, gtk.FILL, gtk.FILL)
 
425
        align.show()
591
426
        label.show()
592
427
 
 
428
        align = gtk.Alignment(0.0, 0.5)
593
429
        revision_id = gtk.Label()
594
 
        revision_id.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
595
 
        revision_id.set_alignment(0.0, 0.5)
596
430
        revision_id.set_selectable(True)
597
431
        self.connect('notify::revision', 
598
432
                lambda w, p: revision_id.set_text(self._revision.revision_id))
599
 
        self.table.attach(revision_id, 1, 2, row, row+1, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
433
        align.add(revision_id)
 
434
        self.table.attach(align, 1, 2, 0, 1, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
435
        align.show()
600
436
        revision_id.show()
601
437
 
602
 
        row += 1
 
438
        align = gtk.Alignment(1.0, 0.5)
603
439
        self.author_label = gtk.Label()
604
 
        self.author_label.set_alignment(1.0, 0.5)
605
440
        self.author_label.set_markup("<b>Author:</b>")
606
 
        self.table.attach(self.author_label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
 
441
        align.add(self.author_label)
 
442
        self.table.attach(align, 0, 1, 1, 2, gtk.FILL, gtk.FILL)
 
443
        align.show()
607
444
        self.author_label.show()
608
445
 
 
446
        align = gtk.Alignment(0.0, 0.5)
609
447
        self.author = gtk.Label()
610
 
        self.author.set_ellipsize(pango.ELLIPSIZE_END)
611
 
        self.author.set_alignment(0.0, 0.5)
612
448
        self.author.set_selectable(True)
613
 
        self.table.attach(self.author, 1, 2, row, row+1, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
449
        align.add(self.author)
 
450
        self.table.attach(align, 1, 2, 1, 2, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
451
        align.show()
614
452
        self.author.show()
615
453
        self.author.hide()
616
454
 
617
 
        row += 1
 
455
        align = gtk.Alignment(1.0, 0.5)
618
456
        label = gtk.Label()
619
 
        label.set_alignment(1.0, 0.5)
620
457
        label.set_markup("<b>Committer:</b>")
621
 
        self.table.attach(label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
 
458
        align.add(label)
 
459
        self.table.attach(align, 0, 1, 2, 3, gtk.FILL, gtk.FILL)
 
460
        align.show()
622
461
        label.show()
623
462
 
 
463
        align = gtk.Alignment(0.0, 0.5)
624
464
        self.committer = gtk.Label()
625
 
        self.committer.set_ellipsize(pango.ELLIPSIZE_END)
626
 
        self.committer.set_alignment(0.0, 0.5)
627
465
        self.committer.set_selectable(True)
628
 
        self.table.attach(self.committer, 1, 2, row, row+1, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
466
        align.add(self.committer)
 
467
        self.table.attach(align, 1, 2, 2, 3, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
468
        align.show()
629
469
        self.committer.show()
630
470
 
631
 
        row += 1
 
471
        align = gtk.Alignment(0.0, 0.5)
 
472
        label = gtk.Label()
 
473
        label.set_markup("<b>Branch nick:</b>")
 
474
        align.add(label)
 
475
        self.table.attach(align, 0, 1, 3, 4, gtk.FILL, gtk.FILL)
 
476
        label.show()
 
477
        align.show()
 
478
 
 
479
        align = gtk.Alignment(0.0, 0.5)
632
480
        self.branchnick_label = gtk.Label()
633
 
        self.branchnick_label.set_alignment(1.0, 0.5)
634
 
        self.branchnick_label.set_markup("<b>Branch nick:</b>")
635
 
        self.table.attach(self.branchnick_label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
 
481
        self.branchnick_label.set_selectable(True)
 
482
        align.add(self.branchnick_label)
 
483
        self.table.attach(align, 1, 2, 3, 4, gtk.EXPAND | gtk.FILL, gtk.FILL)
636
484
        self.branchnick_label.show()
637
 
 
638
 
        self.branchnick = gtk.Label()
639
 
        self.branchnick.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
640
 
        self.branchnick.set_alignment(0.0, 0.5)
641
 
        self.branchnick.set_selectable(True)
642
 
        self.table.attach(self.branchnick, 1, 2, row, row+1, gtk.EXPAND | gtk.FILL, gtk.FILL)
643
 
        self.branchnick.show()
644
 
 
645
 
        row += 1
 
485
        align.show()
 
486
 
 
487
        align = gtk.Alignment(1.0, 0.5)
646
488
        label = gtk.Label()
647
 
        label.set_alignment(1.0, 0.5)
648
489
        label.set_markup("<b>Timestamp:</b>")
649
 
        self.table.attach(label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
 
490
        align.add(label)
 
491
        self.table.attach(align, 0, 1, 4, 5, gtk.FILL, gtk.FILL)
 
492
        align.show()
650
493
        label.show()
651
494
 
 
495
        align = gtk.Alignment(0.0, 0.5)
652
496
        self.timestamp = gtk.Label()
653
 
        self.timestamp.set_ellipsize(pango.ELLIPSIZE_END)
654
 
        self.timestamp.set_alignment(0.0, 0.5)
655
497
        self.timestamp.set_selectable(True)
656
 
        self.table.attach(self.timestamp, 1, 2, row, row+1, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
498
        align.add(self.timestamp)
 
499
        self.table.attach(align, 1, 2, 4, 5, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
500
        align.show()
657
501
        self.timestamp.show()
658
502
 
659
 
        row += 1
 
503
        align = gtk.Alignment(1.0, 0.5)
660
504
        self.tags_label = gtk.Label()
661
 
        self.tags_label.set_alignment(1.0, 0.5)
662
505
        self.tags_label.set_markup("<b>Tags:</b>")
663
 
        self.table.attach(self.tags_label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
 
506
        align.add(self.tags_label)
 
507
        align.show()
 
508
        self.table.attach(align, 0, 1, 5, 6, gtk.FILL, gtk.FILL)
664
509
        self.tags_label.show()
665
510
 
 
511
        align = gtk.Alignment(0.0, 0.5)
666
512
        self.tags_list = gtk.Label()
667
 
        self.tags_list.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
668
 
        self.tags_list.set_alignment(0.0, 0.5)
669
 
        self.table.attach(self.tags_list, 1, 2, row, row+1, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
513
        align.add(self.tags_list)
 
514
        self.table.attach(align, 1, 2, 5, 6, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
515
        align.show()
670
516
        self.tags_list.show()
671
517
 
672
518
        self.connect('notify::revision', self._add_tags)
727
573
        return window
728
574
 
729
575
    def _create_bugs(self):
730
 
        self.bugs_page = BugsTab()
731
 
        self.connect_after('notify::revision', self._update_bugs) 
732
 
        self.append_page(self.bugs_page, tab_label=gtk.Label('Bugs'))
 
576
        self.bugs_table = BugsTab()
 
577
        self.append_page(self.bugs_table, tab_label=gtk.Label('Bugs'))
733
578
 
734
579
    def _create_file_info_view(self):
735
580
        self.file_info_box = gtk.VBox(False, 6)