From: Ben Soares Date: Thu, 3 Nov 2022 13:26:20 +0000 (+0000) Subject: JAL-1988 JAL-3772 Allow other window closing dialogs to cancel quit handling X-Git-Tag: Release_2_11_3_0~23^2~4^2~19 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=bfc2ccc01fd77463a3edb1265e3ee6db5741f917;p=jalview.git JAL-1988 JAL-3772 Allow other window closing dialogs to cancel quit handling --- 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;