From 12838cfe843e79dfe243dbd44ab62be6b9be4bce Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 19 Oct 2014 09:57:27 +0530 Subject: [PATCH] Metadata downloaded dialog: Prevent pressing the Enter/Spacebar keys from closing the dialog. Fixes #1382795 [Feature Request - Metadata download without "Download complete" dialog](https://bugs.launchpad.net/calibre/+bug/1382795) --- src/calibre/gui2/proceed.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/calibre/gui2/proceed.py b/src/calibre/gui2/proceed.py index bf51483bd1..65b5926f1d 100644 --- a/src/calibre/gui2/proceed.py +++ b/src/calibre/gui2/proceed.py @@ -76,6 +76,15 @@ class ProceedQuestion(QDialog): self.ask_question.connect(self.do_ask_question, type=Qt.QueuedConnection) + for button in self.bb.buttons(): + button.installEventFilter(self) + self.installEventFilter(self) # For Return key presses that close the dialog + + def eventFilter(self, obj, ev): + if ev.type() in (ev.KeyPress, ev.KeyRelease) and ev.key() in (Qt.Key_Enter, Qt.Key_Space, Qt.Key_Return): + ev.ignore() + return True + return False def copy_to_clipboard(self, *args): QApplication.clipboard().setText(