-#ifdef HAVE_SALOME
- XGUI_SalomeConnector* aSalomeConnector = aWorkshop->salomeConnector();
- QAction* aAction;
- if (isColumnButton) {
- aAction = aSalomeConnector->addFeatureOfNested(aWchName, aFeatureInfo, aNestedActList);
- } else {
- //Issue #650: in the SALOME mode the tooltip should be same as text
- aFeatureInfo.toolTip = aFeatureInfo.text;
- aAction = aSalomeConnector->addFeature(aWchName, aFeatureInfo);
- }
- aSalomeConnector->setNestedActions(aFeatureInfo.id, aNestedFeatures);
- aSalomeConnector->setDocumentKind(aFeatureInfo.id, aDocKind);
-
- aWorkshop->actionsMgr()->addCommand(aAction);
- aWorkshop->module()->actionCreated(aAction);
-#else
- //Find or create Workbench
- AppElements_MainMenu* aMenuBar = aWorkshop->mainWindow()->menuObject();
- AppElements_Workbench* aPage = aMenuBar->findWorkbench(aWchName);
- if (!aPage) {
- aPage = aWorkshop->addWorkbench(aWchName);
- }
- //Find or create Group
- QString aGroupName = QString::fromStdString(theMessage->groupId());
- AppElements_MenuGroupPanel* aGroup = aPage->findGroup(aGroupName);
- if (!aGroup) {
- aGroup = aPage->addGroup(aGroupName);
- }
- // Check if hotkey sequence is already defined:
- XGUI_ActionsMgr* anActionsMgr = aWorkshop->actionsMgr();
- QKeySequence aHotKey = anActionsMgr->registerShortcut(aFeatureInfo.shortcut);
- if(aHotKey != aFeatureInfo.shortcut) {
- aFeatureInfo.shortcut = aHotKey;
- }
- // Create feature...
- AppElements_Command* aCommand = aGroup->addFeature(aFeatureInfo,
- aDocKind,
- aNestedFeatures);
- // Enrich created button with accept/abort buttons if necessary
- AppElements_Button* aButton = aCommand->button();
- if (aButton->isColumnButton()) {
- aButton->setAdditionalButtons(aNestedActList);
- }
- aWorkshop->actionsMgr()->addCommand(aCommand);
- aWorkshop->module()->actionCreated(aCommand);
-#endif