JAL-3056 suppress News menu item, remove unneeded j2sNative
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 23 Jul 2018 14:47:07 +0000 (15:47 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 23 Jul 2018 14:47:07 +0000 (15:47 +0100)
src/jalview/gui/Desktop.java
src/jalview/jbgui/GDesktop.java

index 564f04a..b8f8eab 100644 (file)
@@ -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
index 9ffd701..0b0ce1b 100755 (executable)
@@ -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);
     }