myGroupId = "";
myWorkbenchId = "";
+ myToolBarId = "";
myPluginLibrary = "";
myInternal = false;
myGroupId = groupId;
}
+const std::string& Config_FeatureMessage::toolBarId() const
+{
+ return myToolBarId;
+}
+
+void Config_FeatureMessage::setToolBarId(const std::string& aId)
+{
+ myToolBarId = aId;
+}
+
const std::string& Config_FeatureMessage::workbenchId() const
{
return myWorkbenchId;
std::string myGroupId; ///<Id of feature's group
std::string myWorkbenchId; ///<Id of feature's workbench
+ std::string myToolBarId; ///<Id of toolbar/ By default == myWorkbenchId
std::string myDocumentKind; ///< kind of the document of the workbench (all documents if empty)
std::string myPluginLibrary; ///<Name of feature's library
CONFIG_EXPORT const std::string& tooltip() const;
/// Id of Feature's Group
CONFIG_EXPORT const std::string& groupId() const;
+ /// Id of Feature's Toolbar
+ CONFIG_EXPORT const std::string& toolBarId() const;
/// Id of Feature's Workbench
CONFIG_EXPORT const std::string& workbenchId() const;
/// Kind of a document which contains the feature
CONFIG_EXPORT void setTooltip(const std::string& tooltip);
///Set id of Feature's Group
CONFIG_EXPORT void setGroupId(const std::string& groupId);
+ ///Set id of Feature's Group
+ CONFIG_EXPORT void setToolBarId(const std::string& aId);
///Set id of Feature's Workbench
CONFIG_EXPORT void setWorkbenchId(const std::string& workbenchId);
///Set kind of a document which contains the feature
//The m_last* variables always defined before fillFeature() call. XML is a tree.
} else if (isNode(theNode, NODE_WORKBENCH, NODE_GROUP, NULL)) {
storeAttribute(theNode, _ID);
+ storeAttribute(theNode, GROUP_TOOLBAR);
storeAttribute(theNode, WORKBENCH_DOC, true);
} else if (myIsProcessWidgets) {
// widgets, like shape_selector or containers, like toolbox
outFeatureMessage->setText(aText);
std::string aToolTip = Config_Translator::translate(anId,
getProperty(theFeatureNode, FEATURE_TOOLTIP));
- outFeatureMessage->setTooltip(aToolTip);
outFeatureMessage->setIcon(getProperty(theFeatureNode, FEATURE_ICON));
outFeatureMessage->setKeysequence(getProperty(theFeatureNode, FEATURE_KEYSEQUENCE));
- outFeatureMessage->setGroupId(restoreAttribute(NODE_GROUP, _ID));
- outFeatureMessage->setWorkbenchId(restoreAttribute(NODE_WORKBENCH, _ID));
+
+ std::string aGroupName = restoreAttribute(NODE_GROUP, _ID);
+ std::string aWBNName = restoreAttribute(NODE_WORKBENCH, _ID);
+ std::string isGroupToolbarId = restoreAttribute(NODE_GROUP, GROUP_TOOLBAR);
+ bool isGroupToolbar = false;
+ if (isGroupToolbarId.length() > 0)
+ isGroupToolbar = (isGroupToolbarId == "yes");
+ outFeatureMessage->setGroupId(aGroupName);
+ outFeatureMessage->setWorkbenchId(aWBNName);
+ outFeatureMessage->setToolBarId(isGroupToolbar ? aGroupName : aWBNName);
+
// Get document kind of a feature, if empty set workbench's kind (might be empty too)
std::string aDocKind = getProperty(theFeatureNode, FEATURE_DOC);
if(aDocKind.empty()) {
const static char* SOURCE_FILE = "path";
// NODE_FEATURE properties
const static char* FEATURE_TOOLTIP = "tooltip";
+const static char* GROUP_TOOLBAR = "toolbar";
const static char* FEATURE_ICON = "icon";
const static char* FEATURE_TEXT = "title";
const static char* FEATURE_KEYSEQUENCE = "keysequence";
<source path="pipe_widget.xml"/>
</feature>
</group>
- <group id="Boolean">
+ <group id="Boolean" toolbar="yes">
<feature id="Cut" title="Cut" tooltip="Perform boolean cut operation with objects" icon="icons/Features/bool_cut.png"
auto_preview="false">
<source path="boolean_widget.xml"/>
}
text = QString::fromUtf8(theMessage->text().c_str());
toolTip = QString::fromUtf8(theMessage->tooltip().c_str());
+ toolBar = QString::fromStdString(theMessage->toolBarId());
QString aShortcutStr = QString::fromStdString(theMessage->keysequence());
if (!aShortcutStr.isEmpty()) {
shortcut = QKeySequence(aShortcutStr);
QString iconText; //!< action's descriptive icon text
QString iconFile; //!< path to icon's file. Can not be initialized from QAction
QString toolTip; //!< action's tooltip
+ QString toolBar; //!< A name of toolbar. By default = group of features name
// QString statusTip;
// QString whatsThis;
QKeySequence shortcut; //!< action's primary shortcut key