kasemir / org.csstudio.display.builder

Update of org.csstudio.opibuilder.*
Eclipse Public License 1.0
2 stars 10 forks source link

Reload Display in editor mode should check whether the file is saved. #476

Closed claudio-rosati closed 5 years ago

claudio-rosati commented 5 years ago

When in editor mode, and the current OPI is not saved (asterisk on the tab name), invoking the contextual menu's Reload Display will reload the original OPI file without notifying the user.

I should, instead, ask for:

kasemir commented 5 years ago

OK, I'll add that.

claudio-rosati commented 5 years ago

Thank you

kasemir commented 5 years ago

Altogether, I see at least these scenarios

  1. OK, revert to the saved content, abandon the in-memory changes
  2. Cancel, want to keep the in-memory changes
  3. Save under a different name for later use, then load the original file and edit that
  4. Save under a different name, then edit that new file and leave the original file unchanged
  5. Save the file and then reload, within the same editor, because I think the editor messed up
  6. Save the file, close editor, then open in a new editor, because I think the editor messed up

5 and 6 are really for debugging the editor. We can't have preventive actions everywhere to work around bugs, need to instead identify and fix them. That still leaves at least 4 options, which would result in an unwieldy dialog. So I implemented 1 and 2. If the user cancels, the user can then do either 3 or 4. In essence, it's thus just like the "Do you really want to close" behaviour when closing a dirty editor.

claudio-rosati commented 5 years ago

I think it is reasonable. At the end what is important is to know that I'm about to clear my changes, and possibly abort it.