diff --git a/src/Mod/PartDesign/Gui/TaskMultiTransformParameters.cpp b/src/Mod/PartDesign/Gui/TaskMultiTransformParameters.cpp index 86bb68e9d..b6dcd9096 100644 --- a/src/Mod/PartDesign/Gui/TaskMultiTransformParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskMultiTransformParameters.cpp @@ -101,6 +101,8 @@ TaskMultiTransformParameters::TaskMultiTransformParameters(ViewProviderTransform this, SLOT(onMoveDown())); ui->listTransformFeatures->addAction(action); ui->listTransformFeatures->setContextMenuPolicy(Qt::ActionsContextMenu); + connect(ui->checkBoxUpdateView, SIGNAL(toggled(bool)), + this, SLOT(onUpdateView(bool))); connect(ui->listTransformFeatures, SIGNAL(activated(QModelIndex)), this, SLOT(onTransformActivated(QModelIndex))); @@ -214,7 +216,7 @@ void TaskMultiTransformParameters::onTransformAddMirrored() Gui::Command::openCommand("Mirrored"); Gui::Command::doCommand(Gui::Command::Doc,"App.activeDocument().addObject(\"PartDesign::Mirrored\",\"%s\")",newFeatName.c_str()); - Gui::Command::updateActive(); + //Gui::Command::updateActive(); Gui::Command::doCommand(Gui::Command::Doc,"App.activeDocument().%s.StdMirrorPlane = \"XY\"", newFeatName.c_str()); finishAdd(newFeatName); @@ -227,7 +229,7 @@ void TaskMultiTransformParameters::onTransformAddLinearPattern() Gui::Command::openCommand("LinearPattern"); Gui::Command::doCommand(Gui::Command::Doc,"App.activeDocument().addObject(\"PartDesign::LinearPattern\",\"%s\")",newFeatName.c_str()); - Gui::Command::updateActive(); + //Gui::Command::updateActive(); Gui::Command::doCommand(Gui::Command::Doc,"App.activeDocument().%s.StdDirection = \"X\"", newFeatName.c_str()); Gui::Command::doCommand(Gui::Command::Doc,"App.activeDocument().%s.Length = 100", newFeatName.c_str()); Gui::Command::doCommand(Gui::Command::Doc,"App.activeDocument().%s.Occurrences = 2", newFeatName.c_str()); @@ -242,7 +244,7 @@ void TaskMultiTransformParameters::onTransformAddPolarPattern() Gui::Command::openCommand("PolarPattern"); Gui::Command::doCommand(Gui::Command::Doc,"App.activeDocument().addObject(\"PartDesign::PolarPattern\",\"%s\")",newFeatName.c_str()); - Gui::Command::updateActive(); + //Gui::Command::updateActive(); Gui::Command::doCommand(Gui::Command::Doc,"App.activeDocument().%s.StdAxis = \"X\"", newFeatName.c_str()); Gui::Command::doCommand(Gui::Command::Doc,"App.activeDocument().%s.Angle = 360", newFeatName.c_str()); Gui::Command::doCommand(Gui::Command::Doc,"App.activeDocument().%s.Occurrences = 2", newFeatName.c_str()); @@ -257,7 +259,7 @@ void TaskMultiTransformParameters::onTransformAddScaled() Gui::Command::openCommand("Scaled"); Gui::Command::doCommand(Gui::Command::Doc,"App.activeDocument().addObject(\"PartDesign::Scaled\",\"%s\")",newFeatName.c_str()); - Gui::Command::updateActive(); + //Gui::Command::updateActive(); Gui::Command::doCommand(Gui::Command::Doc,"App.activeDocument().%s.Factor = 2", newFeatName.c_str()); Gui::Command::doCommand(Gui::Command::Doc,"App.activeDocument().%s.Occurrences = 2", newFeatName.c_str()); @@ -357,6 +359,13 @@ void TaskMultiTransformParameters::onSubTaskButtonOK() { closeSubTask(); } +void TaskMultiTransformParameters::onUpdateView(bool on) +{ + blockUpdate = !on; + if (on) + recomputeFeature(); +} + const std::vector TaskMultiTransformParameters::getTransformFeatures(void) const { PartDesign::MultiTransform* pcMultiTransform = static_cast(TransformedView->getObject()); diff --git a/src/Mod/PartDesign/Gui/TaskMultiTransformParameters.h b/src/Mod/PartDesign/Gui/TaskMultiTransformParameters.h index 7d81e4343..d385ec328 100644 --- a/src/Mod/PartDesign/Gui/TaskMultiTransformParameters.h +++ b/src/Mod/PartDesign/Gui/TaskMultiTransformParameters.h @@ -76,6 +76,7 @@ private Q_SLOTS: virtual void onSubTaskButtonOK(); // Note: There is no Cancel button because I couldn't work out how to save the state of // a subFeature so as to revert the changes of an edit operation + virtual void onUpdateView(bool); protected: virtual void changeEvent(QEvent *e); diff --git a/src/Mod/PartDesign/Gui/TaskTransformedParameters.cpp b/src/Mod/PartDesign/Gui/TaskTransformedParameters.cpp index fc3b5ee7c..2b53b150b 100644 --- a/src/Mod/PartDesign/Gui/TaskTransformedParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskTransformedParameters.cpp @@ -110,7 +110,7 @@ void TaskTransformedParameters::recomputeFeature() if (insideMultiTransform) { // redirect recompute and let the parent decide if recompute has to be blocked parentTask->recomputeFeature(); - } else if (!blockRecompute) { + } else if (!blockUpdate) { PartDesign::Transformed* pcTransformed = static_cast(TransformedView->getObject()); pcTransformed->getDocument()->recomputeFeature(pcTransformed); } diff --git a/src/Mod/PartDesign/Gui/TaskTransformedParameters.h b/src/Mod/PartDesign/Gui/TaskTransformedParameters.h index 7636fbd82..edff128c7 100644 --- a/src/Mod/PartDesign/Gui/TaskTransformedParameters.h +++ b/src/Mod/PartDesign/Gui/TaskTransformedParameters.h @@ -94,10 +94,8 @@ protected: TaskMultiTransformParameters* parentTask; /// Flag indicating whether this object is a container for MultiTransform bool insideMultiTransform; - /// Lock updateUI() and applying changes to the underlying feature + /// Lock updateUI(), applying changes to the underlying feature and calling recomputeFeature() bool blockUpdate; - /// Lock recomputeFeature() - bool blockRecompute; }; /// simulation dialog for the TaskView