]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
IPAL21728 TC5.1.4: Problem with saving of locked study
authordmv <dmv@opencascade.com>
Mon, 24 May 2010 12:39:47 +0000 (12:39 +0000)
committerdmv <dmv@opencascade.com>
Mon, 24 May 2010 12:39:47 +0000 (12:39 +0000)
src/SalomeApp/SalomeApp_VisualState.cxx

index 689038fa6e40a3f53689ba43a5c30a05aa1c7ecc..0c06d2fd58bf7d452de5bf74975ddc0a2a5b2330 100644 (file)
@@ -108,6 +108,10 @@ int SalomeApp_VisualState::storeState()
   if ( !study )
     return -1;
 
+  // unlock study if it is locked
+  bool aLocked = study->studyDS()->GetProperties()->IsLocked();
+  if (aLocked) study->studyDS()->GetProperties()->SetLocked(false);
+
   int savePoint = 1;
   std::vector<int> savePoints = study->getSavePoints();
   //Calculate a new savePoint number = the last save point number + 1
@@ -182,6 +186,8 @@ int SalomeApp_VisualState::storeState()
   // set default name of new savePoint
   study->setNameOfSavePoint( savePoint, QObject::tr( "SAVE_POINT_DEF_NAME" ) + QString::number( savePoint ) );
 
+  if (aLocked) study->studyDS()->GetProperties()->SetLocked(true);
+
   return savePoint;
 }