mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Allow specifying default dialog buttons
This commit is contained in:
parent
62a092fd57
commit
cb45bbe591
@ -172,12 +172,16 @@ class Dialog(QDialog):
|
||||
for the first time.
|
||||
'''
|
||||
|
||||
def __init__(self, title, name, parent=None, prefs=gprefs):
|
||||
def __init__(
|
||||
self, title,
|
||||
name, parent=None, prefs=gprefs,
|
||||
default_buttons=QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel
|
||||
):
|
||||
QDialog.__init__(self, parent)
|
||||
self.prefs_for_persistence = prefs
|
||||
self.setWindowTitle(title)
|
||||
self.name = name
|
||||
self.bb = QDialogButtonBox(QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel)
|
||||
self.bb = QDialogButtonBox(default_buttons)
|
||||
self.bb.accepted.connect(self.accept)
|
||||
self.bb.rejected.connect(self.reject)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user