From a0ca838b86d70f504805d9597915de8123513c92 Mon Sep 17 00:00:00 2001 From: srn Date: Wed, 23 Aug 2006 07:51:53 +0000 Subject: [PATCH] BugID PAL10141, Added a check on study closing whether the study was locked --- src/SalomeApp/SalomeApp_Application.cxx | 23 +++++++++++++++++++++++ src/SalomeApp/SalomeApp_Application.h | 1 + 2 files changed, 24 insertions(+) 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* ); -- 2.39.2