Salome HOME
[bos #30881] EDF 25913 - differetn behavior between contextual menu and F2 CR30881
authorakondrat <alexey.kondratyev@opencascade.com>
Thu, 6 Oct 2022 09:58:28 +0000 (12:58 +0300)
committerakondrat <alexey.kondratyev@opencascade.com>
Wed, 19 Oct 2022 05:56:07 +0000 (08:56 +0300)
Remove a feature of renaming objects in sketch mode by using F2.

src/XGUI/XGUI_OperationMgr.cpp

index 09aa5b6cacd286ba5bcea7c5735cefdd4b557026..e8ea75fa06285e197712614a4df74bef1db259cb 100644 (file)
@@ -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 <ModuleBase_IPropertyPanel.h>
 #include <ModuleBase_ModelWidget.h>
@@ -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;