From: srn Date: Wed, 23 Aug 2006 07:51:53 +0000 (+0000) Subject: BugID PAL10141, Added a check on study closing whether the study was locked X-Git-Tag: V3_2_2pre~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a0ca838b86d70f504805d9597915de8123513c92;p=modules%2Fgui.git BugID PAL10141, Added a check on study closing whether the study was locked --- diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 2f534497c..271125534 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -377,6 +377,29 @@ void SalomeApp_Application::onPaste() } } +/*! Check if the study is locked */ +void SalomeApp_Application::onCloseDoc( bool ask ) +{ + SalomeApp_Study* study = dynamic_cast(activeStudy()); + + if (study != NULL) { + _PTR(Study) stdDS = study->studyDS(); + if(stdDS && stdDS->IsStudyLocked()) { + if ( SUIT_MessageBox::warn2( desktop(), + QObject::tr( "WRN_WARNING" ), + QObject::tr( "CLOSE_LOCKED_STUDY" ), + QObject::tr( "BUT_YES" ), + QObject::tr( "BUT_NO" ), + SUIT_YES, + SUIT_NO, + SUIT_NO ) == SUIT_NO ) return; + + } + } + + LightApp_Application::onCloseDoc( ask ); +} + /*!Sets enable or disable some actions on selection changed.*/ void SalomeApp_Application::onSelectionChanged() { diff --git a/src/SalomeApp/SalomeApp_Application.h b/src/SalomeApp/SalomeApp_Application.h index 598379127..d9944623c 100644 --- a/src/SalomeApp/SalomeApp_Application.h +++ b/src/SalomeApp/SalomeApp_Application.h @@ -99,6 +99,7 @@ public slots: virtual void onCopy(); virtual void onPaste(); void onSaveGUIState();// called from VISU + virtual void onCloseDoc( bool ask = true); protected slots: void onStudySaved( SUIT_Study* );