Changeset 2358 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2009-10-31T13:15:29+01:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r2334 r2358 30 30 31 31 import org.openstreetmap.josm.Main; 32 import org.openstreetmap.josm.actions.AboutAction;33 32 import org.openstreetmap.josm.gui.preferences.ProxyPreferences; 34 33 import org.openstreetmap.josm.tools.ColorHelper; 34 import org.openstreetmap.josm.tools.LanguageInfo; 35 35 36 36 /** … … 324 324 public void save() throws IOException { 325 325 /* currently unused, but may help to fix configuration issues in future */ 326 properties.put("josm.version", AboutAction.getVersionString());327 328 setSystemProperties();326 properties.put("josm.version", Version.getInstance().getVersionString()); 327 328 updateSystemProperties(); 329 329 File prefFile = new File(getPreferencesDirFile(), "preferences"); 330 330 … … 394 394 if (!errLines.isEmpty()) 395 395 throw new IOException(tr("Malformed config file at lines {0}", errLines)); 396 setSystemProperties();396 updateSystemProperties(); 397 397 } 398 398 … … 679 679 } 680 680 } 681 682 681 return put(key, s); 683 682 } 684 685 private void setSystemProperties() { 683 684 /** 685 * Updates system properties with the current values in the preferences. 686 * 687 */ 688 public void updateSystemProperties() { 689 Properties sysProp = System.getProperties(); 686 690 if (getBoolean(ProxyPreferences.PROXY_ENABLE)) { 687 Properties sysProp = System.getProperties();688 691 sysProp.put("proxySet", "true"); 689 692 sysProp.put("http.proxyHost", get(ProxyPreferences.PROXY_HOST)); … … 693 696 sysProp.put("proxyPassword", get(ProxyPreferences.PROXY_PASS)); 694 697 } 695 System.setProperties(sysProp); 696 } 697 AboutAction.setUserAgent(); 698 699 } 700 int v = Version.getInstance().getVersion(); 701 String s = ( v == Version.JOSM_UNKNOWN_VERSION) ? "UNKNOWN" : Integer.toString(v); 702 sysProp.put("http.agent", "JOSM/1.5 ("+ s+" "+LanguageInfo.getJOSMLocaleCode()+")"); 703 System.setProperties(sysProp); 698 704 } 699 705 }
Note:
See TracChangeset
for help on using the changeset viewer.