/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz
0.1.1 by Dan Loda
First working version of xannotate.
1
# Copyright (C) 2005 Dan Loda <danloda@gmail.com>
175 by Jelmer Vernooij
Add very simple gmissing command.
2
# Copyright (C) 2007 Jelmer Vernooij <jelmer@samba.org>
0.1.1 by Dan Loda
First working version of xannotate.
3
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.
8
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.
13
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
17
18
import pygtk
19
pygtk.require("2.0")
20
import gtk
21
import pango
22
23
from bzrlib.osutils import format_date
278.1.2 by John Arbash Meinel
Add an extra box that pops up when we have per-file information.
24
from bzrlib.util import bencode
0.1.1 by Dan Loda
First working version of xannotate.
25
330.3.1 by Daniel Schierbeck
Renamed logview 'revisionview'.
26
class RevisionView(gtk.Notebook):
0.1.1 by Dan Loda
First working version of xannotate.
27
    """ Custom widget for commit log details.
28
29
    A variety of bzr tools may need to implement such a thing. This is a
30
    start.
31
    """
32
330.3.1 by Daniel Schierbeck
Renamed logview 'revisionview'.
33
    def __init__(self, revision=None, tags=[],
324.2.4 by Daniel Schierbeck
Added 'Changes' page to logview.
34
                 show_children=False, branch=None):
324.2.1 by Daniel Schierbeck
Turned the logview into a notebook.
35
        gtk.Notebook.__init__(self)
256.2.23 by Gary van der Merwe
Show Children
36
        self.show_children = show_children
324.2.4 by Daniel Schierbeck
Added 'Changes' page to logview.
37
324.2.1 by Daniel Schierbeck
Turned the logview into a notebook.
38
        self._create_general()
39
        self._create_relations()
399.1.1 by Daniel Schierbeck
Made the revisionview show whether a revision has been signed.
40
        self._create_signatures()
278.1.45 by John Arbash Meinel
Switch to a new tab for per-file messages.
41
        self._create_file_info_view()
324.2.9 by Daniel Schierbeck
Made 'General' the default page of the logview.
42
43
        self.set_current_page(0)
324.2.4 by Daniel Schierbeck
Added 'Changes' page to logview.
44
        
147 by Jelmer Vernooij
Remove a bunch of duplicate functionality.
45
        self._show_callback = None
148 by Jelmer Vernooij
Clean up interface a bit: don't show diff button when no diff can be accessed, use label instead of button when there is no callback set.
46
        self._go_callback = None
147 by Jelmer Vernooij
Remove a bunch of duplicate functionality.
47
        self._clicked_callback = None
0.1.1 by Dan Loda
First working version of xannotate.
48
324.2.4 by Daniel Schierbeck
Added 'Changes' page to logview.
49
        self._branch = branch
50
0.1.1 by Dan Loda
First working version of xannotate.
51
        if revision is not None:
241 by Jelmer Vernooij
Show tags in bzr viz.
52
            self.set_revision(revision, tags=tags)
278.1.3 by John Arbash Meinel
Have the ability to tell the log view that we only care about a specific file_id.
53
        self.set_file_id(None)
0.1.1 by Dan Loda
First working version of xannotate.
54
147 by Jelmer Vernooij
Remove a bunch of duplicate functionality.
55
    def set_show_callback(self, callback):
56
        self._show_callback = callback
57
58
    def set_go_callback(self, callback):
59
        self._go_callback = callback
60
278.1.3 by John Arbash Meinel
Have the ability to tell the log view that we only care about a specific file_id.
61
    def set_file_id(self, file_id):
62
        """Set a specific file id that we want to track.
63
64
        This just effects the display of a per-file commit message.
65
        If it is set to None, then all commit messages will be shown.
66
        """
67
        self._file_id = file_id
68
256.2.23 by Gary van der Merwe
Show Children
69
    def set_revision(self, revision, tags=[], children=[]):
147 by Jelmer Vernooij
Remove a bunch of duplicate functionality.
70
        self._revision = revision
0.1.1 by Dan Loda
First working version of xannotate.
71
        self.revision_id.set_text(revision.revision_id)
192 by Jelmer Vernooij
Allow committer to be None.
72
        if revision.committer is not None:
73
            self.committer.set_text(revision.committer)
