Improved internal error display in the GUI.

This commit is contained in:
Bastian Kleineidam 2011-04-04 19:29:13 +02:00
parent 520b417855
commit 9f205b9b73
5 changed files with 20 additions and 12 deletions

View file

@ -4,6 +4,9 @@ Fixes:
- gui: Fix display of warnings in property pane.
Closes: SF bug #3263974
Changes:
- gui: Improved display of internal errors.
Features:
- gui: Added CSV output type for results.

View file

@ -19,19 +19,18 @@
Check HTML pages for broken links. This is the GUI client.
"""
import sys
from PyQt4.QtGui import QApplication, QStyleFactory, QErrorMessage
from PyQt4.QtGui import QApplication, QStyleFactory, QMessageBox
from linkcheck.gui import LinkCheckerMain
from linkcheck import configuration, drop_privileges, i18n
def excepthook (debugwidget, etype, evalue, tb):
def excepthook (parent, etype, evalue, tb):
"""Catch unhandled exceptions."""
from cStringIO import StringIO
from PyQt4.QtCore import qWarning
from linkcheck.director.console import internal_error
out = i18n.get_encoded_writer(out=StringIO(), encoding="utf-8")
internal_error(out=out, etype=etype, evalue=evalue, tb=tb)
print >> out, debugwidget.getText()
qWarning(out.getvalue())
QMessageBox.warning(parent, _(u"LinkChecker internal error"),
out.getvalue())
## Look and feel with stylesheets
# In Cleanlooks the progress bar text is outside the bar.
@ -55,10 +54,8 @@ def main (argv=None):
window = LinkCheckerMain(url=url)
window.show()
drop_privileges()
handler = QErrorMessage.qtHandler()
handler.setMinimumSize(600, 400)
sys.excepthook = \
lambda etype, evalue, tb: excepthook(window.debug, etype, evalue, tb)
lambda etype, evalue, tb: excepthook(window, etype, evalue, tb)
sys.exit(app.exec_())

View file

@ -2,7 +2,7 @@ XGETTEXT := xgettext
MSGFMT := msgfmt
MSGMERGE := msgmerge
POSOURCES = $(shell find ../linkcheck -name \*.py) \
../linkchecker /usr/lib/python2.6/optparse.py
../linkchecker ../linkchecker-gui /usr/lib/python2.6/optparse.py
LDIR = ../share/locale
PACKAGE = linkchecker
TEMPLATE = $(PACKAGE).pot

View file

@ -5,8 +5,8 @@ msgid ""
msgstr ""
"Project-Id-Version: $Id$\n"
"Report-Msgid-Bugs-To: calvin@users.sourceforge.net\n"
"POT-Creation-Date: 2011-04-04 18:56+0200\n"
"PO-Revision-Date: 2011-04-04 18:57+0100\n"
"POT-Creation-Date: 2011-04-04 19:26+0200\n"
"PO-Revision-Date: 2011-04-04 19:27+0100\n"
"Last-Translator: Bastian Kleineidam <calvin@users.sourceforge.net>\n"
"Language-Team: de <de@li.org>\n"
"Language: \n"
@ -2206,6 +2206,10 @@ msgstr "Abgebrochen."
msgid "The `profile' Python module is not installed, therefore the --profile option is disabled."
msgstr "Das `profile' Python Modul ist nicht installiert, deshalb ist die --profile Option deaktiviert."
#: ../linkchecker-gui:32
msgid "LinkChecker internal error"
msgstr "LinkChecker interner Fehler"
#: /usr/lib/python2.6/optparse.py:140
#, python-format
msgid "no such option: %s"

View file

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: calvin@users.sourceforge.net\n"
"POT-Creation-Date: 2011-04-04 18:56+0200\n"
"POT-Creation-Date: 2011-04-04 19:26+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -1991,6 +1991,10 @@ msgid ""
"is disabled."
msgstr ""
#: ../linkchecker-gui:32
msgid "LinkChecker internal error"
msgstr ""
#: /usr/lib/python2.6/optparse.py:140
#, python-format
msgid "no such option: %s"