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

Treat failed save actions as cancel actions. #146

Merged

Conversation

cristian64
Copy link
Collaborator

Previously, if the user exited the file browser dialog without saving the file (voluntarily, or due to I/O error), DME would still exit (or wipe out the watch model; depending on the case), causing unrecoverable data loss.

Test plan:

  • Launch DME.
  • Add a few watch entries to mark the model with unsaved changes.
  • Clear the watch list via the File > Clear the watch list action.
  • A confirmation dialog with the Cancel, No, and Yes options should appear.
  • Click Yes
  • Once the file browser dialog opens, close it without selecting a file (or choose a filepath where the user does not have write permissions).

Previous behavior: The watch list was wrongly cleared, without the user having saved it.

New behavior: The user gets back to DME, as if Cancel had been selected in the confirmation dialog.

Previously, if the user exited the file browser dialog without saving
the file (voluntarily, or due to I/O error), DME would still exit (or
wipe out the watch model; depending on the case), causing unrecoverable
data loss.

Test plan:
- Launch DME.
- Add a few watch entries to mark the model with unsaved changes.
- Clear the watch list via the **File > Clear the watch list** action.
- A confirmation dialog with the **Cancel**, **No**, and **Yes** options
  should appear.
- Click **Yes**
- Once the file browser dialog opens, close it without selecting a file
  (or choose a filepath where the user does not have write permissions).

Previous behavior: The watch list was wrongly cleared, without the user
having saved it.

New behavior: The user gets back to DME, as if **Cancel** had been
selected in the confirmation dialog.
Copy link
Collaborator

@dreamsyntax dreamsyntax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I'm sure I've been burned by this before without realizing it.

@dreamsyntax dreamsyntax merged commit bd8f6b0 into aldelaro5:master May 18, 2024
4 checks passed
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.

2 participants