From: jprocter Date: Mon, 1 Oct 2012 09:14:02 +0000 (+0100) Subject: JAL-1183 showNews adds news discovery and display thread to dialog queue X-Git-Tag: Jalview_2_9~283 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=44120c9a2b84039ad1513a2ea5a267713d1e291a;hp=c9f21b2f940ed83ee018f7651302e7d3cea489c5;p=jalview.git JAL-1183 showNews adds news discovery and display thread to dialog queue --- diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 362b15e..bfa7b11 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -216,6 +216,7 @@ public class Jalview } } } + desktop.checkForNews(); } String file = null, protocol = null, format = null, data = null; diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 712c9ce..d1e8b6a 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -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());