From ce88fa2052cb7b82a8eda3f18c9a234cff66e1e4 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 7 Dec 2021 13:06:48 +0100 Subject: [PATCH] PD: enable selection only on request and disable it after selecting an object --- src/Mod/PartDesign/Gui/TaskExtrudeParameters.cpp | 2 -- src/Mod/PartDesign/Gui/TaskLoftParameters.cpp | 6 +++++- src/Mod/PartDesign/Gui/TaskPipeParameters.cpp | 5 ++++- src/Mod/PartDesign/Gui/TaskSketchBasedParameters.cpp | 5 ++++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Mod/PartDesign/Gui/TaskExtrudeParameters.cpp b/src/Mod/PartDesign/Gui/TaskExtrudeParameters.cpp index 711ae4051b..8f16ac5af4 100644 --- a/src/Mod/PartDesign/Gui/TaskExtrudeParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskExtrudeParameters.cpp @@ -560,8 +560,6 @@ void TaskExtrudeParameters::getReferenceAxis(App::DocumentObject*& obj, std::vec void TaskExtrudeParameters::onButtonFace(const bool pressed) { - this->blockConnection(!pressed); - // to distinguish that this is the direction selection selectionFace = true; diff --git a/src/Mod/PartDesign/Gui/TaskLoftParameters.cpp b/src/Mod/PartDesign/Gui/TaskLoftParameters.cpp index 9511e0fb20..9cc95c3972 100644 --- a/src/Mod/PartDesign/Gui/TaskLoftParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskLoftParameters.cpp @@ -50,7 +50,7 @@ #include "TaskSketchBasedParameters.h" #include "ReferenceSelection.h" -Q_DECLARE_METATYPE(App::PropertyLinkSubList::SubSet); +Q_DECLARE_METATYPE(App::PropertyLinkSubList::SubSet) using namespace PartDesignGui; using namespace Gui; @@ -304,6 +304,7 @@ void TaskLoftParameters::exitSelectionMode() { selectionMode = none; Gui::Selection().clearSelection(); + this->blockConnection(true); } void TaskLoftParameters::changeEvent(QEvent * /*e*/) @@ -326,6 +327,7 @@ void TaskLoftParameters::onProfileButton(bool checked) clearButtons(refProfile); Gui::Selection().clearSelection(); selectionMode = refProfile; + this->blockConnection(false); //static_cast(vp)->highlightReferences(true, true); } } @@ -336,6 +338,7 @@ void TaskLoftParameters::onRefButtonAdd(bool checked) clearButtons(refAdd); Gui::Selection().clearSelection(); selectionMode = refAdd; + this->blockConnection(false); //static_cast(vp)->highlightReferences(true, true); } } @@ -346,6 +349,7 @@ void TaskLoftParameters::onRefButtonRemove(bool checked) clearButtons(refRemove); Gui::Selection().clearSelection(); selectionMode = refRemove; + this->blockConnection(false); //static_cast(vp)->highlightReferences(true, true); } } diff --git a/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp b/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp index ba80f2bd9e..fe6d28604e 100644 --- a/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp @@ -60,7 +60,7 @@ #include "Utils.h" #include "TaskFeaturePick.h" -Q_DECLARE_METATYPE(App::PropertyLinkSubList::SubSet); +Q_DECLARE_METATYPE(App::PropertyLinkSubList::SubSet) using namespace PartDesignGui; using namespace Gui; @@ -149,6 +149,7 @@ TaskPipeParameters::TaskPipeParameters(ViewProviderPipe *PipeView, bool /*newObj ui->comboBoxTransition->setCurrentIndex(pipe->Transition.getValue()); updateUI(); + this->blockConnection(false); } TaskPipeParameters::~TaskPipeParameters() @@ -663,6 +664,7 @@ TaskPipeOrientation::TaskPipeOrientation(ViewProviderPipe* PipeView, bool /*newO // should be called after panel has become visible QMetaObject::invokeMethod(this, "updateUI", Qt::QueuedConnection, QGenericReturnArgument(), Q_ARG(int,pipe->Mode.getValue())); + this->blockConnection(false); } TaskPipeOrientation::~TaskPipeOrientation() @@ -958,6 +960,7 @@ TaskPipeScaling::TaskPipeScaling(ViewProviderPipe* PipeView, bool /*newObj*/, QW // should be called after panel has become visible QMetaObject::invokeMethod(this, "updateUI", Qt::QueuedConnection, QGenericReturnArgument(), Q_ARG(int,pipe->Transformation.getValue())); + this->blockConnection(false); } TaskPipeScaling::~TaskPipeScaling() diff --git a/src/Mod/PartDesign/Gui/TaskSketchBasedParameters.cpp b/src/Mod/PartDesign/Gui/TaskSketchBasedParameters.cpp index 7375f7f1b9..dee0812702 100644 --- a/src/Mod/PartDesign/Gui/TaskSketchBasedParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskSketchBasedParameters.cpp @@ -63,7 +63,8 @@ TaskSketchBasedParameters::TaskSketchBasedParameters(PartDesignGui::ViewProvider const std::string& pixmapname, const QString& parname) : TaskFeatureParameters(vp, parent, pixmapname, parname) { - + // disable selection + this->blockConnection(true); } const QString TaskSketchBasedParameters::onAddSelection(const Gui::SelectionChanges& msg) @@ -122,12 +123,14 @@ void TaskSketchBasedParameters::onSelectReference(AllowSelectionFlags allow) { if (AllowSelectionFlags::Int(allow) != int(AllowSelection::NONE)) { startReferenceSelection(pcSketchBased, prevSolid); + this->blockConnection(false); Gui::Selection().clearSelection(); Gui::Selection().addSelectionGate(new ReferenceSelection(prevSolid, allow)); } else { Gui::Selection().rmvSelectionGate(); finishReferenceSelection(pcSketchBased, prevSolid); + this->blockConnection(true); } } }