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

GUI: Fix usage of dummy autosave in empty autosave slot #5363

Merged
merged 3 commits into from Nov 5, 2023

Conversation

macca8
Copy link
Contributor

@macca8 macca8 commented Oct 15, 2023

This PR seeks to clean up a few anomalies related to setting up an empty autosave slot in the Save dialog.

The dummy autosave exists to write protect an otherwise empty autosave slot, and as a bonus, also identifies the autosave slot. This is achieved by accessing the dummy autosave settings stored in the _saveList array.

Currently, this approach is only applied when setting the Save button in List View.

Other aspects of an empty autosave slot, such as the Delete button (List View) and the autosave button (Grid View), are currently set up using a less consistent approach.

This results in most engines displaying these anomalies in the Save dialog:

  • in List View, the (empty) autosave slot’s Delete button is enabled, but, if selected, does nothing except launch the Delete Confirmation dialog.
  • in Grid View, the empty autosave button is identified only by its slot number, though, if selected, the Savename Dialog launches and displays the dummy autosave name.
  • in Grid View, the autosave button is enabled, allowing user access to the empty autosave slot.

We fix these issues by redirecting the relevant calls for getWriteProtectedFlag(), getDeletableFlag() and getDescription() to target the correct dummy autosave settings stored in the _saveList array.

Since the changes are minimal, I’ve included them all in a single commit.

Edit: I failed to define the isWriteProtected variable type initially, then reverted that change to match how it's initialized and used in updateSelection().
Unfortunately, I'm unable to squash these extra commits into the original commit without closing this PR and starting over, so, if necessary, please do so on my behalf. Thanks..

Changes include:
- the empty autosave slot's Delete button is now disabled (since no save file exists).
- adds the dummy autosave's name to the empty autosave button's label & tooltip.
- the empty autosave button is now disabled.
@sev-
Copy link
Member

sev- commented Nov 5, 2023

Thank you!

@sev- sev- merged commit 0feaeb1 into scummvm:master Nov 5, 2023
8 checks passed
@macca8 macca8 deleted the Fix-empty-autosave-slot branch November 6, 2023 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants