Sketcher: Setting in Preferences to switch on/off notification of constraint substitution

=========================================================================================

By default notification is on, so that Newbies do not complain why FC is deleting that other constraint they have added before.

Power users generally will set it off, as they do not want to be bothered by pop ups and know what they are doing.
This commit is contained in:
Abdullah Tahiri
2018-01-25 16:33:31 +01:00
committed by wmayer
parent 8d3c20f06e
commit e9732b4b0a
3 changed files with 68 additions and 4 deletions

View File

@@ -2339,8 +2339,12 @@ void CmdSketcherConstrainCoincident::activated(int iMsg)
commitCommand();
tryAutoRecomputeIfNotSolve(Obj);
QMessageBox::information(Gui::getMainWindow(), QObject::tr("Constraint Substitution"),
QObject::tr("Endpoint to endpoint tangency was applied instead."));
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."));
}
getSelection().clearSelection();
return;
@@ -4561,9 +4565,12 @@ void CmdSketcherConstrainTangent::activated(int iMsg)
commitCommand();
tryAutoRecomputeIfNotSolve(Obj);
QMessageBox::information(Gui::getMainWindow(), QObject::tr("Constraint Substitution"),
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."));
}
getSelection().clearSelection();
return;
}

View File

@@ -106,6 +106,7 @@ void SketcherSettings::saveSettings()
ui->checkBoxTVShowLinks->onSave();
ui->checkBoxTVShowSupport->onSave();
ui->checkBoxTVRestoreCamera->onSave();
ui->checkBoxNotifyConstraintSubstitutions->onSave();
form->saveSettings();
ParameterGrp::handle hViewGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
@@ -132,6 +133,7 @@ void SketcherSettings::loadSettings()
ui->checkBoxTVShowLinks->onRestore();
ui->checkBoxTVShowSupport->onRestore();
ui->checkBoxTVRestoreCamera->onRestore();
ui->checkBoxNotifyConstraintSubstitutions->onRestore();
form->loadSettings();
std::list<int> sizes = Gui::Inventor::MarkerBitmaps::getSupportedSizes("CIRCLE_FILLED");

View File

@@ -280,6 +280,61 @@
</layout>
</widget>
</item>
<item row="8" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox_5">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>Notifications</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_22">
<item>
<widget class="Gui::PrefCheckBox" name="checkBoxNotifyConstraintSubstitutions">
<property name="toolTip">
<string>Notify automatic constraint substitutions.</string>
</property>
<property name="text">
<string>Notify automatic constraint substitutions</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>NotifyConstraintSubstitutions</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Sketcher/General</cstring>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_10">
<property name="text">