Colorize statistic output in GUI.

This commit is contained in:
Bastian Kleineidam 2011-04-28 15:32:53 +02:00
parent 6ca10152c5
commit 0fc3355066
2 changed files with 7 additions and 0 deletions

View file

@ -10,6 +10,7 @@ Changes:
Features:
- gui: Add syntax highlighting for Qt editor in case QScintilla
is not installed.
- gui: Colorize number of errors in output statistics.
6.8 "Ghost in the shell" (released 26.4.2011)

View file

@ -24,6 +24,12 @@ def set_statistics (widget, statistics):
widget.stats_url_maxlen.setText(u"%d" % statistics.max_url_length)
widget.stats_url_avglen.setText(u"%d" % statistics.avg_url_length)
widget.stats_valid_urls.setText(u"%d" % (statistics.number - statistics.errors))
if statistics.errors > 0:
color = '#aa0000'
else:
color = '#00aa00'
style = "QLabel {font-weight:bold; color:%s;}" % color
widget.stats_invalid_urls.setStyleSheet(style)
widget.stats_invalid_urls.setText(u"%d" % statistics.errors)
widget.stats_warnings.setText(u"%d" % statistics.warnings)
for key, value in statistics.link_types.items():