From 086115440f8e30fa1bfc881e00b94878b491fb89 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Mon, 11 Jul 2005 15:56:39 +0000 Subject: [PATCH] Version changes --- src/jalview/bin/Cache.java | 18 ++++++++++++------ src/jalview/gui/Desktop.java | 4 ++-- src/jalview/gui/SplashScreen.java | 5 +++-- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 8e5e240..e2477d9 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -52,7 +52,6 @@ public class Cache public static void loadProperties(String propsFile) { applicationProperties = new Properties(); - propertiesFile = propsFile; if (propsFile == null) { @@ -63,6 +62,8 @@ public class Cache { FileInputStream fis = new FileInputStream(propertiesFile); applicationProperties.load(fis); + applicationProperties.remove("LATEST_VERSION"); + applicationProperties.remove("VERSION"); fis.close(); } catch (Exception ex) @@ -96,16 +97,14 @@ public class Cache String jnlpVersion = System.getProperty("jalview.version"); String codeVersion = getProperty("VERSION"); + if(codeVersion==null) { // THIS SHOULD ONLY BE THE CASE WHEN TESTING!! codeVersion = "Test"; jnlpVersion = "Test"; - setProperty("jalview.version", jnlpVersion); - setProperty("VERSION", codeVersion); } - // jnlpVersion will be null if we're using InstallAnywhere if(jnlpVersion==null) { @@ -120,11 +119,18 @@ public class Cache line = line.substring(line.indexOf("value=")+7); line = line.substring(0, line.lastIndexOf("\"")); - setProperty("jalview.version", line); + jnlpVersion = line; + break; } }catch(Exception ex) - { setProperty("jalview.version", codeVersion); } + { jnlpVersion = codeVersion; } } + + System.out.println("Version: "+codeVersion); + System.out.println("Latest : "+jnlpVersion); + + setProperty("LATEST_VERSION", jnlpVersion); + setProperty("VERSION", codeVersion); } /** diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index ee9eb27..cd4608c 100755 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -443,11 +443,11 @@ public class Desktop extends jalview.jbgui.GDesktop jalview.bin. Cache.getProperty("BUILD_DATE")); - if (!jalview.bin.Cache.getProperty("jalview.version").equals( + if (!jalview.bin.Cache.getProperty("LATEST_VERSION").equals( jalview.bin.Cache.getProperty("VERSION"))) { message.append("\n\n!! Jalview version " - + jalview.bin.Cache.getProperty("jalview.version") + + jalview.bin.Cache.getProperty("LATEST_VERSION") + " is available for download from http://www.jalview.org !!\n"); } diff --git a/src/jalview/gui/SplashScreen.java b/src/jalview/gui/SplashScreen.java index 515b2a6..9f089a3 100755 --- a/src/jalview/gui/SplashScreen.java +++ b/src/jalview/gui/SplashScreen.java @@ -131,13 +131,14 @@ public class SplashScreen extends JPanel implements Runnable "; Last updated: " + jalview.bin.Cache.getProperty("BUILD_DATE"), 180, y); - if (!jalview.bin.Cache.getProperty("jalview.version").equals( + if (!jalview.bin.Cache.getProperty("LATEST_VERSION").equals( jalview.bin.Cache.getProperty("VERSION"))) { // If the jnlp version and the code version differ, warn the user g.setColor(Color.red); + g.drawString("!! Jalview version " + - jalview.bin.Cache.getProperty("jalview.version") + jalview.bin.Cache.getProperty("LATEST_VERSION") + " is available for download from http://www.jalview.org !!", 50, y += fontSize + 10); y += 5; -- 1.7.10.2