74
        else:
75
            self.committer.set_text("")
259 by Aaron Bentley
Add author support to gannotate and log viewer
76
        author = revision.properties.get('author', '')
77
        if author != '':
78
            self.author.set_text(author)
79
            self.author.show()
80
            self.author_label.show()
81
        else:
82
            self.author.hide()
83
            self.author_label.hide()
84
197 by Jelmer Vernooij
Fix some warnings when displaying ghost revisions. Reported by John.
85
        if revision.timestamp is not None:
86
            self.timestamp.set_text(format_date(revision.timestamp,
87
                                                revision.timezone))
0.1.1 by Dan Loda
First working version of xannotate.
88
        self.message_buffer.set_text(revision.message)
147 by Jelmer Vernooij
Remove a bunch of duplicate functionality.
89
        try:
90
            self.branchnick_label.set_text(revision.properties['branch-nick'])
91
        except KeyError:
92
            self.branchnick_label.set_text("")
93
256.2.23 by Gary van der Merwe
Show Children
94
        self._add_parents_or_children(revision.parent_ids,
95
                                      self.parents_widgets,
96
                                      self.parents_table)
97
        
98
        if self.show_children:
99
            self._add_parents_or_children(children,
100
                                          self.children_widgets,
101
                                          self.children_table)
102
        
241 by Jelmer Vernooij
Show tags in bzr viz.
103
        self._add_tags(tags)
324.2.10 by Daniel Schierbeck
Reduced overhead by only calculating diff when 'Changes' page is selected.
104
278.1.3 by John Arbash Meinel
Have the ability to tell the log view that we only care about a specific file_id.
105
        file_info = revision.properties.get('file-info', None)
278.1.2 by John Arbash Meinel
Add an extra box that pops up when we have per-file information.
106
        if file_info is not None:
278.1.31 by John Arbash Meinel
We can make bencode work again by a simple decode/encode step.
107
            file_info = bencode.bdecode(file_info.encode('UTF-8'))
278.1.2 by John Arbash Meinel
Add an extra box that pops up when we have per-file information.
108
109
        if file_info:
278.1.3 by John Arbash Meinel
Have the ability to tell the log view that we only care about a specific file_id.
110
            if self._file_id is None:
111
                text = []
112
                for fi in file_info:
113
                    text.append('%(path)s\n%(message)s' % fi)
114
                self.file_info_buffer.set_text('\n'.join(text))
115
                self.file_info_box.show()
116
            else:
117
                text = []
118
                for fi in file_info:
119
                    if fi['file_id'] == self._file_id:
120
                        text.append(fi['message'])
121
                if text:
122
                    self.file_info_buffer.set_text('\n'.join(text))
123
                    self.file_info_box.show()
124
                else:
125
                    self.file_info_box.hide()
278.1.2 by John Arbash Meinel
Add an extra box that pops up when we have per-file information.
126
        else:
127
            self.file_info_box.hide()
128
399.1.1 by Daniel Schierbeck
Made the revisionview show whether a revision has been signed.
129
        if self._branch is not None and self._branch.repository.has_signature_for_revision_id(revision.revision_id):
399.1.2 by Daniel Schierbeck
Added icon to the signature page.
130
            self.signature_image.set_from_file("icons/sign-bad.png")
399.1.1 by Daniel Schierbeck
Made the revisionview show whether a revision has been signed.
131
            self.signature_label.set_text("This revision has been signed, but the authenticity of the signature cannot be verified.")
132
        else:
399.1.2 by Daniel Schierbeck
Added icon to the signature page.
133
            self.signature_image.set_from_file("icons/sign-unknown.png")
399.1.1 by Daniel Schierbeck
Made the revisionview show whether a revision has been signed.
134
            self.signature_label.set_text("This revision has not been signed.")
135
147 by Jelmer Vernooij
Remove a bunch of duplicate functionality.
136
    def _show_clicked_cb(self, widget, revid, parentid):
137
        """Callback for when the show button for a parent is clicked."""
138
        self._show_callback(revid, parentid)
139
140
    def _go_clicked_cb(self, widget, revid):
141
        """Callback for when the go button for a parent is clicked."""
142
        self._go_callback(revid)
143
241 by Jelmer Vernooij
Show tags in bzr viz.
144
    def _add_tags(self, tags):
