]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
in reject(), do not remove SObject of prs from a locked study
authoreap <eap@opencascade.com>
Fri, 20 May 2005 12:40:36 +0000 (12:40 +0000)
committereap <eap@opencascade.com>
Fri, 20 May 2005 12:40:36 +0000 (12:40 +0000)
in accept(), do not close dlg if a study is locked

src/VISUGUI/VisuGUI_Plot3DDlg.cxx

index 2c3f8da53f2f6738c6c482e06304e3cf580658eb..61172ecea9dca152f20ca6ceff22d3befcee33ad 100644 (file)
@@ -571,7 +571,6 @@ VisuGUI_Plot3DDlg::VisuGUI_Plot3DDlg()
 void VisuGUI_Plot3DDlg::accept()
 {
   if ( !VisuGUI::CheckActiveStudyLock() ) {
-    reject();
     return;
   }
   if (myIsoPane->check() && myScalarPane->check()) {
@@ -614,11 +613,15 @@ void VisuGUI_Plot3DDlg::accept()
 void VisuGUI_Plot3DDlg::reject()
 {
   myIsoPane->check(); // hide preview
-
+  
   if (!isModal() && myIsoPane->GetPrs() &&
-      !VisuGUI::GetActor( myIsoPane->GetPrs() )) {
-    myIsoPane->GetPrs()->RemoveFromStudy();
-    myIsoPane->GetStudyFrame()->getStudy()->updateObjBrowser();
+      !VisuGUI::GetActor( myIsoPane->GetPrs() ))
+  {
+    SALOMEDS::Study_var aStudy = VisuGUI::GetActiveStudy()->getStudyDocument();
+    if (!aStudy->GetProperties()->IsLocked()) {
+      myIsoPane->GetPrs()->RemoveFromStudy();
+      myIsoPane->GetStudyFrame()->getStudy()->updateObjBrowser();
+    }
   }
   QDialog::reject();
 }