label.quit_jalview = Are you sure you want to quit Jalview?
label.wait_for_save = Wait for save
label.unsaved_changes = There are unsaved changes.
+ label.unsaved_alignments = There are unsaved alignments.
label.save_in_progress = Some files are still saving:
+label.confirm_quit_viewer = An external viewer is still open. Close the external window as well?
+label.confirm_quit_viewers = External viewers are still open. Close these external windows as well?
label.unknown = Unknown
label.quit_after_saving = Jalview will quit after saving.
label.all_saved = All files saved.
if (confirmQuit)
{
+ String messageString = MessageManager
+ .getString(message == Message.UNSAVED_ALIGNMENTS
+ ? "label.unsaved_alignments"
+ : "label.unsaved_changes");
- JvOptionPane.newOptionDialog()
+ setQuitDialog(JvOptionPane.newOptionDialog()
.setResponseHandler(JOptionPane.YES_OPTION, defaultOkQuit)
- .setResponseHandler(JOptionPane.NO_OPTION, cancelQuit)
- .showDialogOnTopAsync(
- new StringBuilder(MessageManager
- .getString("label.quit_jalview")).append("\n")
- .append(messageString).toString(),
- MessageManager.getString("action.quit"),
- JOptionPane.YES_NO_OPTION,
- JOptionPane.QUESTION_MESSAGE, null, new Object[]
- { MessageManager.getString("action.quit"),
- MessageManager.getString("action.cancel") },
- MessageManager.getString("action.quit"), true);
+ .setResponseHandler(JOptionPane.NO_OPTION, cancelQuit));
+ JvOptionPane qd = getQuitDialog();
+ qd.showDialogOnTopAsync(
+ new StringBuilder(
+ MessageManager.getString("label.quit_jalview"))
- .append("\n")
- .append(MessageManager
- .getString("label.unsaved_changes"))
- .toString(),
++ .append("\n").append(messageString).toString(),
+ MessageManager.getString("action.quit"),
+ JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null,
+ new Object[]
+ { MessageManager.getString("action.quit"),
+ MessageManager.getString("action.cancel") },
+ MessageManager.getString("action.quit"), true);
}
got = gotQuitResponse();
public static void abortQuit()
{
- setResponse(QResponse.CANCEL_QUIT);
+ setResponse(QResponse.NULL);
+ // executor.shutdownNow();
+ }
+
+ private static JvOptionPane quitDialog = null;
+
+ private static void setQuitDialog(JvOptionPane qd)
+ {
+ quitDialog = qd;
+ }
+
+ private static JvOptionPane getQuitDialog()
+ {
+ return quitDialog;
+ }
+
+ public static boolean quitCancelled()
+ {
+ return QuitHandler.gotQuitResponse() == QResponse.CANCEL_QUIT
+ || QuitHandler.gotQuitResponse() == QResponse.NULL;
+ }
+
+ public static boolean quitting()
+ {
+ return QuitHandler.gotQuitResponse() == QResponse.QUIT
+ || QuitHandler.gotQuitResponse() == QResponse.FORCE_QUIT;
}
--}
++}