X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_ContextMenuMgr.cpp;h=494ecf28d011cf8dcf54d04dae64ac496ebd843e;hb=564df60468b225bbce2f1cc055299b47c3be9355;hp=868da0552900f20958902a229ee81dd13f4a7446;hpb=eb57ef7dd9fa2816da36a5a4066bc41ebdea2ad7;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_ContextMenuMgr.cpp b/src/XGUI/XGUI_ContextMenuMgr.cpp index 868da0552..494ecf28d 100644 --- a/src/XGUI/XGUI_ContextMenuMgr.cpp +++ b/src/XGUI/XGUI_ContextMenuMgr.cpp @@ -8,6 +8,7 @@ #include "XGUI_ViewerProxy.h" #include "XGUI_Selection.h" #include "XGUI_SalomeConnector.h" +#include "XGUI_Tools.h" #include @@ -97,6 +98,16 @@ QAction* XGUI_ContextMenuMgr::action(const QString& theId) const return 0; } +QAction* XGUI_ContextMenuMgr::actionByName(const QString& theName) const +{ + foreach(QAction* eachAction, myActions) { + if (eachAction->text() == theName) { + return eachAction; + } + } + return NULL; +} + QStringList XGUI_ContextMenuMgr::actionIds() const { return myActions.keys(); @@ -144,18 +155,8 @@ QMenu* XGUI_ContextMenuMgr::objectBrowserMenu() const bool hasResult = false; bool hasFeature = false; bool hasParameter = false; - foreach(ObjectPtr aObj, aObjects) - { - FeaturePtr aFeature = std::dynamic_pointer_cast(aObj); - ResultPtr aResult = std::dynamic_pointer_cast(aObj); - ResultParameterPtr aConstruction = std::dynamic_pointer_cast(aResult); - - hasResult = (aResult.get() != NULL); - hasFeature = (aFeature.get() != NULL); - hasParameter = (aConstruction.get() != NULL); - if (hasFeature && hasResult && hasParameter) - break; - } + XGUI_Tools::checkObjects(aObjects, hasResult, hasFeature, hasParameter); + //Process Feature if (aSelected == 1) { ObjectPtr aObject = aObjects.first();