JAL-1183 showNews adds news discovery and display thread to dialog queue
authorjprocter <jprocter@compbio.dundee.ac.uk>
Mon, 1 Oct 2012 09:14:02 +0000 (10:14 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Mon, 1 Oct 2012 09:14:02 +0000 (10:14 +0100)
src/jalview/bin/Jalview.java
src/jalview/gui/Desktop.java

index 362b15e..bfa7b11 100755 (executable)
@@ -216,6 +216,7 @@ public class Jalview
           }
         }
       }
+      desktop.checkForNews();
     }
 
     String file = null, protocol = null, format = null, data = null;
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());