Skip to content

Commit

Permalink
fixed QMessageBox button logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ImLucasBrown committed Nov 15, 2024
1 parent 5c4210b commit 15718f6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nxt_editor/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 15718f6

Please sign in to comment.