From: adv Date: Tue, 28 Jan 2014 06:20:33 +0000 (+0000) Subject: Abort document operation after error in process apply (Bug #340). X-Git-Tag: BR_hydro_v_1_0~41 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bb5100f265f0cbdb3671912fbbcdbebb77e2f834;p=modules%2Fhydro.git Abort document operation after error in process apply (Bug #340). --- diff --git a/src/HYDROGUI/HYDROGUI_Operation.cxx b/src/HYDROGUI/HYDROGUI_Operation.cxx index bdbd6fa0..cd2ac684 100644 --- a/src/HYDROGUI/HYDROGUI_Operation.cxx +++ b/src/HYDROGUI/HYDROGUI_Operation.cxx @@ -208,7 +208,10 @@ void HYDROGUI_Operation::onApply() } else { - abortDocOperation(); + // Abort document opeartion only if requested + if ( isToAbortOnApply() ) + abortDocOperation(); + printErrorMessage( anErrorMsg ); // If the operation has no input panel - do abort diff --git a/src/HYDROGUI/HYDROGUI_Operation.h b/src/HYDROGUI/HYDROGUI_Operation.h index 69cab654..5388d34b 100644 --- a/src/HYDROGUI/HYDROGUI_Operation.h +++ b/src/HYDROGUI/HYDROGUI_Operation.h @@ -72,6 +72,8 @@ protected: Handle_HYDROData_Document doc() const; + virtual bool isToAbortOnApply() const { return true; } + void printErrorMessage( const QString& theErrorMsg ); void setPrintErrorMessage( const bool theIsPrint ); diff --git a/src/HYDROGUI/HYDROGUI_StreamOp.h b/src/HYDROGUI/HYDROGUI_StreamOp.h index 9e8730c8..8d356e0a 100755 --- a/src/HYDROGUI/HYDROGUI_StreamOp.h +++ b/src/HYDROGUI/HYDROGUI_StreamOp.h @@ -48,6 +48,8 @@ protected: virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg ); + virtual bool isToAbortOnApply() const { return false; } + private slots: void onAddProfiles(); void onRemoveProfiles( const QStringList& );