From efe1ef3a24e517f2397fc6cd5a35fa0c1b2f118f Mon Sep 17 00:00:00 2001 From: mzn Date: Wed, 20 Nov 2013 15:49:23 +0000 Subject: [PATCH] Simplify the error message. --- src/HYDROGUI/HYDROGUI_ExportCalculationOp.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_ExportCalculationOp.cxx b/src/HYDROGUI/HYDROGUI_ExportCalculationOp.cxx index 65b86410..f978dccd 100644 --- a/src/HYDROGUI/HYDROGUI_ExportCalculationOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ExportCalculationOp.cxx @@ -83,6 +83,7 @@ bool HYDROGUI_ExportCalculationOp::processApply( int& theUpdateFlags, return false; } + QString anErrorMsg; bool anIsOk = false; TopoDS_Shell aShell = aCalculation->GetShell(); @@ -124,11 +125,15 @@ bool HYDROGUI_ExportCalculationOp::processApply( int& theUpdateFlags, } } } else { - theErrorMsg = tr( "RESULT_SHAPE_NULL" ); + anErrorMsg = tr( "RESULT_SHAPE_NULL" ); } - if ( !anIsOk && theErrorMsg.isEmpty() ) { + if ( !anIsOk ) { theErrorMsg = tr( "EXPORT_FAILED" ); + + if( !anErrorMsg.isEmpty() ) { + theErrorMsg.prepend( anErrorMsg + "\n" ); + } } return anIsOk; @@ -170,9 +175,11 @@ void HYDROGUI_ExportCalculationOp::onApply() } else { abort(); - QString aMsg = tr( "INPUT_VALID_DATA" ); + QString aMsg = tr( "EXPORT_FAILED" ); + /* TODO: improve error processing if( !anErrorMsg.isEmpty() ) aMsg.prepend( anErrorMsg + "\n" ); + */ SUIT_MessageBox::critical( module()->getApp()->desktop(), tr( "EXPORT_STATUS" ), aMsg ); -- 2.39.2