Skip to content
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

Improve code for exit checks and save confirmation #140

Open
3 tasks
Moneyl opened this issue Feb 4, 2024 · 0 comments
Open
3 tasks

Improve code for exit checks and save confirmation #140

Moneyl opened this issue Feb 4, 2024 · 0 comments

Comments

@Moneyl
Copy link
Collaborator

Moneyl commented Feb 4, 2024

The code for doing things like opening the save confirmation dialog when closing NF is very ugly and hard to follow. It's split across multiple classes App, Gui, Window, SaveConfirmationDialog and uses bools to trigger this logic. It needs to be improved. I think a good way to fix this would be to add some events to App related to app exits:

  • An event to indicate that an exit has been requested
  • Maybe an event to indicate that a previous exit has been cancelled,
  • An event that returns a bool. Lets objects indicate if they're ready for exit or not.

Should also look into using events for the logic that makes the save confirmation dialog popup appear when you close a document with unsaved changes, create a new project, or close a project. It has the same problems.

Could make a central event class or use the built in Beef Event type. Up to whoever implements this. For the second event listed above we won't be able to use Event since we need the result of each callback instead of just the final one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Feature Creep
Development

No branches or pull requests

1 participant