From 2695cffcf53965090e593158f74f470ee2e634d5 Mon Sep 17 00:00:00 2001 From: sbh Date: Mon, 8 Dec 2014 18:29:21 +0300 Subject: [PATCH] Issue #315: Disable "Remove" and "Duplicate" if no part created --- src/Config/Config_FeatureReader.cpp | 7 ++++++- src/PartSetPlugin/CMakeLists.txt | 10 +++++----- src/PartSetPlugin/plugin-PartSet.xml | 11 +++++++++-- 3 files changed, 20 insertions(+), 8 deletions(-) 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 @@ - - + + -- 2.39.2