From: sbh Date: Mon, 8 Dec 2014 15:29:21 +0000 (+0300) Subject: Issue #315: Disable "Remove" and "Duplicate" if no part created X-Git-Tag: V_0.6.0^2^2^2~1^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2695cffcf53965090e593158f74f470ee2e634d5;p=modules%2Fshaper.git Issue #315: Disable "Remove" and "Duplicate" if no part created --- diff --git a/src/Config/Config_FeatureReader.cpp b/src/Config/Config_FeatureReader.cpp index 9ebc93f78..bf780f330 100644 --- a/src/Config/Config_FeatureReader.cpp +++ b/src/Config/Config_FeatureReader.cpp @@ -102,7 +102,12 @@ void Config_FeatureReader::fillFeature(xmlNodePtr theNode, outFeatureMessage->setKeysequence(getProperty(theNode, FEATURE_KEYSEQUENCE)); outFeatureMessage->setGroupId(restoreAttribute(NODE_GROUP, _ID)); outFeatureMessage->setWorkbenchId(restoreAttribute(NODE_WORKBENCH, _ID)); - outFeatureMessage->setDocumentKind(restoreAttribute(NODE_WORKBENCH, WORKBENCH_DOC)); + // Get document kind of a feature, if empty set workbench's kind (might be empty too) + std::string aDocKind = getProperty(theNode, WORKBENCH_DOC); + if(aDocKind.empty()) { + aDocKind = restoreAttribute(NODE_WORKBENCH, WORKBENCH_DOC); + } + outFeatureMessage->setDocumentKind(aDocKind); } void Config_FeatureReader::storeAttribute(xmlNodePtr theNode, diff --git a/src/PartSetPlugin/CMakeLists.txt b/src/PartSetPlugin/CMakeLists.txt index e115ab9db..1f249f9b6 100644 --- a/src/PartSetPlugin/CMakeLists.txt +++ b/src/PartSetPlugin/CMakeLists.txt @@ -15,8 +15,12 @@ SET(PROJECT_SOURCES PartSetPlugin_Remove.cpp ) +SET(XML_RESOURCES + plugin-PartSet.xml +) + ADD_DEFINITIONS(-DPARTSETPLUGIN_EXPORTS) -ADD_LIBRARY(PartSetPlugin MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS}) +ADD_LIBRARY(PartSetPlugin MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES}) TARGET_LINK_LIBRARIES(PartSetPlugin ${PROJECT_LIBRARIES} ModelAPI) INCLUDE_DIRECTORIES( @@ -24,9 +28,5 @@ INCLUDE_DIRECTORIES( ../GeomAPI ) -SET(XML_RESOURCES - plugin-PartSet.xml -) - INSTALL(TARGETS PartSetPlugin DESTINATION plugins) INSTALL(FILES ${XML_RESOURCES} DESTINATION plugins) diff --git a/src/PartSetPlugin/plugin-PartSet.xml b/src/PartSetPlugin/plugin-PartSet.xml index 4a846cc42..db6893e50 100644 --- a/src/PartSetPlugin/plugin-PartSet.xml +++ b/src/PartSetPlugin/plugin-PartSet.xml @@ -2,8 +2,15 @@ - - + +