avoid to create a circular dependency when modifying an existing pad or pocket operation
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include <Mod/PartDesign/App/Body.h>
|
||||
|
||||
#include "TaskFeatureParameters.h"
|
||||
#include "TaskSketchBasedParameters.h"
|
||||
|
||||
using namespace PartDesignGui;
|
||||
using namespace Gui;
|
||||
@@ -107,6 +108,15 @@ bool TaskDlgFeatureParameters::accept() {
|
||||
throw Base::Exception(vp->getObject()->getStatusString());
|
||||
}
|
||||
|
||||
// detach the task panel from the selection to avoid to invoke
|
||||
// eventually onAddSelection when the selection changes
|
||||
std::vector<QWidget*> subwidgets = getDialogContent();
|
||||
for (auto it : subwidgets) {
|
||||
TaskSketchBasedParameters* param = qobject_cast<TaskSketchBasedParameters*>(it);
|
||||
if (param)
|
||||
param->detachSelection();
|
||||
}
|
||||
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()");
|
||||
Gui::Command::commitCommand();
|
||||
} catch (const Base::Exception& e) {
|
||||
@@ -128,6 +138,15 @@ bool TaskDlgFeatureParameters::reject()
|
||||
// (at least in the body case)
|
||||
App::DocumentObject* previous = feature->getBaseObject(/* silent = */ true );
|
||||
|
||||
// detach the task panel from the selection to avoid to invoke
|
||||
// eventually onAddSelection when the selection changes
|
||||
std::vector<QWidget*> subwidgets = getDialogContent();
|
||||
for (auto it : subwidgets) {
|
||||
TaskSketchBasedParameters* param = qobject_cast<TaskSketchBasedParameters*>(it);
|
||||
if (param)
|
||||
param->detachSelection();
|
||||
}
|
||||
|
||||
// roll back the done things
|
||||
Gui::Command::abortCommand();
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()");
|
||||
|
||||
Reference in New Issue
Block a user