/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

Fix regressions in plugins tab.

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
 
class BugsTab(gtk.VBox):
57
 
 
 
34
class BugsTab(gtk.Table):
58
35
    def __init__(self):
59
 
        super(BugsTab, self).__init__(False, 6)
60
 
    
61
 
        table = gtk.Table(rows=2, columns=2)
62
 
 
63
 
        table.set_row_spacings(6)
64
 
        table.set_col_spacing(0, 16)
65
 
 
66
 
        image = gtk.Image()
67
 
        image.set_from_file(icon_path("bug.png"))
68
 
        table.attach(image, 0, 1, 0, 1, gtk.FILL)
69
 
 
70
 
        align = gtk.Alignment(0.0, 0.1)
71
 
        self.label = gtk.Label()
72
 
        align.add(self.label)
73
 
        table.attach(align, 1, 2, 0, 1, gtk.FILL)
74
 
 
75
 
        treeview = self.construct_treeview()
76
 
        table.attach(treeview, 1, 2, 1, 2, gtk.FILL | gtk.EXPAND)
77
 
 
78
 
        self.set_border_width(6)
79
 
        self.pack_start(table, expand=False)
80
 
 
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))
105
 
 
106
 
    def construct_treeview(self):
107
 
        self.bugs = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING)
108
 
        self.treeview = gtk.TreeView(self.bugs)
109
 
        self.treeview.set_headers_visible(False)
110
 
 
111
 
        uri_column = gtk.TreeViewColumn('Bug URI', gtk.CellRendererText(), text=0)
112
 
        self.treeview.append_column(uri_column)
113
 
 
114
 
        self.treeview.connect('row-activated', self.on_row_activated)
115
 
 
116
 
        win = gtk.ScrolledWindow()
117
 
        win.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
118
 
        win.set_shadow_type(gtk.SHADOW_IN)
119
 
        win.add(self.treeview)
120
 
 
121
 
        return win
 
36
        super(BugsTab, self).__init__(rows=5, columns=2)
 
37
        self.set_row_spacings(6)
 
38
        self.set_col_spacings(6)
 
39
        self.clear()
122
40
 
123
41
    def clear(self):
124
 
        self.num_bugs = 0
125
 
        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.")
 
42
        for c in self.get_children():
 
43
            self.remove(c)
 
44
        self.count = 0
 
45
        self.hide_all() # Only shown when there are bugs
129
46
 
130
47
    def add_bug(self, url, status):
131
 
        self.num_bugs += 1
132
 
        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)
 
48
        button = gtk.LinkButton(url, url)
 
49
        self.attach(button, 0, 1, self.count, self.count + 1,
 
50
                              gtk.EXPAND | gtk.FILL, gtk.FILL)
 
51
        status_label = gtk.Label(status)
 
52
        self.attach(status_label, 1, 2, self.count, self.count + 1,
 
53
                              gtk.EXPAND | gtk.FILL, gtk.FILL)
 
54
        self.count += 1
 
55
        self.show_all()
141
56
 
142
57
 
143
58
class SignatureTab(gtk.VBox):
144
 
 
145
 
    def __init__(self, repository):
146
 
        self.key = None
147
 
        self.revision = None
148
 
        self.repository = repository
149
 
 
 
59
    def __init__(self):
 
60
        from gpg import GPGSubprocess
 
61
        self.gpg = GPGSubprocess()
150
62
        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)
 
63
        signature_box = gtk.Table(rows=1, columns=2)
 
64
        signature_box.set_col_spacing(0, 12)
155
65
 
156
66
        self.signature_image = gtk.Image()
157
67
        signature_box.attach(self.signature_image, 0, 1, 0, 1, gtk.FILL)
158
68
 
159
 
        align = gtk.Alignment(0.0, 0.1)
160
69
        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)
 
70
        signature_box.attach(self.signature_label, 1, 2, 0, 1, gtk.FILL)
 
71
 
 
72
        signature_info = gtk.Table(rows=1, columns=2)
 
73
        signature_info.set_row_spacings(6)
 
74
        signature_info.set_col_spacings(6)
 
75
 
 
76
        align = gtk.Alignment(1.0, 0.5)
 
77
        label = gtk.Label()
 
78
        label.set_markup("<b>Key Id:</b>")
 
79
        align.add(label)
 
