- if (groovyConsole != null) {
- // suppress a possible repeat prompt to save script
- groovyConsole.setDirty(false);
- groovyConsole.exit();
- }
- System.exit(0);
+ if (jvnews != null)
+ {
+ storeLastKnownDimensions("JALVIEW_RSS_WINDOW_", jvnews.getBounds());
+ }
+
+ // Frames should all close automatically. Keeping external
+ // viewers open should already be decided by user.
+ closeAll_actionPerformed(null);
+
+ // check for aborted quit
+ if (QuitHandler.quitCancelled())
+ {
+ jalview.bin.Console.debug("Desktop aborting quit");
+ return null;
+ }
+
+ if (dialogExecutor != null)
+ {
+ dialogExecutor.shutdownNow();
+ }
+
+ if (groovyConsole != null)
+ {
+ // suppress a possible repeat prompt to save script
+ groovyConsole.setDirty(false);
+ groovyConsole.exit();
+ }
+
+ if (QuitHandler.gotQuitResponse() == QResponse.FORCE_QUIT)
+ {
+ // note that shutdown hook will not be run
+ jalview.bin.Console.debug("Force Quit selected by user");
+ Runtime.getRuntime().halt(0);
+ }
+
+ jalview.bin.Console.debug("Quit selected by user");
+ if (disposeFlag)
+ {
+ instance.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+ // instance.dispose();
+ }
+ instance.quit();
+
+ return null; // Void
+ };
+
+ return QuitHandler.getQuitResponse(ui, doDesktopQuit, doDesktopQuit,
+ QuitHandler.defaultCancelQuit);