JAL-1988 JAL-3772 Allow other window closing dialogs to cancel quit handling
authorBen Soares <b.soares@dundee.ac.uk>
Thu, 3 Nov 2022 13:26:20 +0000 (13:26 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Thu, 3 Nov 2022 13:26:20 +0000 (13:26 +0000)
src/jalview/gui/QuitHandler.java
src/jalview/gui/StructureViewerBase.java

index 429de55..e90a2d5 100644 (file)
@@ -402,4 +402,9 @@ public class QuitHandler
             .append(MessageManager.getString("label.quit_after_saving"));
     return messageSB.toString();
   }
+
+  public static void abortQuit()
+  {
+    setResponse(QResponse.CANCEL_QUIT);
+  }
 }
\ No newline at end of file
index ec5579c..6765366 100644 (file)
@@ -1280,6 +1280,9 @@ public abstract class StructureViewerBase extends GStructureViewer
         if (confirm == JvOptionPane.CANCEL_OPTION
                 || confirm == JvOptionPane.CLOSED_OPTION)
         {
+          // abort possible quit handling if CANCEL chosen
+          if (confirm == JvOptionPane.CANCEL_OPTION)
+            QuitHandler.abortQuit();
           return;
         }
         forceClose = confirm == JvOptionPane.YES_OPTION;