Would be cool if the undo manager:
- there is UndoManager::setCurrentTransactionName but not UndoManager::getCurrentTransactionName
- i would like to implement a "Repeat last action" command, much like the one in graphics editor where you apply the last effect several times:
if (undoManager.canRedo()
&& undoManager.getNumActionsInCurrentTransaction() > 0)
{
Array<const UndoableAction*> actions;
undoManager.getActionsInCurrentTransaction(actions);
const UndoableAction* action = actions.getLast();
undoManager.perform(action);
}
obviously this doesn't work, cause i can't pass an immutable pointer again in the undo queue (which has the ownership of the UndoableAction). Some sort of virtual UndoableAction* UndoableAction::clone() const function would be cool (to be implemented by subclasses to pass internal parameters to a new action instance).
