]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Do not call a customAction for pre-selection processing
authorvsv <vsv@opencascade.com>
Thu, 30 May 2019 13:17:16 +0000 (16:17 +0300)
committervsv <vsv@opencascade.com>
Thu, 30 May 2019 13:17:16 +0000 (16:17 +0300)
src/PartSet/PartSet_WidgetSketchLabel.cpp
src/PartSet/PartSet_WidgetSketchLabel.h

index a32267f1a6d72bc230712f4b407776d920e6a0a5..3c66f35f4938612ed6bc9663ab4a5a7a489ef993 100644 (file)
@@ -85,7 +85,8 @@ PartSet_WidgetSketchLabel::PartSet_WidgetSketchLabel(QWidget* theParent,
                         ModuleBase_IWorkshop* theWorkshop,
                         const Config_WidgetAPI* theData,
                         const QMap<PartSet_Tools::ConstraintVisibleState, bool>& 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());
     }
index 5fe95dff79e1171694d2475a23be3df7e9821b5e..4add82b00b9dae8e791c76e8f92e16956d01ee28 100644 (file)
@@ -224,6 +224,7 @@ private:
   QStackedWidget* myStackWidget;
 
   bool myOpenTransaction;
+  bool myIsSelection;
 };
 
 #endif