80
        signature_info.attach(align, 0, 1, 0, 1, gtk.FILL, gtk.FILL)
169
81
 
170
82
        align = gtk.Alignment(0.0, 0.5)
171
83
        self.signature_key_id = gtk.Label()
172
84
        self.signature_key_id.set_selectable(True)
173
85
        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)
 
86
        signature_info.attach(align, 1, 2, 0, 1, gtk.EXPAND | gtk.FILL, gtk.FILL)
199
87
 
200
88
        self.set_border_width(6)
201
89
        self.pack_start(signature_box, expand=False)
 
90
        self.pack_start(signature_info, expand=False)
202
91
        self.show_all()
203
92
 
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
93
    def show_no_signature(self):
215
 
        self.signature_key_id_label.hide()
216
94
        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
95
        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.")
 
96
        self.signature_label.set_text("This revision has not been signed.")
 
97
 
 
98
    def show_signature(self, text):
 
99
        signature = self.gpg.verify(text)
 
100
 
 
101
        if signature.key_id is not None:
 
102
            self.signature_key_id.set_text(signature.key_id)
 
103
 
 
104
        if signature.is_valid():
 
105
            self.signature_image.set_from_file(icon_path("sign-ok.png"))
 
106
            self.signature_label.set_text("This revision has been signed.")
257
107
        else:
258
 
            self.show_no_signature()
259
108
            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)
 
109
            self.signature_label.set_text("This revision has been signed, " + 
 
110
                    "but the authenticity of the signature cannot be verified.")
289
111
 
290
112
 
291
113
class RevisionView(gtk.Notebook):
325
147
        )
326
148
    }
327
149
 
328
 
    def __init__(self, branch=None, repository=None):
 
150
 
 
151
    def __init__(self, branch=None):
329
152
        gtk.Notebook.__init__(self)
330
153
 
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
154
        self._create_general()
339
155
        self._create_relations()
340
 
        # Disabled because testaments aren't verified yet:
341
 
        if has_seahorse:
342
 
            self._create_signature()
 
156
        self._create_signature()
343
157
        self._create_file_info_view()
344
158
        self._create_bugs()
345
159
 
346
 
        self.set_current_page(PAGE_GENERAL)
347
 
        self.connect_after('switch-page', self._switch_page_cb)
 
160
        self.set_current_page(0)
348
161
        
349
162
        self._show_callback = None
350
163
        self._clicked_callback = None
419
232
            self.timestamp.set_text(format_date(revision.timestamp,
420
233
                                                revision.timezone))
421
234
        try:
422
 
            self.branchnick.show()
423
 
            self.branchnick_label.show()
424
 
            self.branchnick.set_text(revision.properties['branch-nick'])
 
235
            self.branchnick_label.set_text(revision.properties['branch-nick'])
425
236
        except KeyError:
426
 
            self.branchnick.hide()
427
 
            self.branchnick_label.hide()
 
237
            self.branchnick_label.set_text("")
428
238
 
429
239
        self._add_parents_or_children(revision.parent_ids,
430
240
                                      self.parents_widgets,
431
241
                                      self.parents_table)
432
 
 
 
242
        
433
243
        file_info = revision.properties.get('file-info', None)
434
244
        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
 
245
            file_info = bdecode(file_info.encode('UTF-8'))
441
246
 
442
247
        if file_info:
443
248
            if self._file_id is None:
459
264
        else:
460
265
            self.file_info_box.hide()
461
266
 
 
267
        self.bugs_table.clear()
 
268
        bugs_text = revision.properties.get('bugs', None)
 
269
        if bugs_text:
 
270
            for bugline in bugs_text.splitlines():
 
271
                (url, status) = bugline.split(" ")
 
272
                self.bugs_table.add_bug(url, status)
 
273
 
462
274
    def update_tags(self):
463
275
        if self._branch is not None and self._branch.supports_tags():
464
276
            self._tagdict = self._branch.tags.get_reverse_tag_dict()
468
280
        self._add_tags()
469
281
 
470
282
    def _update_signature(self, widget, param):
471
 
        if self.get_current_page() == PAGE_SIGNATURE:
472
 
            self.signature_table.set_revision(self._revision)
 
283
        revid = self._revision.revision_id
473
284
 
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)
 
285
        if self._branch.repository.has_signature_for_revision_id(revid):
 