145
        if tags == []:
146
            self.tags_list.hide()
147
            self.tags_label.hide()
148
            return
149
150
        for widget in self.tags_widgets:
151
            self.tags_list.remove(widget)
152
242 by Jelmer Vernooij
Avoid cleanup warning.
153
        self.tags_widgets = []
154
241 by Jelmer Vernooij
Show tags in bzr viz.
155
        for tag in tags:
156
            widget = gtk.Label(tag)
157
            widget.set_selectable(True)
158
            self.tags_widgets.append(widget)
159
            self.tags_list.add(widget)
160
        self.tags_list.show_all()
161
        self.tags_label.show_all()
162
        
256.2.23 by Gary van der Merwe
Show Children
163
    def _add_parents_or_children(self, revids, widgets, table):
164
        while len(widgets) > 0:
165
            widget = widgets.pop()
166
            table.remove(widget)
167
        
168
        table.resize(max(len(revids), 1), 2)
147 by Jelmer Vernooij
Remove a bunch of duplicate functionality.
169
256.2.23 by Gary van der Merwe
Show Children
170
        for idx, revid in enumerate(revids):
147 by Jelmer Vernooij
Remove a bunch of duplicate functionality.
171
            align = gtk.Alignment(0.0, 0.0)
256.2.23 by Gary van der Merwe
Show Children
172
            widgets.append(align)
173
            table.attach(align, 1, 2, idx, idx + 1,
147 by Jelmer Vernooij
Remove a bunch of duplicate functionality.
174
                                      gtk.EXPAND | gtk.FILL, gtk.FILL)
0.1.1 by Dan Loda
First working version of xannotate.
175
            align.show()
147 by Jelmer Vernooij
Remove a bunch of duplicate functionality.
176
177
            hbox = gtk.HBox(False, spacing=6)
178
            align.add(hbox)
179
            hbox.show()
180
181
            image = gtk.Image()
182
            image.set_from_stock(
183
                gtk.STOCK_FIND, gtk.ICON_SIZE_SMALL_TOOLBAR)
184
            image.show()
185
148 by Jelmer Vernooij
Clean up interface a bit: don't show diff button when no diff can be accessed, use label instead of button when there is no callback set.
186
            if self._show_callback is not None:
187
                button = gtk.Button()
188
                button.add(image)
189
                button.connect("clicked", self._show_clicked_cb,
256.2.23 by Gary van der Merwe
Show Children
190
                               self._revision.revision_id, revid)
148 by Jelmer Vernooij
Clean up interface a bit: don't show diff button when no diff can be accessed, use label instead of button when there is no callback set.
191
                hbox.pack_start(button, expand=False, fill=True)
192
                button.show()
147 by Jelmer Vernooij
Remove a bunch of duplicate functionality.
193
148 by Jelmer Vernooij
Clean up interface a bit: don't show diff button when no diff can be accessed, use label instead of button when there is no callback set.
194
            if self._go_callback is not None:
256.2.23 by Gary van der Merwe
Show Children
195
                button = gtk.Button(revid)
196
                button.connect("clicked", self._go_clicked_cb, revid)
148 by Jelmer Vernooij
Clean up interface a bit: don't show diff button when no diff can be accessed, use label instead of button when there is no callback set.
197
            else:
256.2.23 by Gary van der Merwe
Show Children
198
                button = gtk.Label(revid)
147 by Jelmer Vernooij
Remove a bunch of duplicate functionality.
199
            button.set_use_underline(False)
200
            hbox.pack_start(button, expand=False, fill=True)
201
            button.show()
0.1.1 by Dan Loda
First working version of xannotate.
202
324.2.1 by Daniel Schierbeck
Turned the logview into a notebook.
203
    def _create_general(self):
0.1.1 by Dan Loda
First working version of xannotate.
204
        vbox = gtk.VBox(False, 6)
205
        vbox.set_border_width(6)
206
        vbox.pack_start(self._create_headers(), expand=False, fill=True)
324.2.1 by Daniel Schierbeck
Turned the logview into a notebook.
207
        vbox.pack_start(self._create_message_view())
208
        self.append_page(vbox, tab_label=gtk.Label("General"))
209
        vbox.show()
210
211
    def _create_relations(self):
