mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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)
This commit is contained in:
parent
af6c66106d
commit
12838cfe84
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user