Improve crash dialog
This commit is contained in:
parent
7cde8f00cb
commit
89738bce7d
@ -8,6 +8,7 @@ MONOSPACE -- A list of suitable monospace fonts.
|
|||||||
|
|
||||||
import os.path
|
import os.path
|
||||||
import os
|
import os
|
||||||
|
import io
|
||||||
import logging
|
import logging
|
||||||
from configparser import ConfigParser
|
from configparser import ConfigParser
|
||||||
|
|
||||||
@ -186,3 +187,11 @@ class Config(ConfigParser):
|
|||||||
logging.debug("Saving config to {}".format(self.configfile))
|
logging.debug("Saving config to {}".format(self.configfile))
|
||||||
with open(self.configfile, 'w') as f:
|
with open(self.configfile, 'w') as f:
|
||||||
self.write(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()
|
||||||
|
@ -22,9 +22,8 @@ class CrashDialog(QDialog):
|
|||||||
lbl.setText(
|
lbl.setText(
|
||||||
'Argh! qutebrowser crashed unexpectedly.<br/>'
|
'Argh! qutebrowser crashed unexpectedly.<br/>'
|
||||||
'Please review the info below to remove sensitive data and then '
|
'Please review the info below to remove sensitive data and then '
|
||||||
'submit it to '
|
'submit it to <a href="mailto:crash@qutebrowser.org">'
|
||||||
'<a href="mailto:qutebrowser@the-compiler.org">'
|
'crash@qutebrowser.org</a>.<br/><br/>'
|
||||||
'qutebrowser@the-compiler.org</a>.<br/><br/>'
|
|
||||||
'You can click "Restore tabs" to attempt to reopen your '
|
'You can click "Restore tabs" to attempt to reopen your '
|
||||||
'open tabs.'
|
'open tabs.'
|
||||||
)
|
)
|
||||||
@ -39,7 +38,10 @@ class CrashDialog(QDialog):
|
|||||||
''.join(traceback.format_exception(*exc))) +
|
''.join(traceback.format_exception(*exc))) +
|
||||||
'==== Open pages ====\n{}\n\n'.format('\n'.join(pages)) +
|
'==== Open pages ====\n{}\n\n'.format('\n'.join(pages)) +
|
||||||
'==== Command history ====\n{}\n\n'.format('\n'.join(cmdhist)) +
|
'==== 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)
|
vbox.addWidget(txt)
|
||||||
self.setLayout(vbox)
|
self.setLayout(vbox)
|
||||||
|
Loading…
Reference in New Issue
Block a user