diff --git a/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp b/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp index 06ae22a669..4e6fdc7dc8 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp +++ b/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp @@ -157,6 +157,22 @@ public: default: break; } + + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); + bool extended = hGrp->GetBool("ExtendedConstraintInformation",false); + + if(extended) { + if(constraint->Second == Sketcher::Constraint::GeoUndef) { + name = QString::fromLatin1("%1 [(%2,%3)]").arg(name).arg(constraint->First).arg(constraint->FirstPos); + } + else if(constraint->Third == Sketcher::Constraint::GeoUndef) { + name = QString::fromLatin1("%1 [(%2,%3),(%4,%5)]").arg(name).arg(constraint->First).arg(constraint->FirstPos).arg(constraint->Second).arg(constraint->SecondPos); + } + else { + name = QString::fromLatin1("%1 [(%2,%3),(%4,%5),(%6,%7)]").arg(name).arg(constraint->First).arg(constraint->FirstPos).arg(constraint->Second).arg(constraint->SecondPos).arg(constraint->Third).arg(constraint->ThirdPos); + } + } + return name; } else if (role == Qt::DecorationRole) { @@ -594,7 +610,11 @@ TaskSketcherConstrains::TaskSketcherConstrains(ViewProviderSketch *sketchView) QObject::connect( ui->filterInternalAlignment, SIGNAL(stateChanged(int)), this , SLOT (on_filterInternalAlignment_stateChanged(int)) - ); + ); + QObject::connect( + ui->extendedInformation, SIGNAL(stateChanged(int)), + this , SLOT (on_extendedInformation_stateChanged(int)) + ); connectionConstraintsChanged = sketchView->signalConstraintsChanged.connect( boost::bind(&SketcherGui::TaskSketcherConstrains::slotConstraintsChanged, this)); @@ -602,6 +622,7 @@ TaskSketcherConstrains::TaskSketcherConstrains(ViewProviderSketch *sketchView) this->groupLayout()->addWidget(proxy); this->ui->filterInternalAlignment->onRestore(); + this->ui->extendedInformation->onRestore(); slotConstraintsChanged(); } @@ -609,6 +630,7 @@ TaskSketcherConstrains::TaskSketcherConstrains(ViewProviderSketch *sketchView) TaskSketcherConstrains::~TaskSketcherConstrains() { this->ui->filterInternalAlignment->onSave(); + this->ui->extendedInformation->onSave(); connectionConstraintsChanged.disconnect(); delete ui; } @@ -667,6 +689,13 @@ void TaskSketcherConstrains::on_filterInternalAlignment_stateChanged(int state) slotConstraintsChanged(); } +void TaskSketcherConstrains::on_extendedInformation_stateChanged(int state) +{ + Q_UNUSED(state); + this->ui->extendedInformation->onSave(); + slotConstraintsChanged(); +} + void TaskSketcherConstrains::on_listWidgetConstraints_emitCenterSelectedItems() { sketchView->centerSelection(); diff --git a/src/Mod/Sketcher/Gui/TaskSketcherConstrains.h b/src/Mod/Sketcher/Gui/TaskSketcherConstrains.h index aa079c9ace..754603cb3c 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherConstrains.h +++ b/src/Mod/Sketcher/Gui/TaskSketcherConstrains.h @@ -87,6 +87,7 @@ public Q_SLOTS: void on_listWidgetConstraints_updateDrivingStatus(QListWidgetItem *item, bool status); void on_listWidgetConstraints_emitCenterSelectedItems(void); void on_filterInternalAlignment_stateChanged(int state); + void on_extendedInformation_stateChanged(int state); protected: void changeEvent(QEvent *e); diff --git a/src/Mod/Sketcher/Gui/TaskSketcherConstrains.ui b/src/Mod/Sketcher/Gui/TaskSketcherConstrains.ui index 178e6c6c08..8c511e86a5 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherConstrains.ui +++ b/src/Mod/Sketcher/Gui/TaskSketcherConstrains.ui @@ -73,6 +73,22 @@ + + + + Extended Information + + + false + + + ExtendedConstraintInformation + + + Mod/Sketcher + + +