diff --git a/qutebrowser/config/configfiles.py b/qutebrowser/config/configfiles.py index 878e49443..093ad4aee 100644 --- a/qutebrowser/config/configfiles.py +++ b/qutebrowser/config/configfiles.py @@ -31,7 +31,7 @@ from PyQt5.QtCore import QSettings import qutebrowser from qutebrowser.config import configexc -from qutebrowser.utils import objreg, standarddir, utils, qtutils +from qutebrowser.utils import standarddir, utils, qtutils # The StateConfig instance diff --git a/qutebrowser/misc/crashdialog.py b/qutebrowser/misc/crashdialog.py index 4d64faabc..9efb0b7f2 100644 --- a/qutebrowser/misc/crashdialog.py +++ b/qutebrowser/misc/crashdialog.py @@ -152,23 +152,7 @@ class _CrashDialog(QDialog): self._pypi_client = autoupdate.PyPIVersionClient(self) self._init_text() - contact = QLabel("I'd like to be able to follow up with you, to keep " - "you posted on the status of this crash and get more " - "information if I need it - how can I contact you?", - wordWrap=True) - self._vbox.addWidget(contact) - self._contact = QTextEdit(tabChangesFocus=True, acceptRichText=False) - try: - try: - info = configfiles.state['general']['contact-info'] - except KeyError: - self._contact.setPlaceholderText("Mail or IRC nickname") - else: - self._contact.setPlainText(info) - except Exception: - log.misc.exception("Failed to get contact information!") - self._contact.setPlaceholderText("Mail or IRC nickname") - self._vbox.addWidget(self._contact, 2) + self._init_contact_input() info = QLabel("What were you doing when this crash/bug happened?") self._vbox.addWidget(info) @@ -202,6 +186,26 @@ class _CrashDialog(QDialog): def __repr__(self): return utils.get_repr(self) + def _init_contact_input(self): + """Initialize the widget asking for contact info.""" + contact = QLabel("I'd like to be able to follow up with you, to keep " + "you posted on the status of this crash and get more " + "information if I need it - how can I contact you?", + wordWrap=True) + self._vbox.addWidget(contact) + self._contact = QTextEdit(tabChangesFocus=True, acceptRichText=False) + try: + try: + info = configfiles.state['general']['contact-info'] + except KeyError: + self._contact.setPlaceholderText("Mail or IRC nickname") + else: + self._contact.setPlainText(info) + except Exception: + log.misc.exception("Failed to get contact information!") + self._contact.setPlaceholderText("Mail or IRC nickname") + self._vbox.addWidget(self._contact, 2) + def _init_text(self): """Initialize the main text to be displayed on an exception. diff --git a/tests/unit/config/test_configfiles.py b/tests/unit/config/test_configfiles.py index 2732585a3..73b091293 100644 --- a/tests/unit/config/test_configfiles.py +++ b/tests/unit/config/test_configfiles.py @@ -24,7 +24,6 @@ import sys import pytest from qutebrowser.config import config, configfiles, configexc -from qutebrowser.utils import objreg from PyQt5.QtCore import QSettings