From 15718f68a93393d62d57f708d16d75daf7a9b4d4 Mon Sep 17 00:00:00 2001 From: Lucas Brown <54835354+imlucasbrown@users.noreply.github.com> Date: Fri, 15 Nov 2024 08:57:15 -0600 Subject: [PATCH] fixed QMessageBox button logic --- nxt_editor/dialogs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nxt_editor/dialogs.py b/nxt_editor/dialogs.py index 998edaa..b47bb9d 100644 --- a/nxt_editor/dialogs.py +++ b/nxt_editor/dialogs.py @@ -373,14 +373,16 @@ def show_message(cls, text, info, details=None): class NxtConfirmDialog(QtWidgets.QMessageBox): + Ok = QtWidgets.QMessageBox.StandardButton.Ok + Cancel = QtWidgets.QMessageBox.StandardButton.Cancel def __init__(self, text='Title', info='Confirm something!', button_text=None, icon=QtWidgets.QMessageBox.Icon.Question): """Simple message box used for user confirmation :param text: Title text :param info: Main info text :param button_text: Custom button text dict: - {QtWidgets.QMessageBox.Ok: 'Custom Ok Text', - QtWidgets.QMessageBox.Cancel: 'Custom Cancel Text'} + {QtWidgets.QMessageBox.StandardButton.Ok: 'Custom Ok Text', + QtWidgets.QMessageBox.StandardButton.Cancel: 'Custom Cancel Text'} """ super(NxtConfirmDialog, self).__init__() self.setText(text)