From 047a6c0106078a9953f72510f4e204313f2bcf72 Mon Sep 17 00:00:00 2001 From: azv Date: Wed, 13 Dec 2017 13:40:36 +0300 Subject: [PATCH] Add names to transactions operating with folders to have named lines in Undo/Redo lists (issue #2338) --- src/XGUI/XGUI_Workshop.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index bff026792..9d3a7bbea 100755 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -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(); } -- 2.39.2