- ModuleBase_ModelWidget::deactivate();
- disconnect(myWorkshop, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
- activateSelectionAndFilters(false);
- ModuleBase_ModelWidget::deactivate();
-}
-
-//********************************************************************
-std::string ModuleBase_WidgetSelector::generateName(const AttributePtr& theAttribute,
- ModuleBase_IWorkshop* theWorkshop)
-{
- std::string aName;
- if (theAttribute.get() != NULL) {
- ModuleBase_Operation* anOperation = theWorkshop->currentOperation();
-
- FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner());
- if (aFeature.get()) {
- std::string aXmlCfg, aDescription;
- theWorkshop->module()->getXMLRepresentation(aFeature->getKind(), aXmlCfg, aDescription);
-
- ModuleBase_WidgetFactory aFactory(aXmlCfg, theWorkshop);
- std::string anAttributeTitle;
- aFactory.getAttributeTitle(theAttribute->id(), anAttributeTitle);
-
- std::stringstream aStreamName;
- aStreamName << theAttribute->owner()->data()->name() << "/"<< anAttributeTitle.c_str();
- aName = aStreamName.str();
- }
+ ModuleBase_WidgetValidated::deactivate();
+ /// clear temporary cash
+ AttributePtr anAttribute = attribute();
+ if (!anAttribute.get())
+ return;
+ std::string aType = anAttribute->attributeType();
+ if (anAttribute->attributeType() == ModelAPI_AttributeSelection::typeId()) {
+ AttributeSelectionPtr aSelectAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(anAttribute);
+ aSelectAttr->removeTemporaryValues();
+ }
+ else if (anAttribute->attributeType() == ModelAPI_AttributeSelectionList::typeId()) {
+ AttributeSelectionListPtr aSelectAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(anAttribute);
+ aSelectAttr->removeTemporaryValues();