212
        vbox = gtk.VBox(False, 6)
213
        vbox.set_border_width(6)
291 by Jelmer Vernooij
Put children widget on a new line.
214
        vbox.pack_start(self._create_parents(), expand=False, fill=True)
215
        if self.show_children:
216
            vbox.pack_start(self._create_children(), expand=False, fill=True)
324.2.1 by Daniel Schierbeck
Turned the logview into a notebook.
217
        self.append_page(vbox, tab_label=gtk.Label("Relations"))
0.1.1 by Dan Loda
First working version of xannotate.
218
        vbox.show()
324.2.4 by Daniel Schierbeck
Added 'Changes' page to logview.
219
0.1.1 by Dan Loda
First working version of xannotate.
220
    def _create_headers(self):
241 by Jelmer Vernooij
Show tags in bzr viz.
221
        self.table = gtk.Table(rows=5, columns=2)
0.1.1 by Dan Loda
First working version of xannotate.
222
        self.table.set_row_spacings(6)
223
        self.table.set_col_spacings(6)
224
        self.table.show()
147 by Jelmer Vernooij
Remove a bunch of duplicate functionality.
225
226
        align = gtk.Alignment(1.0, 0.5)
227
        label = gtk.Label()
228
        label.set_markup("<b>Revision Id:</b>")
229
        align.add(label)
230
        self.table.attach(align, 0, 1, 0, 1, gtk.FILL, gtk.FILL)
231
        align.show()
232
        label.show()
233
234
        align = gtk.Alignment(0.0, 0.5)
235
        self.revision_id = gtk.Label()
236
        self.revision_id.set_selectable(True)
237
        align.add(self.revision_id)
238
        self.table.attach(align, 1, 2, 0, 1, gtk.EXPAND | gtk.FILL, gtk.FILL)
239
        align.show()
240
        self.revision_id.show()
241
0.1.1 by Dan Loda
First working version of xannotate.
242
        align = gtk.Alignment(1.0, 0.5)
259 by Aaron Bentley
Add author support to gannotate and log viewer
243
        self.author_label = gtk.Label()
244
        self.author_label.set_markup("<b>Author:</b>")
245
        align.add(self.author_label)
246
        self.table.attach(align, 0, 1, 1, 2, gtk.FILL, gtk.FILL)
247
        align.show()
248
        self.author_label.show()
249
250
        align = gtk.Alignment(0.0, 0.5)
251
        self.author = gtk.Label()
252
        self.author.set_selectable(True)
253
        align.add(self.author)
254
        self.table.attach(align, 1, 2, 1, 2, gtk.EXPAND | gtk.FILL, gtk.FILL)
255
        align.show()
256
        self.author.show()
257
        self.author.hide()
258
259
        align = gtk.Alignment(1.0, 0.5)
0.1.1 by Dan Loda
First working version of xannotate.
260
        label = gtk.Label()
261
        label.set_markup("<b>Committer:</b>")
262
        align.add(label)
259 by Aaron Bentley
Add author support to gannotate and log viewer
263
        self.table.attach(align, 0, 1, 2, 3, gtk.FILL, gtk.FILL)
0.1.1 by Dan Loda
First working version of xannotate.
264
        align.show()
265
        label.show()
266
267
        align = gtk.Alignment(0.0, 0.5)
268
        self.committer = gtk.Label()
269
        self.committer.set_selectable(True)
270
        align.add(self.committer)
259 by Aaron Bentley
Add author support to gannotate and log viewer
271
        self.table.attach(align, 1, 2, 2, 3, gtk.EXPAND | gtk.FILL, gtk.FILL)
0.1.1 by Dan Loda
First working version of xannotate.
272
        align.show()
273
        self.committer.show()
274
147 by Jelmer Vernooij
Remove a bunch of duplicate functionality.
275
        align = gtk.Alignment(0.0, 0.5)
276
        label = gtk.Label()
277
        label.set_markup("<b>Branch nick:</b>")
278
        align.add(label)
259 by Aaron Bentley
Add author support to gannotate and log viewer
279
        self.table.attach(align, 0, 1, 3, 4, gtk.FILL, gtk.FILL)
147 by Jelmer Vernooij
Remove a bunch of duplicate functionality.
280
        label.show()
281
        align.show()
282
283
        align = gtk.Alignment(0.0, 0.5)
