Merge branch 'develop' into features/JAL-518_justify_seqs_in_region
[jalview.git] / src / jalview / jbgui / GDesktop.java
index ca95222..3d606e3 100755 (executable)
@@ -32,6 +32,8 @@ import javax.swing.JMenuItem;
 
 import jalview.api.AlignmentViewPanel;
 import jalview.bin.Cache;
+import jalview.gui.APQHandlers;
+import jalview.gui.Desktop;
 import jalview.io.FileFormatException;
 import jalview.util.MessageManager;
 import jalview.util.Platform;
@@ -140,7 +142,6 @@ public class GDesktop extends JFrame
    */
   private void jbInit() throws Exception
   {
-    boolean apqHandlersSet = false;
     /**
      * APQHandlers sets handlers for About, Preferences and Quit actions
      * peculiar to macOS's application menu. APQHandlers will check to see if a
@@ -148,10 +149,10 @@ public class GDesktop extends JFrame
      */
     try
     {
-      apqHandlersSet = APQHandlers.setAPQHandlers(this);
+      APQHandlers.setAPQHandlers((Desktop) this);
     } catch (Exception e)
     {
-      System.out.println("Cannot set APQHandlers");
+      jalview.bin.Console.outPrintln("Cannot set APQHandlers");
       // e.printStackTrace();
     } catch (Throwable t)
     {
@@ -192,7 +193,8 @@ public class GDesktop extends JFrame
           inputURLMenuItem_actionPerformed(null);
         } catch (FileFormatException e1)
         {
-          System.err.println("Error loading from URL: " + e1.getMessage());
+          jalview.bin.Console
+                  .errPrintln("Error loading from URL: " + e1.getMessage());
         }
       }
     });
@@ -213,7 +215,8 @@ public class GDesktop extends JFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        quit();
+        if (Desktop.instance != null)
+          Desktop.instance.desktopQuit();
       }
     });
     aboutMenuItem.setText(MessageManager.getString("label.about"));
@@ -519,7 +522,7 @@ public class GDesktop extends JFrame
    */
   protected void quit()
   {
-    // System.out.println("********** GDesktop.quit()");
+    // jalview.bin.Console.outPrintln("********** GDesktop.quit()");
   }
 
   /**