From c26ba7fe2810cf8af8bdff8b210da4b4079ed01b Mon Sep 17 00:00:00 2001 From: akondrat Date: Thu, 6 Oct 2022 12:58:28 +0300 Subject: [PATCH] [bos #30881] EDF 25913 - differetn behavior between contextual menu and F2 Remove a feature of renaming objects in sketch mode by using F2. --- src/XGUI/XGUI_OperationMgr.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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; -- 2.39.2