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~101^2~63 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ae556b65c99e850165eb7dba41e482129225d782;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 22ec2603c..2c2f1a7ec 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 4586610e2..b4a0eb3b1 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -1841,7 +1841,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()) {