From 439685d8976b94f126981467781d04f9f6f6f52e Mon Sep 17 00:00:00 2001 From: vsv Date: Thu, 30 May 2019 16:17:16 +0300 Subject: [PATCH] Do not call a customAction for pre-selection processing --- src/PartSet/PartSet_WidgetSketchLabel.cpp | 10 +++++++--- src/PartSet/PartSet_WidgetSketchLabel.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index a32267f1a..3c66f35f4 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -85,7 +85,8 @@ PartSet_WidgetSketchLabel::PartSet_WidgetSketchLabel(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, const Config_WidgetAPI* theData, const QMap& toShowConstraints) -: ModuleBase_WidgetValidated(theParent, theWorkshop, theData), myOpenTransaction(false) +: ModuleBase_WidgetValidated(theParent, theWorkshop, theData), myOpenTransaction(false), +myIsSelection(false) { QVBoxLayout* aLayout = new QVBoxLayout(this); ModuleBase_Tools::zeroMargins(aLayout); @@ -281,8 +282,11 @@ bool PartSet_WidgetSketchLabel::setSelectionInternal( else { // it removes the processed value from the parameters list ModuleBase_ViewerPrsPtr aValue = theValues.first();//.takeFirst(); - if (!theToValidate || isValidInFilters(aValue)) + if (!theToValidate || isValidInFilters(aValue)) { + myIsSelection = true; aDone = setSelectionCustom(aValue); + myIsSelection = false; + } } return aDone; @@ -412,7 +416,7 @@ void PartSet_WidgetSketchLabel::restoreAttributeValue(const AttributePtr& theAtt bool PartSet_WidgetSketchLabel::setSelectionCustom(const ModuleBase_ViewerPrsPtr& thePrs) { - if (myRemoveExternal->isVisible()) { + if (myIsSelection && myRemoveExternal->isVisible()) { if (myRemoveExternal->isChecked()) { myFeature->customAction(SketchPlugin_Sketch::ACTION_REMOVE_EXTERNAL()); } diff --git a/src/PartSet/PartSet_WidgetSketchLabel.h b/src/PartSet/PartSet_WidgetSketchLabel.h index 5fe95dff7..4add82b00 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.h +++ b/src/PartSet/PartSet_WidgetSketchLabel.h @@ -224,6 +224,7 @@ private: QStackedWidget* myStackWidget; bool myOpenTransaction; + bool myIsSelection; }; #endif -- 2.30.2