From: vsv Date: Thu, 30 May 2019 13:17:16 +0000 (+0300) Subject: Do not call a customAction for pre-selection processing X-Git-Tag: VEDF2019Lot4~114^2~12 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=439685d8976b94f126981467781d04f9f6f6f52e;p=modules%2Fshaper.git Do not call a customAction for pre-selection processing --- 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