Skip to content

implementing actions #7859

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 134 commits into
base: master
Choose a base branch
from
Open

Conversation

szeli1
Copy link
Contributor

@szeli1 szeli1 commented Apr 22, 2025

This is the first PR in a series of PRs in the goal of achieving #7734

Roadmap:
Refactoring_gui_branching

This PR implements Actions, a layer between the user and the GUI. Every user interaction will be routed through actions. Actions will provide a better way of journalling and overall clarity in code. The end goal is replacing core JO and Project Journal without saving to xml text. This way loading in data is faster and takes up less space in memory.

This PR replaces the old shortcut system struct with an ActionStruct. Action structs hold all the data needed to construct an action, and some additional data that decides how actions are called. A gui action input / output class is added that stores lmms specific datatypes. A gui action class is also implemented, it will be derived from the QUndoCommand class in the future. QActions are used as function pointers for these GuiActions. Classes that inherit InteractiveModelView need to implement 2 virtual functions:

// used for getting the shortcut hint stored as a static variable
virtual const QString& getShortcutMessage() = 0;`
// used for initiating an `ActionStruct` array and QActions, placed in constructors
virtual void addActions(std::vector<ActionStruct>& targetList) = 0;

How to test: test if the features in #7488 work (this PR is more like a refactor, so the 7488 features should work)

Everything should work the same way it worked in #7488
This PR branches off off #7488, so #7488 should be merged before this

@szeli1 szeli1 changed the title Whai implementing actions implementing actions Apr 22, 2025
@szeli1 szeli1 force-pushed the WHAI_implementing_actions branch from 197601a to 6c65c8e Compare April 23, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant