From 3a32d58fe4dcca10fbc74e2c651d13a13c96331a Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Fri, 19 Aug 2005 08:49:52 +0000 Subject: [PATCH] If browser not set, remove property --- src/jalview/gui/Preferences.java | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index c44436d..32052f7 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -194,8 +194,15 @@ public class Preferences extends GPreferences Cache.applicationProperties.setProperty("STARTUP_FILE", startupFileTextfield.getText()); Cache.applicationProperties.setProperty("SHOW_STARTUP_FILE", Boolean.toString(startupCheckbox.isSelected())); - Cache.applicationProperties.setProperty("DEFAULT_BROWSER", defaultBrowser.getText()); - jalview.util.BrowserLauncher.resetBrowser(); + if(defaultBrowser.getText().trim().length()<1) + Cache.applicationProperties.remove("DEFAULT_BROWSER"); + else + { + Cache.applicationProperties.setProperty("DEFAULT_BROWSER", + defaultBrowser.getText()); + jalview.util.BrowserLauncher.resetBrowser(); + } + if(nameLinks.size()>0) { StringBuffer links = new StringBuffer(); @@ -210,10 +217,22 @@ public class Preferences extends GPreferences links.setLength( links.length()-1 ); Cache.applicationProperties.setProperty("SEQUENCE_LINKS", links.toString()); } + else + Cache.applicationProperties.remove("SEQUENCE_LINKS"); + Cache.applicationProperties.setProperty("USE_PROXY", Boolean.toString(useProxy.isSelected())); - Cache.applicationProperties.setProperty("PROXY_SERVER",proxyServerTB.getText()); - Cache.applicationProperties.setProperty("PROXY_PORT", proxyPortTB.getText()); + + if (proxyServerTB.getText().trim().length() < 1) + Cache.applicationProperties.remove("PROXY_SERVER"); + else + Cache.applicationProperties.setProperty("PROXY_SERVER", + proxyServerTB.getText()); + + if (proxyPortTB.getText().trim().length() < 1) + Cache.applicationProperties.remove("PROXY_PORT"); + else + Cache.applicationProperties.setProperty("PROXY_PORT", proxyPortTB.getText()); if(useProxy.isSelected()) { -- 1.7.10.2