X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_HypothesesUtils.cxx;h=68d15b79bd3878fac173c80b4c26e617156fa742;hp=585562c8f233c43684c698be5372c5c77d2e126c;hb=bf36cccf8ecd8f2d43c10106ec053d89a495d99a;hpb=60bdcf56b18b6a2e8e6b90906a99ff43241991b8;ds=sidebyside diff --git a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx index 585562c8f..68d15b79b 100644 --- a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx @@ -549,4 +549,33 @@ namespace SMESH{ if (MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): completed"); return listSOmesh; } + +#define CASE2MESSAGE(enum) case SMESH::enum: msg = QObject::tr( #enum ); break; + QString GetMessageOnAlgoStateErrors(const algo_error_array& errors) + { + QString resMsg = QObject::tr("SMESH_WRN_MISSING_PARAMETERS") + ":\n"; + for ( int i = 0; i < errors.length(); ++i ) { + const SMESH::AlgoStateError & error = errors[ i ]; + QString msg; + switch( error.name ) { + CASE2MESSAGE( MISSING_ALGO ); + CASE2MESSAGE( MISSING_HYPO ); + CASE2MESSAGE( NOT_CONFORM_MESH ); + default: continue; + } + // apply args to message: + // %1 - algo name + if ( error.algoName.in() != 0 ) + msg = msg.arg( error.algoName.in() ); + // %2 - dimention + msg = msg.arg( error.algoDim ); + // %3 - global/local + msg = msg.arg( QObject::tr( error.isGlobalAlgo ? "GLOBAL_ALGO" : "LOCAL_ALGO" )); + + if ( i ) resMsg += ";\n"; + resMsg += msg; + } + return resMsg; + } + }