mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
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:
parent
05cf32cbfd
commit
ce17f4a95b
@ -9,7 +9,7 @@ import os
|
|||||||
|
|
||||||
from PyQt5.Qt import (
|
from PyQt5.Qt import (
|
||||||
QDialog, QApplication, QIcon, QVBoxLayout, QHBoxLayout, QDialogButtonBox,
|
QDialog, QApplication, QIcon, QVBoxLayout, QHBoxLayout, QDialogButtonBox,
|
||||||
QPlainTextEdit, QPushButton, QLabel, QLineEdit
|
QPlainTextEdit, QPushButton, QLabel, QLineEdit, Qt, QKeySequence
|
||||||
)
|
)
|
||||||
|
|
||||||
from calibre.ebooks.metadata import check_isbn
|
from calibre.ebooks.metadata import check_isbn
|
||||||
@ -40,6 +40,7 @@ class AddFromISBN(QDialog):
|
|||||||
self.h = h = QHBoxLayout()
|
self.h = h = QHBoxLayout()
|
||||||
l.addLayout(h)
|
l.addLayout(h)
|
||||||
self.bb = bb = QDialogButtonBox(QDialogButtonBox.Ok|QDialogButtonBox.Cancel, self)
|
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)
|
l.addWidget(bb), bb.accepted.connect(self.accept), bb.rejected.connect(self.reject)
|
||||||
self.ll = l = QVBoxLayout()
|
self.ll = l = QVBoxLayout()
|
||||||
h.addLayout(l)
|
h.addLayout(l)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user