Changeset 9353 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2016-01-09T16:37:20+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java
r9352 r9353 162 162 */ 163 163 public void initFromPreferences() { 164 setApiUrl( Main.pref.get("osm-server.url", OsmApi.DEFAULT_API_URL).trim());164 setApiUrl(OsmApi.getOsmApi().getServerUrl().trim()); 165 165 refreshView(); 166 166 } -
trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java
r8840 r9353 119 119 */ 120 120 public void initFromPreferences() { 121 String url = Main.pref.get("osm-server.url", OsmApi.DEFAULT_API_URL);121 String url = OsmApi.getOsmApi().getServerUrl(); 122 122 if (OsmApi.DEFAULT_API_URL.equals(url.trim())) { 123 123 cbUseDefaultServerUrl.setSelected(true); … … 134 134 */ 135 135 public void saveToPreferences() { 136 String oldUrl = Main.pref.get("osm-server.url", OsmApi.DEFAULT_API_URL);136 String oldUrl = OsmApi.getOsmApi().getServerUrl(); 137 137 String hmiUrl = getStrippedApiUrl(); 138 138 if (cbUseDefaultServerUrl.isSelected()) { … … 143 143 Main.pref.put("osm-server.url", hmiUrl); 144 144 } 145 String newUrl = Main.pref.get("osm-server.url", OsmApi.DEFAULT_API_URL);145 String newUrl = OsmApi.getOsmApi().getServerUrl(); 146 146 147 147 // When API URL changes, re-initialize API connection so we may adjust -
trunk/src/org/openstreetmap/josm/io/CachedFile.java
r9296 r9353 453 453 private static void checkOfflineAccess(String urlString) { 454 454 OnlineResource.JOSM_WEBSITE.checkOfflineAccess(urlString, Main.getJOSMWebsite()); 455 OnlineResource.OSM_API.checkOfflineAccess(urlString, Main.pref.get("osm-server.url", OsmApi.DEFAULT_API_URL));455 OnlineResource.OSM_API.checkOfflineAccess(urlString, OsmApi.getOsmApi().getServerUrl()); 456 456 } 457 457 -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r9352 r9353 340 340 341 341 /** 342 * Returns the server URL 343 * @return the server URL 344 * @since 9353 345 */ 346 public String getServerUrl() { 347 return serverUrl; 348 } 349 350 /** 342 351 * Creates an OSM primitive on the server. The OsmPrimitive object passed in 343 352 * is modified by giving it the server-assigned id. -
trunk/src/org/openstreetmap/josm/io/OsmConnection.java
r9352 r9353 127 127 protected void obtainAccessToken(final HttpClient connection) throws MissingOAuthAccessTokenException { 128 128 try { 129 final URL apiUrl = new URL( Main.pref.get("osm-server.url", OsmApi.DEFAULT_API_URL));129 final URL apiUrl = new URL(OsmApi.getOsmApi().getServerUrl()); 130 130 if (!Objects.equals(apiUrl.getHost(), connection.getURL().getHost())) { 131 131 throw new MissingOAuthAccessTokenException(); -
trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
r9309 r9353 113 113 try { 114 114 OnlineResource.JOSM_WEBSITE.checkOfflineAccess(urlStr, Main.getJOSMWebsite()); 115 OnlineResource.OSM_API.checkOfflineAccess(urlStr, Main.pref.get("osm-server.url", OsmApi.DEFAULT_API_URL));115 OnlineResource.OSM_API.checkOfflineAccess(urlStr, OsmApi.getOsmApi().getServerUrl()); 116 116 117 117 URL url = null; -
trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java
r8846 r9353 53 53 "<html>Failed to initialize communication with the OSM server {0}.<br>" 54 54 + "Check the server URL in your preferences and your internet connection.", 55 Main.pref.get("osm-server.url", OsmApi.DEFAULT_API_URL));55 OsmApi.getOsmApi().getServerUrl()); 56 56 } 57 57 … … 64 64 + "Please open the Preferences Dialog and generate or enter an Access Token." 65 65 + "</html>", 66 Main.pref.get("osm-server.url", OsmApi.DEFAULT_API_URL)66 OsmApi.getOsmApi().getServerUrl() 67 67 ); 68 68 }
Note:
See TracChangeset
for help on using the changeset viewer.