X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_MenuMgr.cpp;h=6aa634fe34279ac92de74f2f4a673e8039032dec;hb=cab05e015079888e5cd3a501e9d5b6d23facfc96;hp=42253d5df696ed9fda86869f130d9ded9056275b;hpb=23190be3e855ee23fdae8cd7edfab2d6339d427a;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_MenuMgr.cpp b/src/XGUI/XGUI_MenuMgr.cpp old mode 100755 new mode 100644 index 42253d5df..6aa634fe3 --- a/src/XGUI/XGUI_MenuMgr.cpp +++ b/src/XGUI/XGUI_MenuMgr.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2022 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,9 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include @@ -41,6 +40,7 @@ #endif #include +#include #include #include @@ -75,15 +75,18 @@ void XGUI_MenuMgr::addFeature(const std::shared_ptr& theM #endif return; } + QString aWchName = ModuleBase_Tools::translate("workshop", theMessage->workbenchId()); + theMessage->setToolBarId(ModuleBase_Tools::translate("workshop", + theMessage->workbenchId()).toStdString()); #ifdef HAVE_SALOME - std::shared_ptr aWorkbench = findWorkbench(theMessage->workbenchId()); + std::string aWchNameString = aWchName.toStdString(); + std::shared_ptr aWorkbench = findWorkbench(aWchNameString); std::shared_ptr aGroup = aWorkbench->findGroup(theMessage->groupId()); aGroup->setFeatureInfo(theMessage); #else ActionInfo aFeatureInfo; aFeatureInfo.initFrom(theMessage); - QString aWchName = QString::fromStdString(theMessage->workbenchId()); QStringList aNestedFeatures = QString::fromStdString(theMessage->nestedFeatures()).split(" ", QString::SkipEmptyParts); QList aNestedActList; @@ -99,7 +102,7 @@ void XGUI_MenuMgr::addFeature(const std::shared_ptr& theM } if (aNestedActions.contains(FEATURE_WHEN_NESTED_ABORT)) { QAction* anAction = anActionsMgr->operationStateAction(XGUI_ActionsMgr::AbortAll); - QObject::connect(anAction, SIGNAL(triggered()), anOperationMgr, SLOT(abortAllOperations())); + QObject::connect(anAction, SIGNAL(triggered()), anOperationMgr, SLOT(onAbortAllOperation())); aNestedActList << anAction; } } @@ -171,7 +174,7 @@ void XGUI_MenuMgr::createFeatureActions() std::list >::const_iterator aFIt = aFeaturesInfo.begin(), aFLast = aFeaturesInfo.end(); size_t aFSize = aFeaturesInfo.size(); - for(int i = 0; aFIt != aFLast; aFIt++, i++) { + for(size_t i = 0; aFIt != aFLast; aFIt++, i++) { std::shared_ptr aMessage = *aFIt; bool aUseSeparator = i == aFSize-1; QAction* aAction = buildAction(aMessage, aWchName, aUseSeparator); @@ -203,13 +206,13 @@ QAction* XGUI_MenuMgr::buildAction(const std::shared_ptr& XGUI_OperationMgr* anOperationMgr = myWorkshop->operationMgr(); XGUI_ActionsMgr* anActionsMgr = myWorkshop->actionsMgr(); if (aNestedActions.contains(FEATURE_WHEN_NESTED_ACCEPT)) { - QAction* anAction = anActionsMgr->operationStateAction(XGUI_ActionsMgr::AcceptAll); + anAction = anActionsMgr->operationStateAction(XGUI_ActionsMgr::AcceptAll); QObject::connect(anAction, SIGNAL(triggered()), anOperationMgr, SLOT(commitAllOperations())); aNestedActList << anAction; } if (aNestedActions.contains(FEATURE_WHEN_NESTED_ABORT)) { - QAction* anAction = anActionsMgr->operationStateAction(XGUI_ActionsMgr::AbortAll); - QObject::connect(anAction, SIGNAL(triggered()), anOperationMgr, SLOT(abortAllOperations())); + anAction = anActionsMgr->operationStateAction(XGUI_ActionsMgr::AbortAll); + QObject::connect(anAction, SIGNAL(triggered()), anOperationMgr, SLOT(onAbortAllOperation())); aNestedActList << anAction; } anAction = aSalomeConnector->addFeatureOfNested(theWchName.c_str(), aFeatureInfo,