Skip to content

Treat failed save actions as cancel actions.#146

Merged
dreamsyntax merged 1 commit intoaldelaro5:masterfrom
cristian64:treat_failed_save_action_as_cancel
May 18, 2024
Merged

Treat failed save actions as cancel actions.#146
dreamsyntax merged 1 commit intoaldelaro5:masterfrom
cristian64:treat_failed_save_action_as_cancel

Conversation

@cristian64
Copy link
Copy Markdown
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
Copy Markdown
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
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