From d759a8e43d607442250b26efae70abda582a1007 Mon Sep 17 00:00:00 2001 From: David Osterberg Date: Wed, 10 Feb 2021 21:25:35 +0100 Subject: [PATCH] Sketcher: Change constraint-conversion MessageBox to DlgCheckableMessageBox --- src/Mod/Sketcher/Gui/CommandConstraints.cpp | 23 +++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index d63db8a157..c39f630414 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -2165,8 +2166,15 @@ void CmdSketcherConstrainCoincident::activated(int iMsg) ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher/General"); if(hGrp->GetBool("NotifyConstraintSubstitutions", true)) { - QMessageBox::information(Gui::getMainWindow(), QObject::tr("Constraint Substitution"), - QObject::tr("Endpoint to endpoint tangency was applied instead.")); + auto hChecked = App::GetApplication().GetParameterGroupByPath( QByteArray("User parameter:BaseApp/CheckMessages")); + hChecked->SetBool("Sketcher_Constraint_Substitution", false); + Gui::Dialog::DlgCheckableMessageBox::showMessage( + QObject::tr("Sketcher Constraint Substitution"), + QObject::tr("Endpoint to endpoint tangency was applied instead."), + false, + QObject::tr("Don't tell me again") + ); + hGrp->SetBool("NotifyConstraintSubstitutions", !hChecked->GetBool("Sketcher_Constraint_Substitution", true)); } getSelection().clearSelection(); @@ -4327,8 +4335,15 @@ void CmdSketcherConstrainTangent::activated(int iMsg) ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher/General"); if(hGrp->GetBool("NotifyConstraintSubstitutions", true)) { - QMessageBox::information(Gui::getMainWindow(), QObject::tr("Constraint Substitution"), - QObject::tr("Endpoint to endpoint tangency was applied. The coincident constraint was deleted.")); + auto hChecked = App::GetApplication().GetParameterGroupByPath( QByteArray("User parameter:BaseApp/CheckMessages")); + hChecked->SetBool("Sketcher_Constraint_Substitution", false); + Gui::Dialog::DlgCheckableMessageBox::showMessage( + QObject::tr("Sketcher Constraint Substitution"), + QObject::tr("Endpoint to endpoint tangency was applied instead."), + false, + QObject::tr("Don't tell me again") + ); + hGrp->SetBool("NotifyConstraintSubstitutions", !hChecked->GetBool("Sketcher_Constraint_Substitution", true)); } getSelection().clearSelection(); return;