mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Ensure Yes button on confirm dialog boxes is focused
Fixes #1897469 [Sort style rules focus](https://bugs.launchpad.net/calibre/+bug/1897469)
This commit is contained in:
parent
c13750458c
commit
c13f159d8c
@ -42,8 +42,10 @@ class Dialog(QDialog):
|
|||||||
|
|
||||||
if show_cancel_button:
|
if show_cancel_button:
|
||||||
buttons = QDialogButtonBox.Yes | QDialogButtonBox.No
|
buttons = QDialogButtonBox.Yes | QDialogButtonBox.No
|
||||||
|
standard_button = QDialogButtonBox.Yes
|
||||||
else:
|
else:
|
||||||
buttons = QDialogButtonBox.Ok
|
buttons = QDialogButtonBox.Ok
|
||||||
|
standard_button = QDialogButtonBox.Ok
|
||||||
self.buttonBox = bb = QDialogButtonBox(buttons, self)
|
self.buttonBox = bb = QDialogButtonBox(buttons, self)
|
||||||
bb.setObjectName("buttonBox")
|
bb.setObjectName("buttonBox")
|
||||||
bb.setFocus(Qt.OtherFocusReason)
|
bb.setFocus(Qt.OtherFocusReason)
|
||||||
@ -54,6 +56,7 @@ class Dialog(QDialog):
|
|||||||
self.config_set = config_set
|
self.config_set = config_set
|
||||||
|
|
||||||
self.resize(self.sizeHint())
|
self.resize(self.sizeHint())
|
||||||
|
bb.button(standard_button).setFocus(Qt.OtherFocusReason)
|
||||||
|
|
||||||
def toggle(self, *args):
|
def toggle(self, *args):
|
||||||
self.config_set[confirm_config_name(self.name)] = self.again.isChecked()
|
self.config_set[confirm_config_name(self.name)] = self.again.isChecked()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user