]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Provide save/restore functionality
authorvsv <vsv@opencascade.com>
Tue, 24 Dec 2019 13:34:28 +0000 (16:34 +0300)
committervsv <vsv@opencascade.com>
Tue, 24 Dec 2019 13:34:28 +0000 (16:34 +0300)
src/SHAPERGUI/SHAPERGUI.cpp
src/SHAPERGUI/SHAPERGUI_DataModel.cpp

index 36654dfb84ab737901d60b1386e90c68634e9f50..8b4338b65d2eaf0b60efcabbaf54ddc3254ac110 100644 (file)
@@ -1181,5 +1181,6 @@ void SHAPERGUI::resetToolbars()
 
 void SHAPERGUI::publishToStudy()
 {
-  myWorkshop->module()->launchOperation("PublishToStudy", false);
+  if (isActiveModule())
+    myWorkshop->module()->launchOperation("PublishToStudy", false);
 }
index b11d10e362294a3a183b62859fb73d9b0dc5f8c7..a156bc8304ddb9469f6e1f0051379ade4051d2a4 100644 (file)
@@ -157,13 +157,13 @@ void SHAPERGUI_DataModel::update(LightApp_DataObject* theObj, LightApp_Study* th
 
 void SHAPERGUI_DataModel::initRootObject()
 {
-  //LightApp_Study* study = dynamic_cast<LightApp_Study*>( module()->application()->activeStudy() );
-  //CAM_ModuleObject *aModelRoot = dynamic_cast<CAM_ModuleObject*>(root());
-  //if(study && aModelRoot == NULL) {
-  //  aModelRoot = createModuleObject( study->root() );
-  //  aModelRoot->setDataModel( this );
-  //  setRoot(aModelRoot);
-  //}
+  LightApp_Study* study = dynamic_cast<LightApp_Study*>( module()->application()->activeStudy() );
+  CAM_ModuleObject *aModelRoot = dynamic_cast<CAM_ModuleObject*>(root());
+  if(study && aModelRoot == NULL) {
+    aModelRoot = createModuleObject( study->root() );
+    aModelRoot->setDataModel( this );
+    setRoot(aModelRoot);
+  }
 }
 
 void SHAPERGUI_DataModel::removeDirectory(const QString& theDirectoryName)