Skip to content

Commit

Permalink
Save report dialog contact infomation.
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Compiler committed Feb 11, 2015
1 parent 8011a3c commit 302929b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion qutebrowser/misc/crashdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,16 @@ def __init__(self, debug, parent=None):
contact = QLabel("How can I contact you if I need more info?")
self._vbox.addWidget(contact)
self._contact = QTextEdit(tabChangesFocus=True, acceptRichText=False)
self._contact.setPlaceholderText("Github username, mail or IRC")
try:
state = objreg.get('state-config')
try:
self._contact.setPlainText(state['general']['contact-info'])
except KeyError:
self._contact.setPlaceholderText("Github username, mail or "
"IRC")
except Exception:
log.misc.exception("Failed to get contact information!")
self._contact.setPlaceholderText("Github username, mail or IRC")
self._vbox.addWidget(self._contact, 2)

self._vbox.addSpacing(15)
Expand Down Expand Up @@ -229,6 +238,11 @@ def show_error(self, text):
@pyqtSlot()
def finish(self):
"""Accept/reject the dialog when reporting is done."""
try:
state = objreg.get('state-config')
state['general']['contact-info'] = self._contact.toPlainText()
except Exception:
log.misc.exception("Failed to save contact information!")
if self._resolution:
self.accept()
else:
Expand Down

0 comments on commit 302929b

Please sign in to comment.