284
        self.branchnick_label = gtk.Label()
285
        self.branchnick_label.set_selectable(True)
286
        align.add(self.branchnick_label)
259 by Aaron Bentley
Add author support to gannotate and log viewer
287
        self.table.attach(align, 1, 2, 3, 4, gtk.EXPAND | gtk.FILL, gtk.FILL)
147 by Jelmer Vernooij
Remove a bunch of duplicate functionality.
288
        self.branchnick_label.show()
289
        align.show()
290
0.1.1 by Dan Loda
First working version of xannotate.
291
        align = gtk.Alignment(1.0, 0.5)
292
        label = gtk.Label()
293
        label.set_markup("<b>Timestamp:</b>")
294
        align.add(label)
259 by Aaron Bentley
Add author support to gannotate and log viewer
295
        self.table.attach(align, 0, 1, 4, 5, gtk.FILL, gtk.FILL)
0.1.1 by Dan Loda
First working version of xannotate.
296
        align.show()
297
        label.show()
298
299
        align = gtk.Alignment(0.0, 0.5)
300
        self.timestamp = gtk.Label()
301
        self.timestamp.set_selectable(True)
302
        align.add(self.timestamp)
259 by Aaron Bentley
Add author support to gannotate and log viewer
303
        self.table.attach(align, 1, 2, 4, 5, gtk.EXPAND | gtk.FILL, gtk.FILL)
0.1.1 by Dan Loda
First working version of xannotate.
304
        align.show()
305
        self.timestamp.show()
306
241 by Jelmer Vernooij
Show tags in bzr viz.
307
        align = gtk.Alignment(1.0, 0.5)
308
        self.tags_label = gtk.Label()
309
        self.tags_label.set_markup("<b>Tags:</b>")
310
        align.add(self.tags_label)
311
        align.show()
261 by Aaron Bentley
Fix tags formatting
312
        self.table.attach(align, 0, 1, 5, 6, gtk.FILL, gtk.FILL)
241 by Jelmer Vernooij
Show tags in bzr viz.
313
        self.tags_label.show()
314
315
        align = gtk.Alignment(0.0, 0.5)
316
        self.tags_list = gtk.VBox()
317
        align.add(self.tags_list)
261 by Aaron Bentley
Fix tags formatting
318
        self.table.attach(align, 1, 2, 5, 6, gtk.EXPAND | gtk.FILL, gtk.FILL)
241 by Jelmer Vernooij
Show tags in bzr viz.
319
        align.show()
320
        self.tags_list.show()
321
        self.tags_widgets = []
322
0.1.1 by Dan Loda
First working version of xannotate.
323
        return self.table
324
256.2.23 by Gary van der Merwe
Show Children
325
    
291 by Jelmer Vernooij
Put children widget on a new line.
326
    def _create_parents(self):
327
        hbox = gtk.HBox(True, 3)
256.2.23 by Gary van der Merwe
Show Children
328
        
329
        self.parents_table = self._create_parents_or_children_table(
330
            "<b>Parents:</b>")
147 by Jelmer Vernooij
Remove a bunch of duplicate functionality.
331
        self.parents_widgets = []
256.2.23 by Gary van der Merwe
Show Children
332
        hbox.pack_start(self.parents_table)
291 by Jelmer Vernooij
Put children widget on a new line.
333
334
        hbox.show()
335
        return hbox
336
337
    def _create_children(self):
338
        hbox = gtk.HBox(True, 3)
339
        self.children_table = self._create_parents_or_children_table(
340
            "<b>Children:</b>")
341
        self.children_widgets = []
342
        hbox.pack_start(self.children_table)
256.2.23 by Gary van der Merwe
Show Children
343
        hbox.show()
344
        return hbox
345
        
346
    def _create_parents_or_children_table(self, text):
347
        table = gtk.Table(rows=1, columns=2)
348
        table.set_row_spacings(3)
349
        table.set_col_spacings(6)
350
        table.show()
147 by Jelmer Vernooij
Remove a bunch of duplicate functionality.
351
352
        label = gtk.Label()
256.2.23 by Gary van der Merwe
Show Children
353
        label.set_markup(text)
147 by Jelmer Vernooij
Remove a bunch of duplicate functionality.
354
        align = gtk.Alignment(0.0, 0.5)
