From ec75382a6d23b6be2b0747fd98c9af19e4d763bc Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 15 May 2014 10:54:24 +0200 Subject: [PATCH] Allow text in crash dialog to be copied --- qutebrowser/widgets/crash.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/qutebrowser/widgets/crash.py b/qutebrowser/widgets/crash.py index 608755558..983a9f810 100644 --- a/qutebrowser/widgets/crash.py +++ b/qutebrowser/widgets/crash.py @@ -71,6 +71,7 @@ class CrashDialog(QDialog): "open tabs.") self._lbl.setText(text) self._lbl.setWordWrap(True) + self._set_text_flags(self._lbl) self._vbox.addWidget(self._lbl) self._txt = QTextEdit() @@ -79,10 +80,7 @@ class CrashDialog(QDialog): self._vbox.addWidget(self._txt) self._url = QLabel() - self._url.setTextInteractionFlags(Qt.TextSelectableByMouse | - Qt.TextSelectableByKeyboard | - Qt.LinksAccessibleByMouse | - Qt.LinksAccessibleByKeyboard) + self._set_text_flags(self._url) self._vbox.addWidget(self._url) self._hbox = QHBoxLayout() @@ -104,6 +102,17 @@ class CrashDialog(QDialog): self._vbox.addLayout(self._hbox) + def _set_text_flags(self, obj): + """Set text interaction flags of a widget to allow link clicking. + + Args: + obj: A QLabel. + """ + obj.setTextInteractionFlags(Qt.TextSelectableByMouse | + Qt.TextSelectableByKeyboard | + Qt.LinksAccessibleByMouse | + Qt.LinksAccessibleByKeyboard) + def _crash_info(self, pages, cmdhist, exc): """Gather crash information to display.