From: akondrat Date: Thu, 6 Oct 2022 09:58:28 +0000 (+0300) Subject: [bos #30881] EDF 25913 - differetn behavior between contextual menu and F2 X-Git-Tag: V9_10_0b1~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FCR30881;p=modules%2Fshaper.git [bos #30881] EDF 25913 - differetn behavior between contextual menu and F2 Remove a feature of renaming objects in sketch mode by using F2. --- diff --git a/src/XGUI/XGUI_OperationMgr.cpp b/src/XGUI/XGUI_OperationMgr.cpp index 09aa5b6ca..e8ea75fa0 100644 --- a/src/XGUI/XGUI_OperationMgr.cpp +++ b/src/XGUI/XGUI_OperationMgr.cpp @@ -29,6 +29,8 @@ #include "XGUI_Tools.h" #include "XGUI_ObjectsBrowser.h" #include "XGUI_ContextMenuMgr.h" +#include "XGUI_Selection.h" +#include "XGUI_SelectionMgr.h" #include #include @@ -106,9 +108,16 @@ bool XGUI_ShortCutListener::eventFilter(QObject *theObject, QEvent *theEvent) isAccepted = myOperationMgr->onProcessDelete(theObject); break; case Qt::Key_F2: - myOperationMgr->xworkshop()->objectBrowser()->onEditItem(); + { + QObjectPtrList anObjects = myOperationMgr->xworkshop()->selector()->selection()->selectedObjects(); + if (myOperationMgr->xworkshop()->abortAllOperations()) + { + myOperationMgr->xworkshop()->objectBrowser()->setObjectsSelected(anObjects); + myOperationMgr->xworkshop()->objectBrowser()->onEditItem(); + } isAccepted = true; break; + } default: isAccepted = myOperationMgr->onKeyReleased(theObject, aKeyEvent); break;