1
# Copyright (C) 2005 Dan Loda <danloda@gmail.com>
2
# Copyright (C) 2007 Jelmer Vernooij <jelmer@samba.org>
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; either version 2 of the License, or
7
# (at your option) any later version.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
from gi.repository import Gtk
19
from gi.repository import Pango
20
from gi.repository import GObject
23
from bzrlib import trace
24
from bzrlib.osutils import format_date
26
from bzrlib.bencode import bdecode
28
from bzrlib.util.bencode import bdecode
29
from bzrlib.testament import Testament
31
from bzrlib.plugins.gtk import icon_path
33
from bzrlib.plugins.gtk.avatarsbox import AvatarsBox
36
from bzrlib.plugins.gtk import seahorse
48
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)
54
if getattr(gtk, 'link_button_set_uri_hook', None) is not None:
55
Gtk.link_button_set_uri_hook(_open_link)
57
class BugsTab(Gtk.VBox):
60
super(BugsTab, self).__init__(False, 6)
62
table = Gtk.Table(rows=2, columns=2)
64
table.set_row_spacings(6)
65
table.set_col_spacing(0, 16)
68
image.set_from_file(icon_path("bug.png"))
69
table.attach(image, 0, 1, 0, 1, Gtk.AttachOptions.FILL)
71
align = Gtk.Alignment.new(0.0, 0.1)
72
self.label = Gtk.Label()
74
table.attach(align, 1, 2, 0, 1, Gtk.AttachOptions.FILL)
76
treeview = self.construct_treeview()
77
table.attach(treeview, 1, 2, 1, 2, Gtk.AttachOptions.FILL | Gtk.AttachOptions.EXPAND)
79
self.set_border_width(6)
80
self.pack_start(table, False, True, 0)
85
def set_revision(self, revision):
90
bugs_text = revision.properties.get('bugs', '')
91
for bugline in bugs_text.splitlines():
92
(url, status) = bugline.split(" ")
94
self.add_bug(url, status)
96
if self.num_bugs == 0:
98
elif self.num_bugs == 1:
103
self.label.set_markup("<b>Bugs fixed</b>\n" +
104
"This revision claims to fix " +
105
"%d %s." % (self.num_bugs, label))
107
def construct_treeview(self):
108
self.bugs = Gtk.ListStore(GObject.TYPE_STRING, GObject.TYPE_STRING)
109
self.treeview = Gtk.TreeView(self.bugs)
110
self.treeview.set_headers_visible(False)
112
uri_column = Gtk.TreeViewColumn('Bug URI', Gtk.CellRendererText(), text=0)
113
self.treeview.append_column(uri_column)
115
self.treeview.connect('row-activated', self.on_row_activated)
117
win = Gtk.ScrolledWindow()
118
win.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
119
win.set_shadow_type(Gtk.ShadowType.IN)
120
win.add(self.treeview)
127
self.set_sensitive(False)
128
self.label.set_markup("<b>No bugs fixed</b>\n" +
129
"This revision does not claim to fix any bugs.")
131
def add_bug(self, url, status):
133
self.bugs.append([url, status])
134
self.set_sensitive(True)
136
def get_num_bugs(self):
139
def on_row_activated(self, treeview, path, column):
140
uri = self.bugs.get_value(self.bugs.get_iter(path), 0)
141
_open_link(self, uri)
144
class SignatureTab(Gtk.VBox):
146
def __init__(self, repository):
149
self.repository = repository
151
super(SignatureTab, self).__init__(False, 6)
152
signature_box = Gtk.Table(rows=3, columns=3)
153
signature_box.set_col_spacing(0, 16)
154
signature_box.set_col_spacing(1, 12)
155
signature_box.set_row_spacings(6)
157
self.signature_image = Gtk.Image()
158
signature_box.attach(self.signature_image, 0, 1, 0, 1, Gtk.AttachOptions.FILL)
160
align = Gtk.Alignment.new(0.0, 0.1)
161
self.signature_label = Gtk.Label()
162
align.add(self.signature_label)
163
signature_box.attach(align, 1, 3, 0, 1, Gtk.AttachOptions.FILL)
165
align = Gtk.Alignment.new(0.0, 0.5)
166
self.signature_key_id_label = Gtk.Label()
167
self.signature_key_id_label.set_markup("<b>Key Id:</b>")
168
align.add(self.signature_key_id_label)
169
signature_box.attach(align, 1, 2, 1, 2, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
171
align = Gtk.Alignment.new(0.0, 0.5)
172
self.signature_key_id = Gtk.Label()
173
self.signature_key_id.set_selectable(True)
174
align.add(self.signature_key_id)
175
signature_box.attach(align, 2, 3, 1, 2, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
177
align = Gtk.Alignment.new(0.0, 0.5)
178
self.signature_fingerprint_label = Gtk.Label()
179
self.signature_fingerprint_label.set_markup("<b>Fingerprint:</b>")
180
align.add(self.signature_fingerprint_label)
181
signature_box.attach(align, 1, 2, 2, 3, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
183
align = Gtk.Alignment.new(0.0, 0.5)
184
self.signature_fingerprint = Gtk.Label()
185
self.signature_fingerprint.set_selectable(True)
186
align.add(self.signature_fingerprint)
187
signature_box.attach(align, 2, 3, 2, 3, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
189
align = Gtk.Alignment.new(0.0, 0.5)
190
self.signature_trust_label = Gtk.Label()
191
self.signature_trust_label.set_markup("<b>Trust:</b>")
192
align.add(self.signature_trust_label)
193
signature_box.attach(align, 1, 2, 3, 4, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
195
align = Gtk.Alignment.new(0.0, 0.5)
196
self.signature_trust = Gtk.Label()
197
self.signature_trust.set_selectable(True)
198
align.add(self.signature_trust)
199
signature_box.attach(align, 2, 3, 3, 4, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
201
self.set_border_width(6)
202
self.pack_start(signature_box, False, True, 0)
205
def set_revision(self, revision):
206
self.revision = revision
207
revid = revision.revision_id
209
if self.repository.has_signature_for_revision_id(revid):
210
crypttext = self.repository.get_signature_text(revid)
211
self.show_signature(crypttext)
213
self.show_no_signature()
215
def show_no_signature(self):
216
self.signature_key_id_label.hide()
217
self.signature_key_id.set_text("")
219
self.signature_fingerprint_label.hide()
220
self.signature_fingerprint.set_text("")
222
self.signature_trust_label.hide()
223
self.signature_trust.set_text("")
225
self.signature_image.set_from_file(icon_path("sign-unknown.png"))
226
self.signature_label.set_markup("<b>Authenticity unknown</b>\n" +
227
"This revision has not been signed.")
229
def show_signature(self, crypttext):
230
(cleartext, key) = seahorse.verify(crypttext)
232
assert cleartext is not None
234
inv = self.repository.get_inventory(self.revision.revision_id)
235
expected_testament = Testament(self.revision, inv).as_short_text()
236
if expected_testament != cleartext:
237
self.signature_image.set_from_file(icon_path("sign-bad.png"))
238
self.signature_label.set_markup("<b>Signature does not match repository data</b>\n" +
239
"The signature plaintext is different from the expected testament plaintext.")
242
if key and key.is_available():
244
if key.get_display_name() == self.revision.committer:
245
self.signature_image.set_from_file(icon_path("sign-ok.png"))
246
self.signature_label.set_markup("<b>Authenticity confirmed</b>\n" +
247
"This revision has been signed with " +
250
self.signature_image.set_from_file(icon_path("sign-bad.png"))
251
self.signature_label.set_markup("<b>Authenticity cannot be confirmed</b>\n" +
252
"Revision committer is not the same as signer.")
254
self.signature_image.set_from_file(icon_path("sign-bad.png"))
255
self.signature_label.set_markup("<b>Authenticity cannot be confirmed</b>\n" +
256
"This revision has been signed, but the " +
257
"key is not trusted.")
259
self.show_no_signature()
260
self.signature_image.set_from_file(icon_path("sign-bad.png"))
261
self.signature_label.set_markup("<b>Authenticity cannot be confirmed</b>\n" +
262
"Signature key not available.")
265
trust = key.get_trust()
267
if trust <= seahorse.TRUST_NEVER:
268
trust_text = 'never trusted'
269
elif trust == seahorse.TRUST_UNKNOWN:
270
trust_text = 'not trusted'
271
elif trust == seahorse.TRUST_MARGINAL:
272
trust_text = 'marginally trusted'
273
elif trust == seahorse.TRUST_FULL:
274
trust_text = 'fully trusted'
275
elif trust == seahorse.TRUST_ULTIMATE:
276
trust_text = 'ultimately trusted'
278
self.signature_key_id_label.show()
279
self.signature_key_id.set_text(key.get_id())
281
fingerprint = key.get_fingerprint()
282
if fingerprint == "":
283
fingerprint = '<span foreground="dim grey">N/A</span>'
285
self.signature_fingerprint_label.show()
286
self.signature_fingerprint.set_markup(fingerprint)
288
self.signature_trust_label.show()
289
self.signature_trust.set_text('This key is ' + trust_text)
292
class RevisionView(Gtk.Notebook):
293
""" Custom widget for commit log details.
295
A variety of bzr tools may need to implement such a thing. This is a
301
GObject.TYPE_PYOBJECT,
303
'The branch holding the revision being displayed',
304
GObject.PARAM_CONSTRUCT_ONLY | GObject.PARAM_WRITABLE
308
GObject.TYPE_PYOBJECT,
310
'The revision being displayed',
311
GObject.PARAM_READWRITE
315
GObject.TYPE_PYOBJECT,
318
GObject.PARAM_READWRITE
322
GObject.TYPE_PYOBJECT,
325
GObject.PARAM_READWRITE
329
def __init__(self, branch=None, repository=None):
330
GObject.GObject.__init__(self)
332
self._revision = None
333
self._branch = branch
334
if branch is not None:
335
self._repository = branch.repository
337
self._repository = repository
339
self._create_general()
340
self._create_relations()
341
# Disabled because testaments aren't verified yet:
343
self._create_signature()
344
self._create_file_info_view()
347
self.set_current_page(PAGE_GENERAL)
348
self.connect_after('switch-page', self._switch_page_cb)
350
self._show_callback = None
351
self._clicked_callback = None
353
self._revision = None
354
self._branch = branch
358
self.set_file_id(None)
360
def do_get_property(self, property):
361
if property.name == 'branch':
363
elif property.name == 'revision':
364
return self._revision
365
elif property.name == 'children':
366
return self._children
367
elif property.name == 'file-id':
370
raise AttributeError, 'unknown property %s' % property.name
372
def do_set_property(self, property, value):
373
if property.name == 'branch':
375
elif property.name == 'revision':
376
self._set_revision(value)
377
elif property.name == 'children':
378
self.set_children(value)
379
elif property.name == 'file-id':
380
self._file_id = value
382
raise AttributeError, 'unknown property %s' % property.name
384
def set_show_callback(self, callback):
385
self._show_callback = callback
387
def set_file_id(self, file_id):
388
"""Set a specific file id that we want to track.
390
This just effects the display of a per-file commit message.
391
If it is set to None, then all commit messages will be shown.
393
self.set_property('file-id', file_id)
395
def set_revision(self, revision):
396
if revision != self._revision:
397
self.set_property('revision', revision)
399
def get_revision(self):
400
return self.get_property('revision')
402
def _set_revision(self, revision):
403
if revision is None: return
405
self.avatarsbox.reset()
407
self._revision = revision
408
if revision.committer is not None:
409
self.committer.set_text(revision.committer)
410
self.avatarsbox.add(revision.committer, "committer")
412
self.committer.set_text("")
413
self.avatarsbox.hide()
414
author = revision.properties.get('author', '')
415
self.avatarsbox.merge(revision.get_apparent_authors(), "author")
417
self.author.set_text(author)
419
self.author_label.show()
422
self.author_label.hide()
424
if revision.timestamp is not None:
425
self.timestamp.set_text(format_date(revision.timestamp,
428
self.branchnick.show()
429
self.branchnick_label.show()
430
self.branchnick.set_text(revision.properties['branch-nick'])
432
self.branchnick.hide()
433
self.branchnick_label.hide()
435
self._add_parents_or_children(revision.parent_ids,
436
self.parents_widgets,
439
file_info = revision.properties.get('file-info', None)
440
if file_info is not None:
442
file_info = bdecode(file_info.encode('UTF-8'))
444
trace.note('Invalid per-file info for revision:%s, value: %r',
445
revision.revision_id, file_info)
449
if self._file_id is None:
452
text.append('%(path)s\n%(message)s' % fi)
453
self.file_info_buffer.set_text('\n'.join(text))
454
self.file_info_box.show()
458
if fi['file_id'] == self._file_id:
459
text.append(fi['message'])
461
self.file_info_buffer.set_text('\n'.join(text))
462
self.file_info_box.show()
464
self.file_info_box.hide()
466
self.file_info_box.hide()
468
def update_tags(self):
469
if self._branch is not None and self._branch.supports_tags():
470
self._tagdict = self._branch.tags.get_reverse_tag_dict()
476
def _update_signature(self, widget, param):
477
if self.get_current_page() == PAGE_SIGNATURE:
478
self.signature_table.set_revision(self._revision)
480
def _update_bugs(self, widget, param):
481
self.bugs_page.set_revision(self._revision)
482
label = self.get_tab_label(self.bugs_page)
483
label.set_sensitive(self.bugs_page.get_num_bugs() != 0)
485
def set_children(self, children):
486
self._add_parents_or_children(children,
487
self.children_widgets,
490
def _switch_page_cb(self, notebook, page, page_num):
491
if page_num == PAGE_SIGNATURE:
492
self.signature_table.set_revision(self._revision)
496
def _show_clicked_cb(self, widget, revid, parentid):
497
"""Callback for when the show button for a parent is clicked."""
498
self._show_callback(revid, parentid)
500
def _go_clicked_cb(self, widget, revid):
501
"""Callback for when the go button for a parent is clicked."""
503
def _add_tags(self, *args):
504
if self._revision is None:
507
if self._tagdict.has_key(self._revision.revision_id):
508
tags = self._tagdict[self._revision.revision_id]
513
self.tags_list.hide()
514
self.tags_label.hide()
517
self.tags_list.set_text(", ".join(tags))
519
self.tags_list.show_all()
520
self.tags_label.show_all()
522
def _add_parents_or_children(self, revids, widgets, table):
523
while len(widgets) > 0:
524
widget = widgets.pop()
527
table.resize(max(len(revids), 1), 2)
529
for idx, revid in enumerate(revids):
530
align = Gtk.Alignment.new(0.0, 0.0, 1, 1)
531
widgets.append(align)
532
table.attach(align, 1, 2, idx, idx + 1,
533
Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
536
hbox = Gtk.HBox(False, spacing=6)
541
image.set_from_stock(
542
Gtk.STOCK_FIND, Gtk.IconSize.SMALL_TOOLBAR)
545
if self._show_callback is not None:
546
button = Gtk.Button()
548
button.connect("clicked", self._show_clicked_cb,
549
self._revision.revision_id, revid)
550
hbox.pack_start(button, expand=False, fill=True)
553
button = Gtk.Button()
554
revid_label = Gtk.Label(label=str(revid))
555
revid_label.set_ellipsize(Pango.EllipsizeMode.MIDDLE)
556
revid_label.set_alignment(0.0, 0.5)
557
button.add(revid_label)
558
button.connect("clicked",
559
lambda w, r: self.set_revision(self._repository.get_revision(r)), revid)
560
button.set_use_underline(False)
561
hbox.pack_start(button, expand=True, fill=True)
564
def _create_general(self):
565
vbox = Gtk.VBox(False, 6)
566
vbox.set_border_width(6)
567
vbox.pack_start(self._create_headers(, True, True, 0), expand=False, fill=True)
568
vbox.pack_start(self._create_message_view(, True, True, 0))
569
self.append_page(vbox, tab_label=Gtk.Label(label="General"))
572
def _create_relations(self):
573
vbox = Gtk.VBox(False, 6)
574
vbox.set_border_width(6)
575
vbox.pack_start(self._create_parents(, True, True, 0), expand=False, fill=True)
576
vbox.pack_start(self._create_children(, True, True, 0), expand=False, fill=True)
577
self.append_page(vbox, tab_label=Gtk.Label(label="Relations"))
580
def _create_signature(self):
581
self.signature_table = SignatureTab(self._repository)
582
self.append_page(self.signature_table, tab_label=Gtk.Label(label='Signature'))
583
self.connect_after('notify::revision', self._update_signature)
585
def _create_headers(self):
586
self.avatarsbox = AvatarsBox()
588
self.table = Gtk.Table(rows=5, columns=2)
589
self.table.set_row_spacings(6)
590
self.table.set_col_spacings(6)
593
self.avatarsbox.pack_start(self.table, True, True, 0)
594
self.avatarsbox.show()
599
label.set_alignment(1.0, 0.5)
600
label.set_markup("<b>Revision Id:</b>")
601
self.table.attach(label, 0, 1, row, row+1, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
604
revision_id = Gtk.Label()
605
revision_id.set_ellipsize(Pango.EllipsizeMode.MIDDLE)
606
revision_id.set_alignment(0.0, 0.5)
607
revision_id.set_selectable(True)
608
self.connect('notify::revision',
609
lambda w, p: revision_id.set_text(self._revision.revision_id))
610
self.table.attach(revision_id, 1, 2, row, row+1, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
614
self.author_label = Gtk.Label()
615
self.author_label.set_alignment(1.0, 0.5)
616
self.author_label.set_markup("<b>Author:</b>")
617
self.table.attach(self.author_label, 0, 1, row, row+1, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
618
self.author_label.show()
620
self.author = Gtk.Label()
621
self.author.set_ellipsize(Pango.EllipsizeMode.END)
622
self.author.set_alignment(0.0, 0.5)
623
self.author.set_selectable(True)
624
self.table.attach(self.author, 1, 2, row, row+1, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
630
label.set_alignment(1.0, 0.5)
631
label.set_markup("<b>Committer:</b>")
632
self.table.attach(label, 0, 1, row, row+1, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
635
self.committer = Gtk.Label()
636
self.committer.set_ellipsize(Pango.EllipsizeMode.END)
637
self.committer.set_alignment(0.0, 0.5)
638
self.committer.set_selectable(True)
639
self.table.attach(self.committer, 1, 2, row, row+1, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
640
self.committer.show()
643
self.branchnick_label = Gtk.Label()
644
self.branchnick_label.set_alignment(1.0, 0.5)
645
self.branchnick_label.set_markup("<b>Branch nick:</b>")
646
self.table.attach(self.branchnick_label, 0, 1, row, row+1, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
647
self.branchnick_label.show()
649
self.branchnick = Gtk.Label()
650
self.branchnick.set_ellipsize(Pango.EllipsizeMode.MIDDLE)
651
self.branchnick.set_alignment(0.0, 0.5)
652
self.branchnick.set_selectable(True)
653
self.table.attach(self.branchnick, 1, 2, row, row+1, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
654
self.branchnick.show()
658
label.set_alignment(1.0, 0.5)
659
label.set_markup("<b>Timestamp:</b>")
660
self.table.attach(label, 0, 1, row, row+1, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
663
self.timestamp = Gtk.Label()
664
self.timestamp.set_ellipsize(Pango.EllipsizeMode.END)
665
self.timestamp.set_alignment(0.0, 0.5)
666
self.timestamp.set_selectable(True)
667
self.table.attach(self.timestamp, 1, 2, row, row+1, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
668
self.timestamp.show()
671
self.tags_label = Gtk.Label()
672
self.tags_label.set_alignment(1.0, 0.5)
673
self.tags_label.set_markup("<b>Tags:</b>")
674
self.table.attach(self.tags_label, 0, 1, row, row+1, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
675
self.tags_label.show()
677
self.tags_list = Gtk.Label()
678
self.tags_list.set_ellipsize(Pango.EllipsizeMode.MIDDLE)
679
self.tags_list.set_alignment(0.0, 0.5)
680
self.table.attach(self.tags_list, 1, 2, row, row+1, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
681
self.tags_list.show()
683
self.connect('notify::revision', self._add_tags)
685
self.avatarsbox.show()
686
return self.avatarsbox
688
def _create_parents(self):
689
hbox = Gtk.HBox(True, 3)
691
self.parents_table = self._create_parents_or_children_table(
693
self.parents_widgets = []
694
hbox.pack_start(self.parents_table, True, True, 0)
699
def _create_children(self):
700
hbox = Gtk.HBox(True, 3)
701
self.children_table = self._create_parents_or_children_table(
703
self.children_widgets = []
704
hbox.pack_start(self.children_table, True, True, 0)
708
def _create_parents_or_children_table(self, text):
709
table = Gtk.Table(rows=1, columns=2)
710
table.set_row_spacings(3)
711
table.set_col_spacings(6)
715
label.set_markup(text)
716
align = Gtk.Alignment.new(0.0, 0.5)
718
table.attach(align, 0, 1, 0, 1, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
724
def _create_message_view(self):
725
msg_buffer = Gtk.TextBuffer()
726
self.connect('notify::revision',
727
lambda w, p: msg_buffer.set_text(self._revision.message))
728
window = Gtk.ScrolledWindow()
729
window.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
730
window.set_shadow_type(Gtk.ShadowType.IN)
731
tv = Gtk.TextView(msg_buffer)
732
tv.set_editable(False)
733
tv.set_wrap_mode(Gtk.WrapMode.WORD)
735
tv.modify_font(Pango.FontDescription("Monospace"))
741
def _create_bugs(self):
742
self.bugs_page = BugsTab()
743
self.connect_after('notify::revision', self._update_bugs)
744
self.append_page(self.bugs_page, tab_label=Gtk.Label(label='Bugs'))
746
def _create_file_info_view(self):
747
self.file_info_box = Gtk.VBox(False, 6)
748
self.file_info_box.set_border_width(6)
749
self.file_info_buffer = Gtk.TextBuffer()
750
window = Gtk.ScrolledWindow()
751
window.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
752
window.set_shadow_type(Gtk.ShadowType.IN)
753
tv = Gtk.TextView(self.file_info_buffer)
754
tv.set_editable(False)
755
tv.set_wrap_mode(Gtk.WrapMode.WORD)
756
tv.modify_font(Pango.FontDescription("Monospace"))
760
self.file_info_box.pack_start(window, True, True, 0)
761
self.file_info_box.hide() # Only shown when there are per-file messages
762
self.append_page(self.file_info_box, tab_label=Gtk.Label(label='Per-file'))