Sketcher: Change constraint-conversion MessageBox to DlgCheckableMessageBox

This commit is contained in:
David Osterberg
2021-02-10 21:25:35 +01:00
committed by Abdullah Tahiri
parent 9c8685c20c
commit d759a8e43d

View File

@@ -41,6 +41,7 @@
#include <Gui/DlgEditFileIncludePropertyExternal.h>
#include <Gui/Action.h>
#include <Gui/BitmapFactory.h>
#include <Gui/DlgCheckableMessageBox.h>
#include <Mod/Part/App/Geometry.h>
#include <Mod/Sketcher/App/SketchObject.h>
@@ -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;