286
            signature_text = self._branch.repository.get_signature_text(revid)
 
287
            self.signature_table.show_signature(signature_text)
 
288
        else:
 
289
            self.signature_table.show_no_signature()
478
290
 
479
291
    def set_children(self, children):
480
292
        self._add_parents_or_children(children,
481
293
                                      self.children_widgets,
482
294
                                      self.children_table)
483
295
 
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
296
    def _show_clicked_cb(self, widget, revid, parentid):
491
297
        """Callback for when the show button for a parent is clicked."""
492
298
        self._show_callback(revid, parentid)
521
327
        table.resize(max(len(revids), 1), 2)
522
328
 
523
329
        for idx, revid in enumerate(revids):
524
 
            align = gtk.Alignment(0.0, 0.0, 1, 1)
 
330
            align = gtk.Alignment(0.0, 0.0)
525
331
            widgets.append(align)
526
332
            table.attach(align, 1, 2, idx, idx + 1,
527
333
                                      gtk.EXPAND | gtk.FILL, gtk.FILL)
544
350
                hbox.pack_start(button, expand=False, fill=True)
545
351
                button.show()
546
352
 
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)
 
353
            button = gtk.Button(revid)
552
354
            button.connect("clicked",
553
 
                    lambda w, r: self.set_revision(self._repository.get_revision(r)), revid)
 
355
                    lambda w, r: self.set_revision(self._branch.repository.get_revision(r)), revid)
554
356
            button.set_use_underline(False)
555
 
            hbox.pack_start(button, expand=True, fill=True)
556
 
            button.show_all()
 
357
            hbox.pack_start(button, expand=False, fill=True)
 
358
            button.show()
557
359
 
558
360
    def _create_general(self):
559
361
        vbox = gtk.VBox(False, 6)
572
374
        vbox.show()
573
375
 
574
376
    def _create_signature(self):
575
 
        self.signature_table = SignatureTab(self._repository)
 
377
        try:
 
378
            self.signature_table = SignatureTab()
 
379
        except ValueError: # No GPG found
 
380
            self.signature_table = None
 
381
            return
576
382
        self.append_page(self.signature_table, tab_label=gtk.Label('Signature'))
577
383
        self.connect_after('notify::revision', self._update_signature)
578
384
 
582
388
        self.table.set_col_spacings(6)
583
389
        self.table.show()
584
390
 
585
 
        row = 0
586
 
 
 
391
        align = gtk.Alignment(1.0, 0.5)
587
392
        label = gtk.Label()
588
 
        label.set_alignment(1.0, 0.5)
589
393
        label.set_markup("<b>Revision Id:</b>")
