From: adv Date: Fri, 21 Mar 2014 06:46:13 +0000 (+0000) Subject: Transaction mechanism corrected. X-Git-Tag: BR_hydro_v1_0_1~35 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=aa07400080540499a1d52434a3541877ecf07b76;p=modules%2Fhydro.git Transaction mechanism corrected. --- diff --git a/src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx b/src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx index 50eb1cad..d7b389e6 100644 --- a/src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx +++ b/src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx @@ -152,12 +152,23 @@ void HYDROGUI_GeoreferencementOp::onModeActivated( const int theActualMode ) SUIT_MessageBox::Yes) == SUIT_MessageBox::Yes; } // Store modifications if needed - if ( isToStore && !store( anErrorMsg ) ) { - anErrorMsg.append( "\n" + tr( "INPUT_VALID_DATA" ) ); - SUIT_MessageBox::critical( module()->getApp()->desktop(), - tr( "INSUFFICIENT_INPUT_DATA" ), - anErrorMsg ); - return; + if ( isToStore ) + { + startDocOperation(); + if ( !store( anErrorMsg ) ) + { + abortDocOperation(); + + anErrorMsg.append( "\n" + tr( "INPUT_VALID_DATA" ) ); + SUIT_MessageBox::critical( module()->getApp()->desktop(), + tr( "INSUFFICIENT_INPUT_DATA" ), + anErrorMsg ); + return; + } + else + { + commitDocOperation(); + } } aPanel->setMode( theActualMode ); @@ -250,7 +261,6 @@ bool HYDROGUI_GeoreferencementOp::store( QString& theErrorMsg ) } aModule->update( UF_Model | UF_OCCViewer | UF_OCC_Forced ); - commitDocOperation(); // TODO: analyze the consequences return true; }