Details
-
Type: New Feature
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 2.11.3.0
-
Component/s: gui, gui design issue
-
Labels:None
-
Environment:All OSes except for Quit handler in MacOS in Java 11+
-
Sprint:2.11.3.0 release
Description
From Will Barton:
"Why doesn't Jalview ask if you are sure you want to exit without saving
before closing?
With all the windows you can end up with, I just hit the wrong "X"
button and closed the whole application, and it just closes no warning."
An unsaved alignment is lost when either closing the individual alignment window or by quitting the application in various ways, which in most cases is pretty instant, and as described above can happen by accident.
There are various possible prompts that could be used to help the user:
1) A closing alignment window with unsaved work prompts to save.
2a) Quitting the application runs through these unsaved alignment window prompts before actually exiting. Possibly just listing unsaved windows for saving?
2b) Quitting the application with unsaved work in any alignment window (i.e. something done since the last time saved) prompts to save the whole project. This seems simpler, quicker, and encourages use of the Jalview project files which have other benefits.
Any window or project without a local filename needs to be prompted in the usual "Save as..." way.
A possible hook to either the OS attempting to quit Jalview (e.g. window manager 'X' close button or even a 'kill -SIGINT' or Ctrl-C) or the user using File->Quit, is
Runtime.getRuntime().addShutdownHook(Thread);
(see https://docs.oracle.com/javase/8/docs/api/java/lang/Runtime.html#addShutdownHook-java.lang.Thread- and https://www.baeldung.com/jvm-shutdown-hooks )
"Why doesn't Jalview ask if you are sure you want to exit without saving
before closing?
With all the windows you can end up with, I just hit the wrong "X"
button and closed the whole application, and it just closes no warning."
An unsaved alignment is lost when either closing the individual alignment window or by quitting the application in various ways, which in most cases is pretty instant, and as described above can happen by accident.
There are various possible prompts that could be used to help the user:
1) A closing alignment window with unsaved work prompts to save.
2a) Quitting the application runs through these unsaved alignment window prompts before actually exiting. Possibly just listing unsaved windows for saving?
2b) Quitting the application with unsaved work in any alignment window (i.e. something done since the last time saved) prompts to save the whole project. This seems simpler, quicker, and encourages use of the Jalview project files which have other benefits.
Any window or project without a local filename needs to be prompted in the usual "Save as..." way.
A possible hook to either the OS attempting to quit Jalview (e.g. window manager 'X' close button or even a 'kill -SIGINT' or Ctrl-C) or the user using File->Quit, is
Runtime.getRuntime().addShutdownHook(Thread);
(see https://docs.oracle.com/javase/8/docs/api/java/lang/Runtime.html#addShutdownHook-java.lang.Thread- and https://www.baeldung.com/jvm-shutdown-hooks )