590
 
        self.table.attach(label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
 
394
        align.add(label)
 
395
        self.table.attach(align, 0, 1, 0, 1, gtk.FILL, gtk.FILL)
 
396
        align.show()
591
397
        label.show()
592
398
 
 
399
        align = gtk.Alignment(0.0, 0.5)
593
400
        revision_id = gtk.Label()
594
 
        revision_id.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
595
 
        revision_id.set_alignment(0.0, 0.5)
596
401
        revision_id.set_selectable(True)
597
402
        self.connect('notify::revision', 
598
403
                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)
 
404
        align.add(revision_id)
 
405
        self.table.attach(align, 1, 2, 0, 1, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
406
        align.show()
600
407
        revision_id.show()
601
408
 
602
 
        row += 1
 
409
        align = gtk.Alignment(1.0, 0.5)
603
410
        self.author_label = gtk.Label()
604
 
        self.author_label.set_alignment(1.0, 0.5)
605
411
        self.author_label.set_markup("<b>Author:</b>")
606
 
        self.table.attach(self.author_label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
 
412
        align.add(self.author_label)
 
413
        self.table.attach(align, 0, 1, 1, 2, gtk.FILL, gtk.FILL)
 
414
        align.show()
607
415
        self.author_label.show()
608
416
 
 
417
        align = gtk.Alignment(0.0, 0.5)
609
418
        self.author = gtk.Label()
610
 
        self.author.set_ellipsize(pango.ELLIPSIZE_END)
611
 
        self.author.set_alignment(0.0, 0.5)
612
419
        self.author.set_selectable(True)
613
 
        self.table.attach(self.author, 1, 2, row, row+1, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
420
        align.add(self.author)
 
421
        self.table.attach(align, 1, 2, 1, 2, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
422
        align.show()
614
423
        self.author.show()
615
424
        self.author.hide()
616
425
 
617
 
        row += 1
 
426
        align = gtk.Alignment(1.0, 0.5)
618
427
        label = gtk.Label()
619
 
        label.set_alignment(1.0, 0.5)
620
428
        label.set_markup("<b>Committer:</b>")
621
 
        self.table.attach(label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
 
429
        align.add(label)
 
430
        self.table.attach(align, 0, 1, 2, 3, gtk.FILL, gtk.FILL)
 
431
        align.show()
622
432
        label.show()
623
433
 
 
434
        align = gtk.Alignment(0.0, 0.5)
624
435
        self.committer = gtk.Label()
625
 
        self.committer.set_ellipsize(pango.ELLIPSIZE_END)
626
 
        self.committer.set_alignment(0.0, 0.5)
627
436
        self.committer.set_selectable(True)
628
 
        self.table.attach(self.committer, 1, 2, row, row+1, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
437
        align.add(self.committer)
 
438
        self.table.attach(align, 1, 2, 2, 3, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
439
        align.show()
629
440
        self.committer.show()
630
441
 
631
 
        row += 1
 
442
        align = gtk.Alignment(0.0, 0.5)
 
443
        label = gtk.Label()
 
444
        label.set_markup("<b>Branch nick:</b>")
 
445
        align.add(label)
 
446
        self.table.attach(align, 0, 1, 3, 4, gtk.FILL, gtk.FILL)
 
447
        label.show()
 
448
        align.show()
 
449
 
 
450
        align = gtk.Alignment(0.0, 0.5)
632
451
        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)
 
452
        self.branchnick_label.set_selectable(True)
 
453
        align.add(self.branchnick_label)
 
454
        self.table.attach(align, 1, 2, 3, 4, gtk.EXPAND | gtk.FILL, gtk.FILL)
636
455
        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
 
456
        align.show()
 
457
 
 
458
        align = gtk.Alignment(1.0, 0.5)
646
459
        label = gtk.Label()
647
 
        label.set_alignment(1.0, 0.5)
648
460
        label.set_markup("<b>Timestamp:</b>")
649
 
        self.table.attach(label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
 
461
        align.add(label)
 
462
        self.table.attach(align, 0, 1, 4, 5, gtk.FILL, gtk.FILL)
 
463
        align.show()
650
464
        label.show()
651
465
 
 
466
        align = gtk.Alignment(0.0, 0.5)
652
467
        self.timestamp = gtk.Label()
653
 
        self.timestamp.set_ellipsize(pango.ELLIPSIZE_END)
654
 
        self.timestamp.set_alignment(0.0, 0.5)
655
468
        self.timestamp.set_selectable(True)
656
 
        self.table.attach(self.timestamp, 1, 2, row, row+1, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
469
        align.add(self.timestamp)
 
470
        self.table.attach(align, 1, 2, 4, 5, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
471
        align.show()
657
472
        self.timestamp.show()
658
473
 
659
 
        row += 1
 
474
        align = gtk.Alignment(1.0, 0.5)
660
475
        self.tags_label = gtk.Label()
661
 
        self.tags_label.set_alignment(1.0, 0.5)
662
476
        self.tags_label.set_markup("<b>Tags:</b>")
663
 
        self.table.attach(self.tags_label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
 
477
        align.add(self.tags_label)
 
478
        align.show()
 
479
        self.table.attach(align, 0, 1, 5, 6, gtk.FILL, gtk.FILL)
664
480
        self.tags_label.show()
665
481
 
 
482
        align = gtk.Alignment(0.0, 0.5)
666
483
        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)
 
484
        align.add(self.tags_list)
 
485
        self.table.attach(align, 1, 2, 5, 6, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
486
        align.show()
670
487
        self.tags_list.show()
671
488
 
672
489
        self.connect('notify::revision', self._add_tags)
727
544
        return window
728
545
 
729
546
    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'))
 
547
        self.bugs_table = BugsTab()
 
548
        self.append_page(self.bugs_table, tab_label=gtk.Label('Bugs'))
733
549
 
734
550
    def _create_file_info_view(self):
735
551
        self.file_info_box = gtk.VBox(False, 6)