Salome HOME
Simplify the error message.
authormzn <mzn@opencascade.com>
Wed, 20 Nov 2013 15:49:23 +0000 (15:49 +0000)
committermzn <mzn@opencascade.com>
Wed, 20 Nov 2013 15:49:23 +0000 (15:49 +0000)
src/HYDROGUI/HYDROGUI_ExportCalculationOp.cxx

index 65b86410a22cbdc32d6ada80dee8a958e83cd50d..f978dccdbd4fec410eec91998e7f43f9e6ae1d8b 100644 (file)
@@ -83,6 +83,7 @@ bool HYDROGUI_ExportCalculationOp::processApply( int& theUpdateFlags,
     return false;
   }
 
     return false;
   }
 
+  QString anErrorMsg;
   bool anIsOk = false;
 
   TopoDS_Shell aShell = aCalculation->GetShell();
   bool anIsOk = false;
 
   TopoDS_Shell aShell = aCalculation->GetShell();
@@ -124,11 +125,15 @@ bool HYDROGUI_ExportCalculationOp::processApply( int& theUpdateFlags,
       } 
     }
   } else {
       } 
     }
   } else {
-    theErrorMsg = tr( "RESULT_SHAPE_NULL" );
+    anErrorMsg = tr( "RESULT_SHAPE_NULL" );
   }
 
   }
 
-  if ( !anIsOk && theErrorMsg.isEmpty() ) {
+  if ( !anIsOk ) {
     theErrorMsg = tr( "EXPORT_FAILED" );
     theErrorMsg = tr( "EXPORT_FAILED" );
+
+    if( !anErrorMsg.isEmpty() ) {
+      theErrorMsg.prepend( anErrorMsg + "\n" );
+    }
   }
 
   return anIsOk;
   }
 
   return anIsOk;
@@ -170,9 +175,11 @@ void HYDROGUI_ExportCalculationOp::onApply()
   } 
   else {
     abort();
   } 
   else {
     abort();
-    QString aMsg = tr( "INPUT_VALID_DATA" );
+    QString aMsg = tr( "EXPORT_FAILED" );
+    /* TODO: improve error processing
     if( !anErrorMsg.isEmpty() )
       aMsg.prepend( anErrorMsg + "\n" );
     if( !anErrorMsg.isEmpty() )
       aMsg.prepend( anErrorMsg + "\n" );
+    */
     SUIT_MessageBox::critical( module()->getApp()->desktop(),
                                tr( "EXPORT_STATUS" ),
                                aMsg ); 
     SUIT_MessageBox::critical( module()->getApp()->desktop(),
                                tr( "EXPORT_STATUS" ),
                                aMsg );