From bb5100f265f0cbdb3671912fbbcdbebb77e2f834 Mon Sep 17 00:00:00 2001 From: adv Date: Tue, 28 Jan 2014 06:20:33 +0000 Subject: [PATCH] Abort document operation after error in process apply (Bug #340). --- src/HYDROGUI/HYDROGUI_Operation.cxx | 5 ++++- src/HYDROGUI/HYDROGUI_Operation.h | 2 ++ src/HYDROGUI/HYDROGUI_StreamOp.h | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) 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& ); -- 2.39.2