From 545a83a3607f98d0a1337cdf5954d6215be8cf94 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 23 Jul 2018 15:47:07 +0100 Subject: [PATCH] JAL-3056 suppress News menu item, remove unneeded j2sNative --- src/jalview/gui/Desktop.java | 81 ++++++++++++++++----------------------- src/jalview/jbgui/GDesktop.java | 2 +- 2 files changed, 33 insertions(+), 50 deletions(-) diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 564f04a..b8f8eab 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -350,7 +350,10 @@ public class Desktop extends jalview.jbgui.GDesktop * are spawned off as threads rather than waited for during this constructor. */ instance = this; - doVamsasClientCheck(); + if (!Jalview.isJS()) + { + doVamsasClientCheck(); + } doConfigureStructurePrefs(); setTitle("Jalview " + jalview.bin.Cache.getProperty("VERSION")); @@ -536,28 +539,19 @@ public class Desktop extends jalview.jbgui.GDesktop public void checkForNews() { - - /** - * BH 2018 - * - * @j2sNative - */ + final Desktop me = this; + // Thread off the news reader, in case there are connection problems. + addDialogThread(new Runnable() { - final Desktop me = this; - // Thread off the news reader, in case there are connection problems. - addDialogThread(new Runnable() + @Override + public void run() { - @Override - public void run() - { - Cache.log.debug("Starting news thread."); - - jvnews = new BlogReader(me); - showNews.setVisible(true); - Cache.log.debug("Completed news thread."); - } - }); - } + Cache.log.debug("Starting news thread."); + jvnews = new BlogReader(me); + showNews.setVisible(true); + Cache.log.debug("Completed news thread."); + } + }); } public void getIdentifiersOrgData() @@ -591,32 +585,23 @@ public class Desktop extends jalview.jbgui.GDesktop void showNews(boolean visible) { - /** - * BH 2018 - * - * @j2sNative - * - */ + Cache.log.debug((visible ? "Showing" : "Hiding") + " news."); + showNews.setSelected(visible); + if (visible && !jvnews.isVisible()) { - Cache.log.debug((visible ? "Showing" : "Hiding") + " news."); - showNews.setSelected(visible); - if (visible && !jvnews.isVisible()) + new Thread(new Runnable() { - new Thread(new Runnable() + @Override + public void run() { - @Override - public void run() - { - long now = System.currentTimeMillis(); - Desktop.instance.setProgressBar( - MessageManager.getString("status.refreshing_news"), - now); - jvnews.refreshNews(); - Desktop.instance.setProgressBar(null, now); - jvnews.showNews(); - } - }).start(); - } + long now = System.currentTimeMillis(); + Desktop.instance.setProgressBar( + MessageManager.getString("status.refreshing_news"), now); + jvnews.refreshNews(); + Desktop.instance.setProgressBar(null, now); + jvnews.showNews(); + } + }).start(); } } @@ -680,8 +665,7 @@ public class Desktop extends jalview.jbgui.GDesktop private void doVamsasClientCheck() { - if (/** @j2sNative false && */ // BH 2018 - jalview.bin.Cache.vamsasJarsPresent()) + if (Cache.vamsasJarsPresent()) { setupVamsasDisconnectedGui(); VamsasMenu.setVisible(true); @@ -956,7 +940,7 @@ public class Desktop extends jalview.jbgui.GDesktop frame.setIcon(false); } catch (java.beans.PropertyVetoException ex) { - + // System.err.println(ex.toString()); } } }); @@ -2365,8 +2349,7 @@ public class Desktop extends jalview.jbgui.GDesktop @Override public void run() { - if (/** @j2sNative false && */ // BH 2018 - Cache.getDefault("CHECKURLLINKS", true)) + if (Cache.getDefault("CHECKURLLINKS", true)) { // check what the actual links are - if it's just the default don't // bother with the warning diff --git a/src/jalview/jbgui/GDesktop.java b/src/jalview/jbgui/GDesktop.java index 9ffd701..0b0ce1b 100755 --- a/src/jalview/jbgui/GDesktop.java +++ b/src/jalview/jbgui/GDesktop.java @@ -446,9 +446,9 @@ public class GDesktop extends JFrame toolsMenu.add(showMemusage); toolsMenu.add(showConsole); } - toolsMenu.add(showNews); if (!Jalview.isJS()) { + toolsMenu.add(showNews); toolsMenu.add(garbageCollect); toolsMenu.add(groovyShell); } -- 1.7.10.2