JAL-1183 showNews adds news discovery and display thread to dialog queue
[jalview.git] / src / jalview / gui / Desktop.java
index 712c9ce..d1e8b6a 100644 (file)
@@ -328,19 +328,6 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     showConsole(showjconsole);
 
     showNews.setVisible(false);
-    final Desktop me = this;
-    // Thread off the news reader, in case there are connection problems.
-    new Thread( new Runnable() {
-      @Override
-      public void run()
-      {
-        Cache.log.debug("Starting news thread.");
-
-        jvnews = new BlogReader(me);
-        showNews.setVisible(true);
-        Cache.log.debug("Completed news thread.");
-      }
-    }).start();
     
     this.addWindowListener(new WindowAdapter()
     {
@@ -423,6 +410,22 @@ public class Desktop extends jalview.jbgui.GDesktop implements
             });
   }
 
+  public void checkForNews()
+  {
+    final Desktop me = this;
+    // Thread off the news reader, in case there are connection problems.
+    addDialogThread(new Runnable() {
+      @Override
+      public void run()
+      {
+        Cache.log.debug("Starting news thread.");
+
+        jvnews = new BlogReader(me);
+        showNews.setVisible(true);
+        Cache.log.debug("Completed news thread.");
+      }
+    });
+  }
   protected void showNews_actionPerformed(ActionEvent e)
   {
     showNews(showNews.isSelected());