diff --git a/Furious/QtFramework/QtWidgets.py b/Furious/QtFramework/QtWidgets.py index f19480b..5ab43f3 100644 --- a/Furious/QtFramework/QtWidgets.py +++ b/Furious/QtFramework/QtWidgets.py @@ -50,6 +50,7 @@ __all__ = [ 'AppQToolBar', 'QuestionDeleteMBox', 'NewChangesNextTimeMBox', + 'showNewChangesNextTimeMBox', ] needTrans = functools.partial(needTransFn, source=__name__) @@ -592,3 +593,21 @@ class NewChangesNextTimeMBox(AppQMessageBox): self.setIcon(AppQMessageBox.Icon.Information) self.setText(_('New changes will take effect next time')) + + +def showNewChangesNextTimeMBox(**kwargs): + try: + if APP().isSystemTrayConnected(): + mbox = NewChangesNextTimeMBox(**kwargs) + + if isinstance(mbox.parent(), QMainWindow): + mbox.setWindowModality(QtCore.Qt.WindowModality.WindowModal) + else: + mbox.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal) + + # Show the MessageBox asynchronously + mbox.open() + except Exception: + # Any non-exit exceptions + + pass