X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FPreferences.java;h=bf26c0d5e8350ea7f9b2d25ca6a0d8f532c6f028;hb=a6359c6eb746b06030b22135ed20417b971f580f;hp=f90f09c7044d20fbc7d60de31b07224cc9ff703e;hpb=fc0e0c053b7657d332d733bf2fc82d1259eeb745;p=jalview.git diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index f90f09c..bf26c0d 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -194,7 +194,13 @@ 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()); + 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) { @@ -210,16 +216,33 @@ 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()) { System.setProperty("http.proxyHost", proxyServerTB.getText()); System.setProperty("http.proxyPort", proxyPortTB.getText()); } + else + { + System.setProperty("http.proxyHost",""); + System.setProperty("http.proxyPort",""); + }