X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2FBrowserLauncher.java;h=2b8a4bd77b65e762f99ed972bd8c61ab0bea08b8;hb=d4b1e4d0c74b1c6d0f3c3556b10be91a6aaea475;hp=6bac25b308c9dcb1e97b2d9058e1c042c32c73f3;hpb=efc31b4a8d5cee63555586804a2b79c06bdb5a14;p=jalview.git diff --git a/src/jalview/util/BrowserLauncher.java b/src/jalview/util/BrowserLauncher.java index 6bac25b..2b8a4bd 100755 --- a/src/jalview/util/BrowserLauncher.java +++ b/src/jalview/util/BrowserLauncher.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -508,7 +508,7 @@ public class BrowserLauncher } /** - * Attempts to locate the default web browser on the local system. Caches results so it + * Attempts to locate the default web browser on the local system. s results so it * only locates the browser once for each use of this class per JVM instance. * @return The browser for the system. Note that this may not be what you would consider * to be a standard web browser; instead, it's the application that gets called to @@ -645,7 +645,6 @@ public class BrowserLauncher } catch (IllegalArgumentException iare) { - browser = browser; errorMessage = iare.getMessage(); return null; @@ -689,14 +688,7 @@ public class BrowserLauncher case OTHER: default: - browser = jalview.bin.Cache.applicationProperties.getProperty( - "jalview.browser"); - - if (browser == null) - { - // hope firefox exists :-/ - browser = "firefox"; - } + browser = jalview.bin.Cache.getDefault("DEFAULT_BROWSER", "firefox"); break; } @@ -705,6 +697,15 @@ public class BrowserLauncher } /** + * used to ensure that browser is up-to-date after a configuration + * change (Unix DEFAULT_BROWSER property change). + */ + public static void resetBrowser() + { + browser = null; + } + + /** * Attempts to open the default web browser to the given URL. * @param url The URL to open * @throws IOException If the web browser could not be located or does not run