Salome HOME
updated copyright message
[modules/shaper.git] / src / XGUI / XGUI_OperationMgr.cpp
index 09aa5b6cacd286ba5bcea7c5735cefdd4b557026..5db1d07a7f8f405993ff2c7fca3df30d2eea37fc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2022  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -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;