Allow pressing Alt+O as a shortcut for click the OK button in the Add from ISBN dialog. Fixes #1578692 [[Enhancement] Shortcut for OK button in 'Add Books by ISBN' dialog](https://bugs.launchpad.net/calibre/+bug/1578692)

This commit is contained in:
Kovid Goyal 2016-05-14 10:42:40 +05:30
parent 05cf32cbfd
commit ce17f4a95b

View File

@ -9,7 +9,7 @@ import os
from PyQt5.Qt import (
QDialog, QApplication, QIcon, QVBoxLayout, QHBoxLayout, QDialogButtonBox,
QPlainTextEdit, QPushButton, QLabel, QLineEdit
QPlainTextEdit, QPushButton, QLabel, QLineEdit, Qt, QKeySequence
)
from calibre.ebooks.metadata import check_isbn
@ -40,6 +40,7 @@ class AddFromISBN(QDialog):
self.h = h = QHBoxLayout()
l.addLayout(h)
self.bb = bb = QDialogButtonBox(QDialogButtonBox.Ok|QDialogButtonBox.Cancel, self)
bb.button(bb.Ok).setShortcut(QKeySequence(Qt.Key_O | Qt.ALT))
l.addWidget(bb), bb.accepted.connect(self.accept), bb.rejected.connect(self.reject)
self.ll = l = QVBoxLayout()
h.addLayout(l)