djfun / audio-visualizer-python

a little GUI tool to render visualization videos of audio files
Other
242 stars 58 forks source link

Undo/redo functionality #56

Closed tassaron closed 7 years ago

tassaron commented 7 years ago

Undo/redo functionality is essential for an editing program of any kind. Qt has an Undo Framework that seems straightforward to use, but it requires changing every potential user action into a QUndoCommand object and giving it a corresponding undo method. So this feature will require a lot of code changes.

The undo stack will only be used for the main window and component widgets. Components should be easy to convert by changing code in one place (component.py). The biggest thing is changing the component list actions and preset actions in mainwindow.py and presetmanager.py.

Hotkeys should be the standard Ctrl-Z for undo and Ctrl-Shift-Z/Ctrl-Y for redo. There could be undo/redo buttons next to the Projects button in the GUI.

tassaron commented 7 years ago

As of 22978a0635e906f8ebfa1de81cdc38fd96aad756, the following actions are undoable:

Components may temporarily disable the merging of change actions as a cheap way to distinguish a memorable change from a minor change, e.g., clicking the [...] button vs. typing one character in a filepath.

Any component setting not represented by a widget must have a custom action defined, which is currently only used for the Conway's Game of Life component.

Opening a project or creating a new project clears the undo list.

undoboxc avpwindowsscreen2