Edit and annotate wrapped alignment
[jalview.git] / src / jalview / gui / Preferences.java
index f90f09c..bf26c0d 100755 (executable)
@@ -194,7 +194,13 @@ public class Preferences extends GPreferences
       Cache.applicationProperties.setProperty("STARTUP_FILE", startupFileTextfield.getText());\r
       Cache.applicationProperties.setProperty("SHOW_STARTUP_FILE",  Boolean.toString(startupCheckbox.isSelected()));\r
 \r
-      Cache.applicationProperties.setProperty("DEFAULT_BROWSER", defaultBrowser.getText());\r
+      if(defaultBrowser.getText().trim().length()<1)\r
+        Cache.applicationProperties.remove("DEFAULT_BROWSER");\r
+      else\r
+        Cache.applicationProperties.setProperty("DEFAULT_BROWSER",\r
+                                                defaultBrowser.getText());\r
+\r
+        jalview.util.BrowserLauncher.resetBrowser();\r
 \r
         if(nameLinks.size()>0)\r
         {\r
@@ -210,16 +216,33 @@ public class Preferences extends GPreferences
           links.setLength( links.length()-1 );\r
           Cache.applicationProperties.setProperty("SEQUENCE_LINKS", links.toString());\r
         }\r
+        else\r
+          Cache.applicationProperties.remove("SEQUENCE_LINKS");\r
+\r
 \r
         Cache.applicationProperties.setProperty("USE_PROXY", Boolean.toString(useProxy.isSelected()));\r
-        Cache.applicationProperties.setProperty("PROXY_SERVER",proxyServerTB.getText());\r
-        Cache.applicationProperties.setProperty("PROXY_PORT", proxyPortTB.getText());\r
+\r
+        if (proxyServerTB.getText().trim().length() < 1)\r
+          Cache.applicationProperties.remove("PROXY_SERVER");\r
+        else\r
+          Cache.applicationProperties.setProperty("PROXY_SERVER",\r
+                                                  proxyServerTB.getText());\r
+\r
+        if (proxyPortTB.getText().trim().length() < 1)\r
+          Cache.applicationProperties.remove("PROXY_PORT");\r
+        else\r
+          Cache.applicationProperties.setProperty("PROXY_PORT", proxyPortTB.getText());\r
 \r
         if(useProxy.isSelected())\r
         {\r
           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