From 40e391e199af6c2a7c8be400c5c444682715baa2 Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Wed, 23 May 2018 21:25:43 -0700 Subject: [PATCH 1/2] Prevent closing :report dialog when pressing --- qutebrowser/misc/crashdialog.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qutebrowser/misc/crashdialog.py b/qutebrowser/misc/crashdialog.py index 85fdf33bf..981424e6b 100644 --- a/qutebrowser/misc/crashdialog.py +++ b/qutebrowser/misc/crashdialog.py @@ -158,6 +158,11 @@ class _CrashDialog(QDialog): self._init_info_text() self._init_buttons() + # Prevent closing :report dialogs when pressing + def keyPressEvent(self, e): + if e.key() != Qt.Key_Escape: + super().keyPressEvent(e) + def __repr__(self): return utils.get_repr(self) From cd56b97e7da5dd541edd94b4ac7d3bfd439dc547 Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Thu, 24 May 2018 11:49:18 -0700 Subject: [PATCH 2/2] Add an option to disable escape in the report dialog --- qutebrowser/config/configdata.yml | 7 +++++++ qutebrowser/misc/crashdialog.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index 1784e4b7d..ef0088366 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -2179,6 +2179,13 @@ fonts.web.size.minimum_logical: maxval: maxint desc: Minimum logical font size (in pixels) that is applied when zooming out. +## reporter + +reporter.escape_quits: + type: Bool + default: True + desc: Allow escape to quit the crash reporter. + ## keybindings bindings.key_mappings: diff --git a/qutebrowser/misc/crashdialog.py b/qutebrowser/misc/crashdialog.py index 981424e6b..372657f7a 100644 --- a/qutebrowser/misc/crashdialog.py +++ b/qutebrowser/misc/crashdialog.py @@ -160,7 +160,7 @@ class _CrashDialog(QDialog): # Prevent closing :report dialogs when pressing def keyPressEvent(self, e): - if e.key() != Qt.Key_Escape: + if config.val.reporter.escape_quits or e.key() != Qt.Key_Escape: super().keyPressEvent(e) def __repr__(self):