X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_MenuMgr.cpp;h=53145b795c649ac643ae3bce946d6767aa29f02d;hb=1dfcab3d738e427bea678317e167c587dfbff195;hp=fdb129faa151144ab62b56f27fda7406159d83d4;hpb=87b6a30a3afb8fb32e7e43ade8d9c947d9eb1684;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 fdb129faa..53145b795 --- 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-2020 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; } } @@ -170,8 +173,8 @@ void XGUI_MenuMgr::createFeatureActions() aGroup->featuresInfo(); std::list >::const_iterator aFIt = aFeaturesInfo.begin(), aFLast = aFeaturesInfo.end(); - int aFSize = aFeaturesInfo.size(); - for(int i = 0; aFIt != aFLast; aFIt++, i++) { + size_t aFSize = aFeaturesInfo.size(); + 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); @@ -209,7 +212,7 @@ QAction* XGUI_MenuMgr::buildAction(const std::shared_ptr& } 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; } anAction = aSalomeConnector->addFeatureOfNested(theWchName.c_str(), aFeatureInfo,