From 092080c69cd1f9667da6062eee0052c536dfbb38 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Mon, 3 Nov 2014 13:57:57 +1100 Subject: [PATCH] Group the commands with begin/end macros. --- apps/opencs/view/render/mousestate.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/opencs/view/render/mousestate.cpp b/apps/opencs/view/render/mousestate.cpp index 5fda88637..21f3aca78 100644 --- a/apps/opencs/view/render/mousestate.cpp +++ b/apps/opencs/view/render/mousestate.cpp @@ -7,6 +7,7 @@ #include #include +#include #include "../../model/settings/usersettings.hpp" #include "../../model/world/commands.hpp" @@ -231,12 +232,14 @@ namespace CSVRender // use the saved scene node name since the physics model has not moved yet std::string referenceId = mPhysics->sceneNodeToRefId(mGrabbedSceneNode); + mParent->mDocument.getUndoStack().beginMacro (QObject::tr("Move Object")); mParent->mDocument.getUndoStack().push(new CSMWorld::ModifyCommand(*mIdTableModel, mIdTableModel->getModelIndex(referenceId, mColIndexPosX), pos.x)); mParent->mDocument.getUndoStack().push(new CSMWorld::ModifyCommand(*mIdTableModel, mIdTableModel->getModelIndex(referenceId, mColIndexPosY), pos.y)); mParent->mDocument.getUndoStack().push(new CSMWorld::ModifyCommand(*mIdTableModel, mIdTableModel->getModelIndex(referenceId, mColIndexPosZ), pos.z)); + mParent->mDocument.getUndoStack().endMacro(); // FIXME: highlight current object? //mCurrentObj = mGrabbedSceneNode; // FIXME: doesn't work?