355
        align.add(label)
256.2.23 by Gary van der Merwe
Show Children
356
        table.attach(align, 0, 1, 0, 1, gtk.FILL, gtk.FILL)
147 by Jelmer Vernooij
Remove a bunch of duplicate functionality.
357
        label.show()
358
        align.show()
359
256.2.23 by Gary van der Merwe
Show Children
360
        return table
361
    
362
147 by Jelmer Vernooij
Remove a bunch of duplicate functionality.
363
0.1.1 by Dan Loda
First working version of xannotate.
364
    def _create_message_view(self):
365
        self.message_buffer = gtk.TextBuffer()
324.2.2 by Daniel Schierbeck
Surrounded the commit message textview with a scrolled window and added a shadow.
366
        window = gtk.ScrolledWindow()
367
        window.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
368
        window.set_shadow_type(gtk.SHADOW_IN)
0.1.1 by Dan Loda
First working version of xannotate.
369
        tv = gtk.TextView(self.message_buffer)
370
        tv.set_editable(False)
371
        tv.set_wrap_mode(gtk.WRAP_WORD)
372
        tv.modify_font(pango.FontDescription("Monospace"))
373
        tv.show()
324.2.2 by Daniel Schierbeck
Surrounded the commit message textview with a scrolled window and added a shadow.
374
        window.add(tv)
375
        window.show()
376
        return window
0.1.1 by Dan Loda
First working version of xannotate.
377
399.1.1 by Daniel Schierbeck
Made the revisionview show whether a revision has been signed.
378
    def _create_signatures(self):
399.1.2 by Daniel Schierbeck
Added icon to the signature page.
379
        signature_box = gtk.Table(rows=1, columns=2)
380
        signature_box.set_col_spacing(0, 12)
381
382
        self.signature_image = gtk.Image()
383
        signature_box.attach(self.signature_image, 0, 1, 0, 1, gtk.FILL)
399.1.1 by Daniel Schierbeck
Made the revisionview show whether a revision has been signed.
384
385
        self.signature_label = gtk.Label()
399.1.2 by Daniel Schierbeck
Added icon to the signature page.
386
        signature_box.attach(self.signature_label, 1, 2, 0, 1, gtk.FILL)
387
388
        box = gtk.VBox(False, 6)
389
        box.set_border_width(6)
390
        box.pack_start(signature_box, expand=False)
391
        box.show_all()
392
        self.append_page(box, tab_label=gtk.Label("Signatures"))
399.1.1 by Daniel Schierbeck
Made the revisionview show whether a revision has been signed.
393
278.1.2 by John Arbash Meinel
Add an extra box that pops up when we have per-file information.
394
    def _create_file_info_view(self):
278.1.45 by John Arbash Meinel
Switch to a new tab for per-file messages.
395
        self.file_info_box = gtk.VBox(False, 6)
396
        self.file_info_box.set_border_width(6)
278.1.2 by John Arbash Meinel
Add an extra box that pops up when we have per-file information.
397
        self.file_info_buffer = gtk.TextBuffer()
278.1.44 by John Arbash Meinel
Merge in trunk, and update logview per-file commit messages.
398
        window = gtk.ScrolledWindow()
399
        window.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
400
        window.set_shadow_type(gtk.SHADOW_IN)
278.1.2 by John Arbash Meinel
Add an extra box that pops up when we have per-file information.
401
        tv = gtk.TextView(self.file_info_buffer)
402
        tv.set_editable(False)
403
        tv.set_wrap_mode(gtk.WRAP_WORD)
404
        tv.modify_font(pango.FontDescription("Monospace"))
405
        tv.show()
278.1.44 by John Arbash Meinel
Merge in trunk, and update logview per-file commit messages.
406
        window.add(tv)
407
        window.show()
408
        self.file_info_box.pack_start(window)
278.1.2 by John Arbash Meinel
Add an extra box that pops up when we have per-file information.
409
        self.file_info_box.hide() # Only shown when there are per-file messages
278.1.45 by John Arbash Meinel
Switch to a new tab for per-file messages.
410
        self.append_page(self.file_info_box, tab_label=gtk.Label('Per-file'))
278.1.2 by John Arbash Meinel
Add an extra box that pops up when we have per-file information.
411