From e917a17c8ba3d87adb7624c87a763a3d4438db12 Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 7 Sep 2015 11:14:38 +0300 Subject: [PATCH] Issue #807: Show/hide commands have to be accessible only for current part and constructions in PartSet --- src/XGUI/XGUI_ContextMenuMgr.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/XGUI/XGUI_ContextMenuMgr.cpp b/src/XGUI/XGUI_ContextMenuMgr.cpp index adbbdc5a2..73889e19a 100644 --- a/src/XGUI/XGUI_ContextMenuMgr.cpp +++ b/src/XGUI/XGUI_ContextMenuMgr.cpp @@ -229,15 +229,14 @@ void XGUI_ContextMenuMgr::updateObjectBrowserMenu() } // Show/Hide command has to be disabled for objects from non active document - XGUI_ObjectsBrowser* aOB = myWorkshop->objectBrowser(); - XGUI_DataModel* aModel = aOB->dataModel(); bool aDeactivate = false; foreach (ObjectPtr aObj, aObjects) { - Qt::ItemFlags aFlags = aModel->flags(aModel->objectIndex(aObj)); - // Check is the object is accessible for editing - if ((aFlags & Qt::ItemIsEditable) == 0) { - aDeactivate = true; - break; + if (!aObj->document()->isActive()) { + if ((aObj->document() != ModelAPI_Session::get()->moduleDocument()) || + aObj->groupName() == ModelAPI_ResultPart::group()) { + aDeactivate = true; + break; + } } } if (aDeactivate) { -- 2.39.2