[qt4] display "maxfilesize" config entry on big file (closes #109863)

authorAlain Leufroy <alain@leufroy.fr>
changeset4caf8e2c1896
branchdefault
phasedraft
hiddenyes
parent revision#444ca8f53ae5 [qt4] make pylint a little happier
child revision#d5f8659c72c6 [qt4] enable Ctrl-Q even if the window toolbar is hidden (closes #109856)
files modified by this revision
hgviewlib/qt4/hgfileview.py
# HG changeset patch
# User Alain Leufroy <alain@leufroy.fr>
# Date 1368251960 -7200
# Sat May 11 07:59:20 2013 +0200
# Node ID 4caf8e2c1896ecef8f40f8c0be55f7dfc74d0789
# Parent 444ca8f53ae544011ecdd2b17af1de04a81b4afd
[qt4] display "maxfilesize" config entry on big file (closes #109863)

diff --git a/hgviewlib/qt4/hgfileview.py b/hgviewlib/qt4/hgfileview.py
@@ -372,15 +372,18 @@
1          else:
2              flag, data = self._model.graph.filedata(filename, self._ctx.rev(), mode)
3          if flag == 'file too big':
4              self.filedata_frame.hide()
5              self.filenamelabel.setText(
6 -                '%s %s' %
7 -                (data,
8 -                 ('<a href="show-big-file">Click to display anyway '
9 -                  '<img src=":/icons/heavy_small.png" '
10 -                  'width="16" height="16">.</a>')))
11 +                '%s<br>%s<br>%s' % (
12 +                    data,
13 +                    ('Config value: <font color="red"> maxfilesize=%i</font>' %
14 +                     self.cfg.getMaxFileSize()),
15 +                    ('<a href="show-big-file">Click to display anyway '
16 +                     '<img src=":/icons/heavy_small.png" '
17 +                     'width="16" height="16">.</a>')
18 +            ))
19              return
20          else:
21              self.filedata_frame.show()
22          if flag == '-':
23              return