From b7384c7cb8aac557a4fcfe33fca452f9ccf583b3 Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 18 Aug 2005 18:27:45 +0000 Subject: [PATCH] made changes to DEFAULT_BROWSER in user preferences act immediatly (instead of just on restart). --- src/jalview/gui/Preferences.java | 7 ++++++- src/jalview/util/BrowserLauncher.java | 10 ++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index f90f09c..c44436d 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -195,7 +195,7 @@ public class Preferences extends GPreferences Cache.applicationProperties.setProperty("SHOW_STARTUP_FILE", Boolean.toString(startupCheckbox.isSelected())); Cache.applicationProperties.setProperty("DEFAULT_BROWSER", defaultBrowser.getText()); - + jalview.util.BrowserLauncher.resetBrowser(); if(nameLinks.size()>0) { StringBuffer links = new StringBuffer(); @@ -220,6 +220,11 @@ public class Preferences extends GPreferences System.setProperty("http.proxyHost", proxyServerTB.getText()); System.setProperty("http.proxyPort", proxyPortTB.getText()); } + else + { + System.setProperty("http.proxyHost",""); + System.setProperty("http.proxyPort",""); + } diff --git a/src/jalview/util/BrowserLauncher.java b/src/jalview/util/BrowserLauncher.java index b2f532f..4e035eb 100755 --- a/src/jalview/util/BrowserLauncher.java +++ b/src/jalview/util/BrowserLauncher.java @@ -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 @@ -696,7 +696,13 @@ public class BrowserLauncher return browser; } - + /** + * 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 -- 1.7.10.2