Salome HOME
Fix for the bug #45: check and warning when the same image is used in 2 arguments.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ExportCalculationOp.cxx
index 6344eddd19da49c5dd25dd4c461ee7edf77fab56..77722af36d2ebeeeec1da79c503b4e80235b2e6e 100644 (file)
@@ -80,7 +80,7 @@ bool HYDROGUI_ExportCalculationOp::processApply( int& theUpdateFlags,
       HYDROGUI_Tool::GetSelectedObject( module() ) );
 
   if ( aCalculation.IsNull() ) {
-    theErrorMsg = tr( "EXPORT_FAILED" );
+    theErrorMsg = tr( "NULL_DATA_OBJECT" );
     return false;
   }
 
@@ -125,16 +125,12 @@ bool HYDROGUI_ExportCalculationOp::processApply( int& theUpdateFlags,
         anIsOk = true;
       } 
     }
-  } else {
-    anErrorMsg = tr( "RESULT_SHAPE_NULL" );
-  }
 
-  if ( !anIsOk ) {
-    theErrorMsg = tr( "EXPORT_FAILED" );
+    if ( !anIsOk )
+      theErrorMsg = tr( "IMPOSSIBLE_TO_CREATE_GEOM_SHAPE" );
 
-    if( !anErrorMsg.isEmpty() ) {
-      theErrorMsg.prepend( anErrorMsg + "\n" );
-    }
+  } else {
+    theErrorMsg = tr( "RESULT_SHAPE_NULL" );
   }
 
   return anIsOk;
@@ -176,13 +172,14 @@ void HYDROGUI_ExportCalculationOp::onApply()
   } 
   else {
     abort();
-    QString aMsg = tr( "EXPORT_FAILED" );
-    /* TODO: improve error processing
-    if( !anErrorMsg.isEmpty() )
-      aMsg.prepend( anErrorMsg + "\n" );
-    */
+
+    if ( anErrorMsg.isEmpty() )
+      anErrorMsg = tr( "EXPORT_DATA_FAILED" );
+
+    anErrorMsg.prepend( tr( "EXPORT_FAILED" ) + "\n" );
+
     SUIT_MessageBox::critical( module()->getApp()->desktop(),
                                tr( "EXPORT_STATUS" ),
-                               aMsg ); 
+                               anErrorMsg ); 
   }
 }
\ No newline at end of file