I build multi-document software, each document has its own history list, and every action performed on the document appears in the document's history.
So far everything is fine, the question begins because there are settings that need to be changed globally, such as to create a global 'style' that can be used in some documents.
And there should be an option to undo style creation, and option to change style settings and undo the changes. And option to delete style and undo deletion.
How should I deal with this? I was thinking of doing another history that is global, but it could create a problem in the following case:
- The user will create a new style [this will appear in global history]
- The user applies the same style to a particular document [this will appear in the private history of the document]
- The user returns to global history and wants to undo the style creation.
What's the right way to deal with this?
In the background there will be one global action list, this list will contain all the actions that are done in all documents and also global actions such as style creation.
But the history pane will display a undo list for the active document, this list will actually the global list but filtered, so the user will only see actions that belong to active document and global actions only.
Is this a good idea? Is it possible to implement such a thing in code?