[qt4] display "maxfilesize" config entry on big file

Closes #109863

How to test

hg --config hgview.maxfilesize=1 qv -I qt

You shall see the value of the hgview.maxfilesize configuration parameter in the message that warns you about the fact that the file is too big to be displayed.

authorAlain Leufroy <alain@leufroy.fr>
changesetbbe663f29703
branchdefault
phasepublic
hiddenno
parent revision#6d885ff70a87 [qt4] hide text area on heavy file
child revision#4d5b7d96cfc1 [qt4] center the "File too big" message
files modified by this revision
hgviewlib/qt4/hgfileview.py
# HG changeset patch
# User Alain Leufroy <alain@leufroy.fr>
# Date 1370649115 -7200
# Sat Jun 08 01:51:55 2013 +0200
# Node ID bbe663f29703a8d3061edf749299890a6489cd65
# Parent 6d885ff70a874cae810fa8479bc0151b519bc319
[qt4] display "maxfilesize" config entry on big file

Closes #109863

.. admonition:: How to test

::

hg --config hgview.maxfilesize=1 qv -I qt

You shall see the value of the ``hgview.maxfilesize`` configuration
parameter in the message that warns you about the fact that the
file is too big to be displayed.

diff --git a/hgviewlib/qt4/hgfileview.py b/hgviewlib/qt4/hgfileview.py
@@ -369,15 +369,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