Skip to content

Commit

Permalink
PD: enable selection only on request and disable it after selecting a…
Browse files Browse the repository at this point in the history
…n object
  • Loading branch information
wwmayer committed Dec 7, 2021
1 parent a27b306 commit ce88fa2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/Mod/PartDesign/Gui/TaskExtrudeParameters.cpp
Expand Up @@ -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;

Expand Down
6 changes: 5 additions & 1 deletion src/Mod/PartDesign/Gui/TaskLoftParameters.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -304,6 +304,7 @@ void TaskLoftParameters::exitSelectionMode()
{
selectionMode = none;
Gui::Selection().clearSelection();
this->blockConnection(true);
}

void TaskLoftParameters::changeEvent(QEvent * /*e*/)
Expand All @@ -326,6 +327,7 @@ void TaskLoftParameters::onProfileButton(bool checked)
clearButtons(refProfile);
Gui::Selection().clearSelection();
selectionMode = refProfile;
this->blockConnection(false);
//static_cast<ViewProviderLoft*>(vp)->highlightReferences(true, true);
}
}
Expand All @@ -336,6 +338,7 @@ void TaskLoftParameters::onRefButtonAdd(bool checked)
clearButtons(refAdd);
Gui::Selection().clearSelection();
selectionMode = refAdd;
this->blockConnection(false);
//static_cast<ViewProviderLoft*>(vp)->highlightReferences(true, true);
}
}
Expand All @@ -346,6 +349,7 @@ void TaskLoftParameters::onRefButtonRemove(bool checked)
clearButtons(refRemove);
Gui::Selection().clearSelection();
selectionMode = refRemove;
this->blockConnection(false);
//static_cast<ViewProviderLoft*>(vp)->highlightReferences(true, true);
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/Mod/PartDesign/Gui/TaskPipeParameters.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -149,6 +149,7 @@ TaskPipeParameters::TaskPipeParameters(ViewProviderPipe *PipeView, bool /*newObj
ui->comboBoxTransition->setCurrentIndex(pipe->Transition.getValue());

updateUI();
this->blockConnection(false);
}

TaskPipeParameters::~TaskPipeParameters()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
5 changes: 4 additions & 1 deletion src/Mod/PartDesign/Gui/TaskSketchBasedParameters.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit ce88fa2

Please sign in to comment.