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

[RegPreview] Various improvements on how files are saved #37628

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

htcfreek
Copy link
Collaborator

@htcfreek htcfreek commented Feb 25, 2025

Summary of the Pull Request

Important

  • Conflicts with [RegPreview] Init with header and add NEW button #37626 and needs update after this to add the following things to the "NEW" code:
    • Correct handling of save button after loading new file.
    • Stop if save fails.
    • Use new "AskFileName" method.
    • Update "unsaved" indicator.

This PR implements various fixes and improvements into RegistryPreview for saving files:

  1. An unsaved file indicator in the title bar like in Notepad.
  2. The save button behaves like a "save as" button, if the file does not exist on disk like in Notepad.
  3. If the app gets closed without saving and the file does not exist on disk, then the user is now asked for the path.
  4. Failed save actions are handled now correctly on dirty closing, opening files and all other actions that require saving the current state. They will stop the process.
  5. A fix for an incorrect enabled state of the save button after opening, reloading and saving a file.
  6. Reuse file name on save as button, if known. Otherwise use "new file" template name like in Notepad.
  7. Fix an app crash if you click the window's close button a second time while the "Should save?" dialog is opened.

image

PR Checklist

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Local test build.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@htcfreek htcfreek self-assigned this Feb 25, 2025

This comment has been minimized.

This comment has been minimized.

@htcfreek htcfreek added the Status-Blocked We can't make progress due to a dependency or issue label Feb 25, 2025
@htcfreek htcfreek marked this pull request as ready for review March 1, 2025 00:04
@htcfreek htcfreek marked this pull request as draft March 1, 2025 22:04
@htcfreek htcfreek added the Product-Registry Preview Refers to the Registry Preview PowerToy label Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Product-Registry Preview Refers to the Registry Preview PowerToy Status-Blocked We can't make progress due to a dependency or issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant