made changes to DEFAULT_BROWSER in user preferences act immediatly (instead of just...
authorjprocter <Jim Procter>
Thu, 18 Aug 2005 18:27:45 +0000 (18:27 +0000)
committerjprocter <Jim Procter>
Thu, 18 Aug 2005 18:27:45 +0000 (18:27 +0000)
src/jalview/gui/Preferences.java
src/jalview/util/BrowserLauncher.java

index f90f09c..c44436d 100755 (executable)
@@ -195,7 +195,7 @@ public class Preferences extends GPreferences
       Cache.applicationProperties.setProperty("SHOW_STARTUP_FILE",  Boolean.toString(startupCheckbox.isSelected()));\r
 \r
       Cache.applicationProperties.setProperty("DEFAULT_BROWSER", defaultBrowser.getText());\r
-\r
+      jalview.util.BrowserLauncher.resetBrowser();\r
         if(nameLinks.size()>0)\r
         {\r
           StringBuffer links = new StringBuffer();\r
@@ -220,6 +220,11 @@ public class Preferences extends GPreferences
           System.setProperty("http.proxyHost", proxyServerTB.getText());\r
           System.setProperty("http.proxyPort", proxyPortTB.getText());\r
         }\r
+        else\r
+        {\r
+          System.setProperty("http.proxyHost","");\r
+          System.setProperty("http.proxyPort","");\r
+        }\r
 \r
 \r
 \r
index b2f532f..4e035eb 100755 (executable)
@@ -508,7 +508,7 @@ public class BrowserLauncher
   }\r
 \r
   /**\r
-   * Attempts to locate the default web browser on the local system.  Caches results so it\r
+   * Attempts to locate the default web browser on the local system.    s results so it\r
    * only locates the browser once for each use of this class per JVM instance.\r
    * @return The browser for the system.  Note that this may not be what you would consider\r
    *                        to be a standard web browser; instead, it's the application that gets called to\r
@@ -696,7 +696,13 @@ public class BrowserLauncher
 \r
     return browser;\r
   }\r
-\r
+  /**\r
+   * used to ensure that browser is up-to-date after a configuration\r
+   * change (Unix DEFAULT_BROWSER property change).\r
+   */\r
+  public static void resetBrowser() {\r
+    browser = null;\r
+  }\r
   /**\r
    * Attempts to open the default web browser to the given URL.\r
    * @param url The URL to open\r