Skip to content

Inconsistent dialogs when exit would result in user data loss #1016

Closed
@per1234

Description

@per1234

Describe the problem

Under either of the following conditions, closing the Arduino IDE window would result in loss of sketch content:

  • New or example sketch staged in a temporary folder
  • Unsaved changes (user has disabled "Auto save")

As is standard for any application, the Arduino IDE notifies the user of this situation when they initiate a window close operation.

🐛 The presented dialogs are significantly different depending on which combination of the above conditions are present:

Saved New "will not be saved" dialog "Save your sketch" dialog
Y Y N Y
N Y Y Y
N N Y N

To reproduce

  1. Select File > Preferences... from the Arduino IDE menus.
  2. Check the box next to "☐ Auto save".
  3. Click the OK button.
  4. Select File > New from the Arduino IDE menus.
  5. Make any change to the sketch.
    ❗ Do not save the sketch.
  6. Select File > Close from the Arduino IDE menus.
    🙂 Dialog offering save is presented:
    image
  7. Click the Cancel button.
  8. Select File > Preferences... from the Arduino IDE menus.
  9. Uncheck the box next to " Auto save".
  10. Click the OK button.
  11. Make any change to the sketch.
    ❗ Do not save the sketch.
  12. Select File > Close from the Arduino IDE menus.
    🙁 Unintuitive and unhelpful "Any unsaved changes will not be saved" dialog appears:
    image
  13. Click the Yes button.
    😕 Dialog offering save is presented.
  14. Click the Cancel button.
  15. Select File > Save As... from the Arduino IDE menus.
  16. Save the sketch to any location and name you like.
  17. Make any change to the sketch.
    ❗ Do not save the sketch.
  18. Select File > Close from the Arduino IDE menus.
    🙁 Unintuitive and unhelpful "will not be saved" dialog appears.
  19. Click the Yes button.
    🐛 Standard dialog offering save is not presented.

Expected behavior

Always show only the "Save your sketch" dialog.

Eradicate the unintuitive (#677) and unhelpful (#170) "Any unsaved changes will not be saved" dialog from the IDE.

Arduino IDE version

2.0.0-rc6-snapshot-5b486b1

Operating system

Windows, Linux

Operating system version

Windows 10, Ubuntu 20.04

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions