More stupid PyQt enums

This commit is contained in:
Kovid Goyal 2020-12-19 10:30:01 +05:30
parent 1da8c3522e
commit 7ccde5ff0f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 3 additions and 3 deletions

View File

@ -336,7 +336,7 @@ class Report(QDialog): # {{{
bb.rejected.connect(self.reject)
b = self.log_button = bb.addButton(_('View full &log'), QDialogButtonBox.ButtonRole.ActionRole)
b.clicked.connect(self.view_log)
bb.button(bb.Close).setDefault(True)
bb.button(QDialogButtonBox.StandardButton.Close).setDefault(True)
l.addWidget(bb, 2, 1)
self.finished.connect(self.show_next, type=Qt.ConnectionType.QueuedConnection)

View File

@ -583,7 +583,7 @@ class CustomRecipes(Dialog):
bb = self.bb
bb.clear()
if index == 0:
bb.setStandardButtons(bb.Close)
bb.setStandardButtons(QDialogButtonBox.StandardButton.Close)
for icon, text, tooltip, receiver in self.list_actions:
b = bb.addButton(text, QDialogButtonBox.ButtonRole.ActionRole)
b.setIcon(QIcon(I(icon))), b.setToolTip(tooltip)

View File

@ -368,7 +368,7 @@ def show_config_widget(category, name, gui=None, show_restart_msg=False,
bb.button(QDialogButtonBox.StandardButton.Apply).clicked.connect(d.accept)
def onchange():
b = bb.button(bb.Apply)
b = bb.button(QDialogButtonBox.StandardButton.Apply)
b.setEnabled(True)
b.setDefault(True)
b.setAutoDefault(True)