From: vsv Date: Mon, 19 May 2014 07:37:06 +0000 (+0400) Subject: Activate/Deactivate command in Part pop-up menu (issue #23) X-Git-Tag: V_0.2~47 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4ffe187cd682db5907fbc295c85fc4dedee5d489;p=modules%2Fshaper.git Activate/Deactivate command in Part pop-up menu (issue #23) --- diff --git a/src/XGUI/XGUI_ContextMenuMgr.cpp b/src/XGUI/XGUI_ContextMenuMgr.cpp index 2a8fe108b..753027907 100644 --- a/src/XGUI/XGUI_ContextMenuMgr.cpp +++ b/src/XGUI/XGUI_ContextMenuMgr.cpp @@ -4,6 +4,9 @@ #include "XGUI_ObjectsBrowser.h" #include "XGUI_SelectionMgr.h" +#include +#include + #include #include #include @@ -81,8 +84,12 @@ QMenu* XGUI_ContextMenuMgr::objectBrowserMenu() const FeaturePtr aFeature = aFeatures.first(); QMenu* aMenu = new QMenu(); if (aFeature->getKind() == "Part") { - //TODO: Check that feature is active - aMenu->addAction(action("ACTIVATE_PART_CMD")); + boost::shared_ptr aMgr = ModelAPI_PluginManager::get(); + boost::shared_ptr aFeaDoc = aFeature->data()->docRef("PartDocument")->value(); + if (aMgr->currentDocument() == aFeaDoc) + aMenu->addAction(action("DEACTIVATE_PART_CMD")); + else + aMenu->addAction(action("ACTIVATE_PART_CMD")); } else { aMenu->addAction(action("EDIT_CMD")); }