UndoManager Transaction Name History

Hello Everyone,

The UndoManager class makes available the name of the transaction currently in process via the function getCurrentTransactionName(), and it makes available the name of the single most recent completed transaction via the function getUndoDescription() (this second name is the transaction that will be rolled back if undo() is called).

I would find it useful to have available the entire history of transaction names going backwards from the current transaction name and the undo description. Some programs display that sort of history and allow users to pop multiple transactions off the list with a single click, for example.

I saw a juce forum topic on pretty much exactly the same thing from about 4 years ago (UndoManager question) and the suggestion was received positively. But it doesn’t seem to have been added, to date. I suppose it would be easy enough to subclass UndoManager and override undo(), redo(), beginNewTransaction(), . . . (taking care to call the overriden version in every case) and maintain my own list of transaction names. While this approach might not be soaking WET, it sure isn’t completely DRY either.

So I am hoping that I can revive interest in this change. Any guidance would be appreciated.

Thanks,
Isaac

3 Likes

+1. Unfortunately, being all member variables marked as private in the UndoManager, you can’t do much with a sub-class.

I too would find it useful to print the full undo history. Any updates on this?

5 Likes