From: Ben Soares Date: Thu, 8 Nov 2018 14:46:17 +0000 (+0000) Subject: JAL-1988 tidying, plus don't add Preferences to Tools menu on a Mac\! X-Git-Tag: Release_2_11_0~17^2~7^2~58^2~22 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b9bde68b87a581a1f21e47cb19839791a192134a;p=jalview.git JAL-1988 tidying, plus don't add Preferences to Tools menu on a Mac\! --- diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index b2d63a9..647971e 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -361,63 +361,66 @@ public class Desktop extends jalview.jbgui.GDesktop * change the line numbers */ + /* if (!Platform.isAMac()) { // this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); } else - { - // this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); - java.awt.Desktop desktop = java.awt.Desktop.getDesktop(); + */ + // { + // this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); + java.awt.Desktop hdesktop = java.awt.Desktop.getDesktop(); - desktop.setAboutHandler(new AboutHandler() + hdesktop.setAboutHandler(new AboutHandler() + { + @Override + public void handleAbout(AboutEvent e) { - @Override - public void handleAbout(AboutEvent e) - { - aboutMenuItem_actionPerformed(null); - } - }); - desktop.setPreferencesHandler(new PreferencesHandler() + aboutMenuItem_actionPerformed(null); + } + }); + hdesktop.setPreferencesHandler(new PreferencesHandler() + { + @Override + public void handlePreferences(PreferencesEvent e) { - @Override - public void handlePreferences(PreferencesEvent e) + preferences_actionPerformed(null); + } + }); + hdesktop.setQuitHandler(new QuitHandler() + { + @Override + public void handleQuitRequestWith(QuitEvent e, QuitResponse r) + { + int n = JOptionPane.showConfirmDialog(null, + MessageManager.getString("label.quit_jalview"), + MessageManager.getString("action.quit"), + JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, + null); + if (n == JOptionPane.OK_OPTION) { - preferences_actionPerformed(null); + System.out.println("Shortcut Quit confirmed by user"); + quit(); } - }); - desktop.setQuitHandler(new QuitHandler() - { - @Override - public void handleQuitRequestWith(QuitEvent e, QuitResponse r) - { - int n = JOptionPane.showConfirmDialog(null, - MessageManager.getString("label.quit_jalview"), - MessageManager.getString("action.quit"), - JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, - null); - if (n == JOptionPane.OK_OPTION) - { - System.out.println("Shortcut Quit confirmed by user"); - quit(); - } - else - { - System.out.println("Shortcut Quit cancelled by user"); - } + else + { + System.out.println("Shortcut Quit cancelled by user"); } - }); + } + }); - addWindowListener(new WindowAdapter() - { + // } - @Override - public void windowClosing(WindowEvent ev) - { - quit(); - } - }); - } + addWindowListener(new WindowAdapter() + { + + @Override + public void windowClosing(WindowEvent ev) + { + quit(); + } + }); boolean selmemusage = jalview.bin.Cache.getDefault("SHOW_MEMUSAGE", false); diff --git a/src/jalview/jbgui/GDesktop.java b/src/jalview/jbgui/GDesktop.java index 1e51541..f1a2318 100755 --- a/src/jalview/jbgui/GDesktop.java +++ b/src/jalview/jbgui/GDesktop.java @@ -435,7 +435,10 @@ public class GDesktop extends JFrame VamsasMenu.add(vamsasImport); VamsasMenu.add(vamsasSave); VamsasMenu.add(vamsasStop); - toolsMenu.add(preferences); + if (!Platform.isAMac()) + { + toolsMenu.add(preferences); + } toolsMenu.add(showMemusage); toolsMenu.add(showConsole); toolsMenu.add(showNews);