From bfc2ccc01fd77463a3edb1265e3ee6db5741f917 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Thu, 3 Nov 2022 13:26:20 +0000 Subject: [PATCH] JAL-1988 JAL-3772 Allow other window closing dialogs to cancel quit handling --- src/jalview/gui/QuitHandler.java | 5 +++++ src/jalview/gui/StructureViewerBase.java | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/jalview/gui/QuitHandler.java b/src/jalview/gui/QuitHandler.java index 429de55..e90a2d5 100644 --- a/src/jalview/gui/QuitHandler.java +++ b/src/jalview/gui/QuitHandler.java @@ -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 diff --git a/src/jalview/gui/StructureViewerBase.java b/src/jalview/gui/StructureViewerBase.java index ec5579c..6765366 100644 --- a/src/jalview/gui/StructureViewerBase.java +++ b/src/jalview/gui/StructureViewerBase.java @@ -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; -- 1.7.10.2