]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Add names to transactions operating with folders to have named lines in Undo/Redo...
authorazv <azv@opencascade.com>
Wed, 13 Dec 2017 10:40:36 +0000 (13:40 +0300)
committerazv <azv@opencascade.com>
Wed, 13 Dec 2017 10:40:36 +0000 (13:40 +0300)
src/XGUI/XGUI_Workshop.cpp

index bff02679288cdb7013a859d500930f6b0ebeedb9..9d3a7bbea2ea508924cf4370ed22eb3f17fff6b4 100755 (executable)
@@ -2630,7 +2630,9 @@ void XGUI_Workshop::insertFeatureFolder()
   SessionPtr aMgr = ModelAPI_Session::get();
   DocumentPtr aDoc = aMgr->activeDocument();
 
-  aMgr->startOperation();
+  QString aDescription = contextMenuMgr()->action("INSERT_FOLDER_CMD")->text();
+
+  aMgr->startOperation(aDescription.toStdString());
   aDoc->addFolder(aFeature);
   aMgr->finishOperation();
 }
@@ -2650,7 +2652,10 @@ void XGUI_Workshop::insertToFolder(bool isBefore)
   if (!aFolder.get())
     return;
 
-  aMgr->startOperation();
+  QString aDescription = contextMenuMgr()->action(
+    isBefore ? "ADD_TO_FOLDER_BEFORE_CMD" : "ADD_TO_FOLDER_AFTER_CMD")->text();
+
+  aMgr->startOperation(aDescription.toStdString());
   aDoc->moveToFolder(aFeatures, aFolder);
   aMgr->finishOperation();
 }
@@ -2664,7 +2669,11 @@ void XGUI_Workshop::moveOutFolder(bool isBefore)
   SessionPtr aMgr = ModelAPI_Session::get();
   DocumentPtr aDoc = aMgr->activeDocument();
 
-  aMgr->startOperation();
+
+  QString aDescription = contextMenuMgr()->action(
+    isBefore ? "ADD_OUT_FOLDER_BEFORE_CMD" : "ADD_OUT_FOLDER_AFTER_CMD")->text();
+
+  aMgr->startOperation(aDescription.toStdString());
   aDoc->removeFromFolder(aFeatures, isBefore);
   aMgr->finishOperation();
 }