Uploaded image for project: 'Jalview'
  1. Jalview
  2. JAL-3772

Unsaved Alignment windows close without prompting to save, individually or at application quit.

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.11.1.3
    • Fix Version/s: 2.11.2
    • Component/s: gui, gui design issue
    • Labels:
      None
    • Environment:
      All OSes except for Quit handler in MacOS in Java 11+

      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 )

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              soares Ben Soares
              Reporter:
              soares Ben Soares
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: