From: nds Date: Tue, 24 Mar 2015 05:39:01 +0000 (+0300) Subject: Union of validator and filter functionalities. X-Git-Tag: V_1.1.0~85^2~12 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f3f60a3cb69f2534a5837cd249782395e5edb183;p=modules%2Fshaper.git Union of validator and filter functionalities. The attribute type should be stored through the standard way. Just selection is processed on selection changed. --- diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp index 8fc20d6b9..ff8bafdea 100644 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp @@ -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(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; }