X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FParametersPlugin%2FParametersPlugin_EvalListener.cpp;h=d63741c9fa606596f832c40bd95ddb6524d0b2ac;hb=471cc7b52168016a3b6fff7e64cdd800cd7d8f91;hp=fe2665b1081f8678cc5467613489a3a472f3f654;hpb=69ed966e5a75e545b5e9ae71499fd08790819484;p=modules%2Fshaper.git diff --git a/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp b/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp index fe2665b10..d63741c9f 100644 --- a/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp +++ b/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp @@ -26,6 +26,8 @@ #include #include +#include + #include #include #include @@ -336,7 +338,8 @@ void ParametersPlugin_EvalListener::renameInDependents(std::shared_ptrvalidators()->validate(theAttribute, aValidator, anError); } @@ -344,7 +347,7 @@ void setParameterName(ResultParameterPtr theResultParameter, const std::string& { theResultParameter->data()->blockSendAttributeUpdated(true); theResultParameter->data()->setName(theName); - theResultParameter->data()->blockSendAttributeUpdated(false); + theResultParameter->data()->blockSendAttributeUpdated(false, false); std::shared_ptr aParameter = std::dynamic_pointer_cast( @@ -380,6 +383,18 @@ void ParametersPlugin_EvalListener::processObjectRenamedEvent( if (!aParameter.get()) return; + std::string aNotActivatedNames; + if (!ModelAPI_Tools::allDocumentsActivated(aNotActivatedNames)) { + QMessageBox::StandardButton aRes = QMessageBox::warning(0, QObject::tr("Warning"), + QObject::tr("Selected objects can be used in Part documents which are not loaded: \ +%1. Whould you like to continue?").arg(aNotActivatedNames.c_str()), + QMessageBox::No | QMessageBox::Yes, QMessageBox::No); + if (aRes != QMessageBox::Yes) { + setParameterName(aResultParameter, aMessage->oldName()); + return; + } + } + // try to update the parameter feature according the new name setParameterName(aResultParameter, aMessage->newName()); // TODO(spo): replace with ModelAPI_Session::get()->validators()->validate(aParameter, ParametersPlugin_Parameter::VARIABLE_ID())