From: vsv Date: Tue, 24 Dec 2019 13:34:28 +0000 (+0300) Subject: Provide save/restore functionality X-Git-Tag: V9_5_0a1~17^2~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=38a46e6d552c2c56b880e65f2f2fc2593536c8db;p=modules%2Fshaper.git Provide save/restore functionality --- diff --git a/src/SHAPERGUI/SHAPERGUI.cpp b/src/SHAPERGUI/SHAPERGUI.cpp index 36654dfb8..8b4338b65 100644 --- a/src/SHAPERGUI/SHAPERGUI.cpp +++ b/src/SHAPERGUI/SHAPERGUI.cpp @@ -1181,5 +1181,6 @@ void SHAPERGUI::resetToolbars() void SHAPERGUI::publishToStudy() { - myWorkshop->module()->launchOperation("PublishToStudy", false); + if (isActiveModule()) + myWorkshop->module()->launchOperation("PublishToStudy", false); } diff --git a/src/SHAPERGUI/SHAPERGUI_DataModel.cpp b/src/SHAPERGUI/SHAPERGUI_DataModel.cpp index b11d10e36..a156bc830 100644 --- a/src/SHAPERGUI/SHAPERGUI_DataModel.cpp +++ b/src/SHAPERGUI/SHAPERGUI_DataModel.cpp @@ -157,13 +157,13 @@ void SHAPERGUI_DataModel::update(LightApp_DataObject* theObj, LightApp_Study* th void SHAPERGUI_DataModel::initRootObject() { - //LightApp_Study* study = dynamic_cast( module()->application()->activeStudy() ); - //CAM_ModuleObject *aModelRoot = dynamic_cast(root()); - //if(study && aModelRoot == NULL) { - // aModelRoot = createModuleObject( study->root() ); - // aModelRoot->setDataModel( this ); - // setRoot(aModelRoot); - //} + LightApp_Study* study = dynamic_cast( module()->application()->activeStudy() ); + CAM_ModuleObject *aModelRoot = dynamic_cast(root()); + if(study && aModelRoot == NULL) { + aModelRoot = createModuleObject( study->root() ); + aModelRoot->setDataModel( this ); + setRoot(aModelRoot); + } } void SHAPERGUI_DataModel::removeDirectory(const QString& theDirectoryName)