From 44120c9a2b84039ad1513a2ea5a267713d1e291a Mon Sep 17 00:00:00 2001 From: jprocter Date: Mon, 1 Oct 2012 10:14:02 +0100 Subject: [PATCH] JAL-1183 showNews adds news discovery and display thread to dialog queue --- src/jalview/bin/Jalview.java | 1 + src/jalview/gui/Desktop.java | 29 ++++++++++++++++------------- 2 files changed, 17 insertions(+), 13 deletions(-) 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()); -- 1.7.10.2