summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main
diff options
context:
space:
mode:
authortkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-07-24 14:58:39 +0000
committertkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-07-24 14:58:39 +0000
commit3edba5d2d9afcc9cb5c94f43219d8a032b5d8d2c (patch)
tree182bded785d273d98aa71d739b11d42a3398d235 /pdf-over-gui/src/main
parent692c813f44f3f4e79e6dbb3b419448731a176075 (diff)
downloadmocca-3edba5d2d9afcc9cb5c94f43219d8a032b5d8d2c.tar.gz
mocca-3edba5d2d9afcc9cb5c94f43219d8a032b5d8d2c.tar.bz2
mocca-3edba5d2d9afcc9cb5c94f43219d8a032b5d8d2c.zip
Workaround to unset proxy settings when cleared
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@473 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui/src/main')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java49
1 files changed, 40 insertions, 9 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java
index fcf3119f..b4b519f1 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java
@@ -420,15 +420,46 @@ public class ConfigurationComposite extends StateComposite {
this.configManipulator.setSignatureNote(this.configurationContainer
.getSignatureNote());
-
- this.configManipulator.setProxyHost(this.configurationContainer
- .getProxyHost());
- this.configManipulator.setProxyPort(this.configurationContainer
- .getProxyPort());
- this.configManipulator.setProxyUser(this.configurationContainer
- .getProxyUser());
- this.configManipulator.setProxyPass(this.configurationContainer
- .getProxyPass());
+
+ String hostOld = this.configProvider.getProxyHostPersistent();
+ String hostNew = this.configurationContainer.getProxyHost();
+ if (hostOld != null && !hostOld.isEmpty() &&
+ (hostNew == null || hostNew.isEmpty())) {
+ // Proxy has been removed, let's clear the system properties
+ // Otherwise, the proxy settings wouldn't get removed
+ System.clearProperty("http.proxyHost"); //$NON-NLS-1$
+ System.clearProperty("https.proxyHost"); //$NON-NLS-1$
+ }
+ this.configManipulator.setProxyHost(hostNew);
+
+ int portOld = this.configProvider.getProxyPortPersistent();
+ int portNew = this.configurationContainer.getProxyPort();
+ if (portOld != -1 && portNew == -1) {
+ // cf. above
+ System.clearProperty("http.proxyPort"); //$NON-NLS-1$
+ System.clearProperty("https.proxyPort"); //$NON-NLS-1$
+ }
+ this.configManipulator.setProxyPort(portNew);
+
+ String userOld = this.configProvider.getProxyUserPersistent();
+ String userNew = this.configurationContainer.getProxyUser();
+ if (userOld != null && !userOld.isEmpty() &&
+ (userNew == null || userNew.isEmpty())) {
+ // cf. above
+ System.clearProperty("http.proxyUser"); //$NON-NLS-1$
+ System.clearProperty("https.proxyUser"); //$NON-NLS-1$
+ }
+ this.configManipulator.setProxyUser(userNew);
+
+ String passOld = this.configProvider.getProxyPassPersistent();
+ String passNew = this.configurationContainer.getProxyPass();
+ if (passOld != null && passNew == null) {
+ // cf. above
+ System.clearProperty("http.proxyPassword"); //$NON-NLS-1$
+ System.clearProperty("https.proxyPassword"); //$NON-NLS-1$
+ }
+ this.configManipulator.setProxyPass(passNew);
+
this.configManipulator.setDefaultEmblem(this.configurationContainer
.getEmblem());