[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>
changesetee2c0d7d1e05
branchdefault
phasedraft
hiddenyes
parent revision#18efa4102cd2 [qt4] hide text area on heavy file
child revision<not specified>
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 ee2c0d7d1e057c7f74eeb0fa2a1a0756f899968b
# Parent 18efa4102cd2d69a5c8f59909d75abaea247c92e
[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
@@ -377,15 +377,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