From: mpv Date: Mon, 20 May 2019 13:59:21 +0000 (+0300) Subject: Task #2924 : Ability to remove a result. Disable ability to remove groups and fields... X-Git-Tag: VEDF2019Lot4~133 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4d3315763b20ea13044d3b6bda5297714fba01c0;p=modules%2Fshaper.git Task #2924 : Ability to remove a result. Disable ability to remove groups and fields results because it has not sense and they are not-selectable in normal use-case. --- diff --git a/src/XGUI/XGUI_ContextMenuMgr.cpp b/src/XGUI/XGUI_ContextMenuMgr.cpp index 0b7d41983..536c1b0d8 100644 --- a/src/XGUI/XGUI_ContextMenuMgr.cpp +++ b/src/XGUI/XGUI_ContextMenuMgr.cpp @@ -338,7 +338,7 @@ void XGUI_ContextMenuMgr::updateObjectBrowserMenu() } } // end single selection - } else { // multiselection + } else { // multi-selection // parameter is commented because the actions are not in the list of result parameter actions if (hasResult /*&& (!hasParameter)*/) { action("SHOW_CMD")->setEnabled(true); @@ -347,7 +347,7 @@ void XGUI_ContextMenuMgr::updateObjectBrowserMenu() action("SHADING_CMD")->setEnabled(true); action("WIREFRAME_CMD")->setEnabled(true); } - } // end multiselection + } // end multi-selection // Check folder management commands state if only features are selected if ((!hasResult) && hasFeature && (!hasParameter) && (!hasCompositeOwner) && @@ -468,7 +468,7 @@ void XGUI_ContextMenuMgr::updateObjectBrowserMenu() } } if (aDeactivate) { - // If at leas a one objec can not be edited then Show/Hide has to be disabled + // If at leas a one object can not be edited then Show/Hide has to be disabled action("SHOW_CMD")->setEnabled(false); action("HIDE_CMD")->setEnabled(false); action("SHOW_ONLY_CMD")->setEnabled(false); diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index d0099ef11..c6bd9299d 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -1835,7 +1835,9 @@ void XGUI_Workshop::deleteObjects() std::list aResults; for(QObjectPtrList::const_iterator anIt = anObjects.begin(); anIt != anObjects.end(); anIt++) { ResultPtr aRes = std::dynamic_pointer_cast(*anIt); - if (aRes.get() && aRes->data()->isValid() && !aRes->data()->isDeleted()) + if (aRes.get() && aRes->data()->isValid() && !aRes->data()->isDeleted() && + aRes->groupName() != ModelAPI_ResultGroup::group() && // don't remove groups and fields + aRes->groupName() != ModelAPI_ResultField::group()) // because they are badly selected aResults.push_back(aRes); } if (!aResults.empty()) {