// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-/*
- * XGUI_ActionsMgr.cpp
- */
-
#ifndef HAVE_SALOME
#include <AppElements_Command.h>
#endif
myActions.insert(aId, theCmd);
#ifdef HAVE_SALOME
XGUI_Workshop* aWorkshop = static_cast<XGUI_Workshop*>(parent());
- myNestedActions[aId] = aWorkshop->salomeConnector()->nestedActions(aId);
+ const std::shared_ptr<Config_FeatureMessage>& anInfo =
+ aWorkshop->salomeConnector()->featureInfo(aId);
+ if (anInfo.get())
+ myNestedActions[aId] = QString::fromStdString(anInfo->nestedFeatures())
+ .split(" ", QString::SkipEmptyParts);
#else
AppElements_Command* aXCmd = dynamic_cast<AppElements_Command*>(theCmd);
myNestedActions[aId] = aXCmd->nestedCommands();
void XGUI_ActionsMgr::updateCommandsStatus()
{
- setAllEnabled(true);
+ setAllEnabled();
XGUI_Selection* aSelection = myWorkshop->selector()->selection();
if (aSelection->getSelected(ModuleBase_ISelection::Viewer).size() > 0)
updateOnViewSelection();
aResult->setToolTip("Help");
}
break;
+ case Preview: {
+ aResult = new QAction("See preview", theParent);
+ aResult->setToolTip("Compute preview");
+ }
+ break;
default:
break;
}
return aResult;
}
-void XGUI_ActionsMgr::setAllEnabled(bool isEnabled)
+void XGUI_ActionsMgr::setAllEnabled()
{
foreach(QString eachAction, myActions.keys()) {
- setActionEnabled(eachAction, isEnabled);
+ if (myActions.contains(eachAction)) {
+ QAction* aAction = myActions[eachAction];
+ aAction->setEnabled(true);
+ }
}
}
#ifdef HAVE_SALOME
QString aId = eachAction->data().toString();
if (!aId.isEmpty()) {
- aCmdDocKind = aWorkshop->salomeConnector()->documentKind(aId);
+ aCmdDocKind = QString::fromStdString(
+ aWorkshop->salomeConnector()->featureInfo(aId)->documentKind());
}
#else
AppElements_Command* aCmd = dynamic_cast<AppElements_Command*>(eachAction);
- aCmdDocKind = aCmd->documentKind();
+ aCmdDocKind = QString::fromStdString(aCmd->featureMessage()->documentKind());
#endif
if(!aCmdDocKind.isEmpty() && aCmdDocKind != aDocKind) {
eachAction->setEnabled(false);