]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom into Dev_1.1.0
authornds <natalia.donis@opencascade.com>
Tue, 24 Mar 2015 05:39:16 +0000 (08:39 +0300)
committernds <natalia.donis@opencascade.com>
Tue, 24 Mar 2015 05:39:16 +0000 (08:39 +0300)
src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp

index 8fc20d6b94e1bd76b76f13f82d4f26c8ce5b487f..ff8bafdea6a8746a9ca85a9063af9e2cc62cbe73 100644 (file)
@@ -122,7 +122,20 @@ void ModuleBase_WidgetMultiSelector::deactivate()
 bool ModuleBase_WidgetMultiSelector::storeValueCustom() const
 {
   // the value is stored on the selection changed signal processing 
-  return true;
+  // A rare case when plugin was not loaded. 
+  if(!myFeature)
+    return false;
+  DataPtr aData = myFeature->data();
+  AttributeSelectionListPtr aSelectionListAttr = 
+    std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(aData->attribute(attributeID()));
+
+  if (aSelectionListAttr) {
+    // Store shapes type
+     TopAbs_ShapeEnum aCurrentType =
+           ModuleBase_WidgetShapeSelector::shapeType(myTypeCombo->currentText());
+     aSelectionListAttr->setSelectionType(myTypeCombo->currentText().toStdString());
+  }   
+   return true;
 }
 
 //********************************************************************
@@ -138,7 +151,7 @@ bool ModuleBase_WidgetMultiSelector::restoreValue()
   if (aSelectionListAttr) {
     // Restore shape type
     setCurrentShapeType(
-      ModuleBase_WidgetShapeSelector::shapeType(aSelectionListAttr->selectionType().c_str()));
+         ModuleBase_WidgetShapeSelector::shapeType(aSelectionListAttr->selectionType().c_str()));
     updateSelectionList(aSelectionListAttr);
     return true;
   }