]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
BugID PAL10141, Added a check on study closing whether the study was locked
authorsrn <srn@opencascade.com>
Wed, 23 Aug 2006 07:51:53 +0000 (07:51 +0000)
committersrn <srn@opencascade.com>
Wed, 23 Aug 2006 07:51:53 +0000 (07:51 +0000)
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h

index 2f534497cf0c05ba1d4c0298eeb3daf49caed9f4..2711255342895c739fce0a05d7b23e732ffbde4b 100644 (file)
@@ -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<SalomeApp_Study*>(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()
 {
index 598379127686570a61d7e3c3ba8b266d6166d4c4..d9944623c9263424f91c65528bef66b0c7feb398 100644 (file)
@@ -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* );