Salome HOME
PAL13330( When mesh generation does not success, trace where )
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_HypothesesUtils.cxx
index 2a0d4e152105c8a34089a1165696e468f661025d..cc4db51a80841b5ae1615b4f985d24e56b553b3f 100644 (file)
@@ -583,25 +583,28 @@ namespace SMESH{
     return listSOmesh;
   }
 
-#define CASE2MESSAGE(enum) case SMESH::enum: msg = QObject::tr( #enum ); break;
+#define CASE2MESSAGE(enum) case SMESH::enum: msg = QObject::tr( "STATE_" #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 ];
+      const bool hasAlgo = ( strlen( error.algoName ) != 0 );
       QString msg;
-      switch( error.name ) {
-        CASE2MESSAGE( MISSING_ALGO );
-        CASE2MESSAGE( MISSING_HYPO );
-        CASE2MESSAGE( NOT_CONFORM_MESH );
-        CASE2MESSAGE( BAD_PARAM_VALUE );
-      default: continue;
-      }
+      if ( !hasAlgo )
+        msg = QObject::tr( "STATE_ALGO_MISSING" );
+      else 
+        switch( error.state ) {
+          CASE2MESSAGE( HYP_MISSING );
+          CASE2MESSAGE( HYP_NOTCONFORM );
+          CASE2MESSAGE( HYP_BAD_PARAMETER );
+        default: continue;
+        }
       // apply args to message:
       // %1 - algo name
-      if ( error.algoName.in() != 0 )
+      if ( hasAlgo )
         msg = msg.arg( error.algoName.in() );
-      // %2 - dimention
+      // %2 - dimension
       msg = msg.arg( error.algoDim );
       // %3 - global/local
       msg = msg.arg( QObject::tr( error.isGlobalAlgo ? "GLOBAL_ALGO" : "LOCAL_ALGO" ));