Improve crash dialog

This commit is contained in:
Florian Bruhin 2014-01-31 10:24:00 +01:00
parent 7cde8f00cb
commit 89738bce7d
2 changed files with 15 additions and 4 deletions

View File

@ -8,6 +8,7 @@ MONOSPACE -- A list of suitable monospace fonts.
import os.path
import os
import io
import logging
from configparser import ConfigParser
@ -186,3 +187,11 @@ class Config(ConfigParser):
logging.debug("Saving config to {}".format(self.configfile))
with open(self.configfile, 'w') as f:
self.write(f)
def dump_userconfig(self):
"""Returns the part of the config which was changed by the user as a
string.
"""
with io.StringIO() as f:
self.write(f)
return f.getvalue()

View File

@ -22,9 +22,8 @@ class CrashDialog(QDialog):
lbl.setText(
'Argh! qutebrowser crashed unexpectedly.<br/>'
'Please review the info below to remove sensitive data and then '
'submit it to '
'<a href="mailto:qutebrowser@the-compiler.org">'
'qutebrowser@the-compiler.org</a>.<br/><br/>'
'submit it to <a href="mailto:crash@qutebrowser.org">'
'crash@qutebrowser.org</a>.<br/><br/>'
'You can click "Restore tabs" to attempt to reopen your '
'open tabs.'
)
@ -39,7 +38,10 @@ class CrashDialog(QDialog):
''.join(traceback.format_exception(*exc))) +
'==== Open pages ====\n{}\n\n'.format('\n'.join(pages)) +
'==== Command history ====\n{}\n\n'.format('\n'.join(cmdhist)) +
'==== Commandline args ====\n{}'.format(' '.join(sys.argv[1:]))
'==== Commandline args ====\n{}\n\n'.format(
' '.join(sys.argv[1:])) +
'==== Config ====\n{}'.format(
utils.config.config.dump_userconfig())
)
vbox.addWidget(txt)
self.setLayout(vbox)