Changeset 12846 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2017-09-13T23:24:50+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/CacheCustomContent.java
r12841 r12846 12 12 13 13 import org.openstreetmap.josm.Main; 14 import org.openstreetmap.josm.spi.preferences.Config; 14 15 import org.openstreetmap.josm.tools.Logging; 15 16 import org.openstreetmap.josm.tools.Utils; … … 91 92 return false; 92 93 } 93 return Main.pref.getInt("cache." + ident, 0) + updateInterval < TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())94 return Config.getPref().getInt("cache." + ident, 0) + updateInterval < TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()) 94 95 || !isCacheValid(); 95 96 } … … 141 142 this.data = updateData(); 142 143 saveToDisk(); 143 Main.pref.putInt("cache." + ident, (int) (TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())));144 Config.getPref().putInt("cache." + ident, (int) (TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()))); 144 145 return data; 145 146 } -
trunk/src/org/openstreetmap/josm/io/CachedFile.java
r12841 r12846 28 28 29 29 import org.openstreetmap.josm.Main; 30 import org.openstreetmap.josm.spi.preferences.Config; 30 31 import org.openstreetmap.josm.tools.HttpClient; 31 32 import org.openstreetmap.josm.tools.Logging; … … 381 382 if (!"file".equals(url.getProtocol())) { 382 383 String prefKey = getPrefKey(url, destDir); 383 List<String> localPath = new ArrayList<>( Main.pref.getList(prefKey));384 List<String> localPath = new ArrayList<>(Config.getPref().getList(prefKey)); 384 385 if (localPath.size() == 2) { 385 386 File lfile = new File(localPath.get(1)); … … 388 389 } 389 390 } 390 Main.pref.putList(prefKey, null);391 Config.getPref().putList(prefKey, null); 391 392 } 392 393 } catch (MalformedURLException e) { … … 419 420 Long ifModifiedSince = null; 420 421 File localFile = null; 421 List<String> localPathEntry = new ArrayList<>( Main.pref.getList(prefKey));422 List<String> localPathEntry = new ArrayList<>(Config.getPref().getList(prefKey)); 422 423 boolean offline = false; 423 424 try { … … 476 477 if (localFile == null) 477 478 throw new AssertionError(); 478 Main.pref.putList(prefKey,479 Config.getPref().putList(prefKey, 479 480 Arrays.asList(Long.toString(System.currentTimeMillis()), localPathEntry.get(1))); 480 481 return localFile; … … 488 489 localFile = new File(destDir, localPath); 489 490 if (Main.platform.rename(destDirFile, localFile)) { 490 Main.pref.putList(prefKey,491 Config.getPref().putList(prefKey, 491 492 Arrays.asList(Long.toString(System.currentTimeMillis()), localFile.toString())); 492 493 } else { -
trunk/src/org/openstreetmap/josm/io/CertificateAmendment.java
r12623 r12846 29 29 30 30 import org.openstreetmap.josm.Main; 31 import org.openstreetmap.josm.spi.preferences.Config; 31 32 import org.openstreetmap.josm.tools.Logging; 32 33 import org.openstreetmap.josm.tools.Utils; … … 119 120 */ 120 121 public static void addMissingCertificates() throws IOException, GeneralSecurityException { 121 if (! Main.pref.getBoolean("tls.add-missing-certificates", true))122 if (!Config.getPref().getBoolean("tls.add-missing-certificates", true)) 122 123 return; 123 124 KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); -
trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java
r12841 r12846 18 18 import java.util.TreeSet; 19 19 20 import org.openstreetmap.josm. Main;20 import org.openstreetmap.josm.spi.preferences.Config; 21 21 import org.openstreetmap.josm.tools.Logging; 22 22 … … 126 126 */ 127 127 public final void initFromPreferences() { 128 String value = Main.pref.get(PROXY_POLICY);128 String value = Config.getPref().get(PROXY_POLICY); 129 129 if (value.isEmpty()) { 130 130 proxyPolicy = ProxyPolicy.NO_PROXY; … … 137 137 } 138 138 } 139 String host = Main.pref.get(PROXY_HTTP_HOST, null);140 int port = parseProxyPortValue(PROXY_HTTP_PORT, Main.pref.get(PROXY_HTTP_PORT, null));139 String host = Config.getPref().get(PROXY_HTTP_HOST, null); 140 int port = parseProxyPortValue(PROXY_HTTP_PORT, Config.getPref().get(PROXY_HTTP_PORT, null)); 141 141 httpProxySocketAddress = null; 142 142 if (proxyPolicy.equals(ProxyPolicy.USE_HTTP_PROXY)) { … … 149 149 } 150 150 151 host = Main.pref.get(PROXY_SOCKS_HOST, null);152 port = parseProxyPortValue(PROXY_SOCKS_PORT, Main.pref.get(PROXY_SOCKS_PORT, null));151 host = Config.getPref().get(PROXY_SOCKS_HOST, null); 152 port = parseProxyPortValue(PROXY_SOCKS_PORT, Config.getPref().get(PROXY_SOCKS_PORT, null)); 153 153 socksProxySocketAddress = null; 154 154 if (proxyPolicy.equals(ProxyPolicy.USE_SOCKS_PROXY)) { … … 161 161 } 162 162 proxyExceptions = new HashSet<>( 163 Main.pref.getList(PROXY_EXCEPTIONS,163 Config.getPref().getList(PROXY_EXCEPTIONS, 164 164 Arrays.asList("localhost", IPV4_LOOPBACK, IPV6_LOOPBACK)) 165 165 ); -
trunk/src/org/openstreetmap/josm/io/MessageNotifier.java
r12767 r12846 20 20 import org.openstreetmap.josm.io.auth.CredentialsManager; 21 21 import org.openstreetmap.josm.io.auth.JosmPreferencesCredentialAgent; 22 import org.openstreetmap.josm.spi.preferences.Config; 22 23 import org.openstreetmap.josm.tools.Logging; 23 24 import org.openstreetmap.josm.tools.Utils; … … 142 143 return credManager.lookupOAuthAccessToken() != null; 143 144 } else { 144 String username = Main.pref.get("osm-server.username", null);145 String password = Main.pref.get("osm-server.password", null);145 String username = Config.getPref().get("osm-server.username", null); 146 String password = Config.getPref().get("osm-server.password", null); 146 147 return username != null && !username.isEmpty() && password != null && !password.isEmpty(); 147 148 } -
trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
r12841 r12846 24 24 import java.util.concurrent.Future; 25 25 26 import org.openstreetmap.josm.Main;27 26 import org.openstreetmap.josm.data.osm.DataSet; 28 27 import org.openstreetmap.josm.data.osm.DataSetMerger; … … 37 36 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 38 37 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 38 import org.openstreetmap.josm.spi.preferences.Config; 39 39 import org.openstreetmap.josm.tools.Logging; 40 40 import org.openstreetmap.josm.tools.Utils; … … 321 321 // Build a list of fetchers that will download smaller sets containing only MAX_IDS_PER_REQUEST (200) primitives each. 322 322 // we will run up to MAX_DOWNLOAD_THREADS concurrent fetchers. 323 int threadsNumber = Main.pref.getInt("osm.download.threads", OsmApi.MAX_DOWNLOAD_THREADS);323 int threadsNumber = Config.getPref().getInt("osm.download.threads", OsmApi.MAX_DOWNLOAD_THREADS); 324 324 threadsNumber = Utils.clamp(threadsNumber, 1, OsmApi.MAX_DOWNLOAD_THREADS); 325 325 final ExecutorService exec = Executors.newFixedThreadPool( -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r12841 r12846 33 33 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 34 34 import org.openstreetmap.josm.io.Capabilities.CapabilitiesParser; 35 import org.openstreetmap.josm.spi.preferences.Config; 35 36 import org.openstreetmap.josm.tools.CheckParameterUtil; 36 37 import org.openstreetmap.josm.tools.HttpClient; … … 132 133 133 134 private static String getServerUrlFromPref() { 134 return Main.pref.get("osm-server.url", DEFAULT_API_URL);135 return Config.getPref().get("osm-server.url", DEFAULT_API_URL); 135 136 } 136 137 … … 593 594 */ 594 595 protected int getMaxRetries() { 595 int ret = Main.pref.getInt("osm-server.max-num-retries", DEFAULT_MAX_NUM_RETRIES);596 int ret = Config.getPref().getInt("osm-server.max-num-retries", DEFAULT_MAX_NUM_RETRIES); 596 597 return Math.max(ret, 0); 597 598 } … … 611 612 */ 612 613 public static String getAuthMethod() { 613 return Main.pref.get("osm-server.auth-method", "oauth");614 return Config.getPref().get("osm-server.auth-method", "oauth"); 614 615 } 615 616 -
trunk/src/org/openstreetmap/josm/io/UploadStrategy.java
r12687 r12846 7 7 8 8 import org.openstreetmap.josm.Main; 9 import org.openstreetmap.josm.spi.preferences.Config; 9 10 import org.openstreetmap.josm.tools.Logging; 10 11 … … 76 77 */ 77 78 public static UploadStrategy getFromPreferences() { 78 String v = Main.pref.get("osm-server.upload-strategy", null);79 String v = Config.getPref().get("osm-server.upload-strategy", null); 79 80 if (v == null) { 80 81 // legacy support. Until 12/2009 we had osm-server.atomic-upload only. … … 82 83 // When the preferences are saved the next time, "osm-server.upload-strategy" 83 84 // will be inserted. 84 v = Main.pref.get("osm-server.atomic-upload", null);85 v = Config.getPref().get("osm-server.atomic-upload", null); 85 86 if (v != null) { 86 87 Main.pref.removeFromCollection("osm-server.atomic-upload", v); … … 110 111 */ 111 112 public static void saveToPreferences(UploadStrategy strategy) { 112 Main.pref.put("osm-server.upload-strategy", strategy.getPreferenceValue());113 Config.getPref().put("osm-server.upload-strategy", strategy.getPreferenceValue()); 113 114 } 114 115 } -
trunk/src/org/openstreetmap/josm/io/audio/AudioPlayer.java
r12715 r12846 5 5 import java.net.URL; 6 6 7 import org.openstreetmap.josm. Main;7 import org.openstreetmap.josm.spi.preferences.Config; 8 8 import org.openstreetmap.josm.tools.JosmRuntimeException; 9 9 import org.openstreetmap.josm.tools.Logging; … … 234 234 command = new Execute(); 235 235 playingUrl = null; 236 double leadIn = Main.pref.getDouble("audio.leadin", 1.0 /* default, seconds */);237 double calibration = Main.pref.getDouble("audio.calibration", 1.0 /* default, ratio */);236 double leadIn = Config.getPref().getDouble("audio.leadin", 1.0 /* default, seconds */); 237 double calibration = Config.getPref().getDouble("audio.calibration", 1.0 /* default, ratio */); 238 238 try { 239 239 soundPlayer = (SoundPlayer) Class.forName("org.openstreetmap.josm.io.audio.JavaFxMediaPlayer").getConstructor().newInstance(); -
trunk/src/org/openstreetmap/josm/io/audio/AudioUtil.java
r12620 r12846 16 16 17 17 import org.openstreetmap.josm.Main; 18 import org.openstreetmap.josm.spi.preferences.Config; 18 19 import org.openstreetmap.josm.tools.Logging; 19 20 … … 44 45 * audioFormat.getFrameSize() /* bytes per frame */; 45 46 double naturalLength = filesize / bytesPerSecond; 46 double calibration = Main.pref.getDouble("audio.calibration", 1.0 /* default, ratio */);47 double calibration = Config.getPref().getDouble("audio.calibration", 1.0 /* default, ratio */); 47 48 return naturalLength / calibration; 48 49 } catch (UnsupportedAudioFileException | IOException e) { -
trunk/src/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialAgent.java
r12805 r12846 11 11 import javax.swing.text.html.HTMLEditorKit; 12 12 13 import org.openstreetmap.josm.Main;14 13 import org.openstreetmap.josm.data.oauth.OAuthToken; 15 14 import org.openstreetmap.josm.gui.widgets.HtmlPanel; 16 15 import org.openstreetmap.josm.io.DefaultProxySelector; 17 16 import org.openstreetmap.josm.io.OsmApi; 17 import org.openstreetmap.josm.spi.preferences.Config; 18 18 19 19 /** … … 36 36 case SERVER: 37 37 if (Objects.equals(OsmApi.getOsmApi().getHost(), host)) { 38 user = Main.pref.get("osm-server.username", null);39 password = Main.pref.get("osm-server.password", null);38 user = Config.getPref().get("osm-server.username", null); 39 password = Config.getPref().get("osm-server.password", null); 40 40 } else if (host != null) { 41 user = Main.pref.get("server.username."+host, null);42 password = Main.pref.get("server.password."+host, null);41 user = Config.getPref().get("server.username."+host, null); 42 password = Config.getPref().get("server.password."+host, null); 43 43 } else { 44 44 user = null; … … 49 49 return new PasswordAuthentication(user, password == null ? new char[0] : password.toCharArray()); 50 50 case PROXY: 51 user = Main.pref.get(DefaultProxySelector.PROXY_USER, null);52 password = Main.pref.get(DefaultProxySelector.PROXY_PASS, null);51 user = Config.getPref().get(DefaultProxySelector.PROXY_USER, null); 52 password = Config.getPref().get(DefaultProxySelector.PROXY_PASS, null); 53 53 if (user == null) 54 54 return null; … … 68 68 case SERVER: 69 69 if (Objects.equals(OsmApi.getOsmApi().getHost(), host)) { 70 Main.pref.put("osm-server.username", credentials.getUserName());70 Config.getPref().put("osm-server.username", credentials.getUserName()); 71 71 if (credentials.getPassword() == null) { 72 Main.pref.put("osm-server.password", null);72 Config.getPref().put("osm-server.password", null); 73 73 } else { 74 Main.pref.put("osm-server.password", String.valueOf(credentials.getPassword()));74 Config.getPref().put("osm-server.password", String.valueOf(credentials.getPassword())); 75 75 } 76 76 } else if (host != null) { 77 Main.pref.put("server.username."+host, credentials.getUserName());77 Config.getPref().put("server.username."+host, credentials.getUserName()); 78 78 if (credentials.getPassword() == null) { 79 Main.pref.put("server.password."+host, null);79 Config.getPref().put("server.password."+host, null); 80 80 } else { 81 Main.pref.put("server.password."+host, String.valueOf(credentials.getPassword()));81 Config.getPref().put("server.password."+host, String.valueOf(credentials.getPassword())); 82 82 } 83 83 } 84 84 break; 85 85 case PROXY: 86 Main.pref.put(DefaultProxySelector.PROXY_USER, credentials.getUserName());86 Config.getPref().put(DefaultProxySelector.PROXY_USER, credentials.getUserName()); 87 87 if (credentials.getPassword() == null) { 88 Main.pref.put(DefaultProxySelector.PROXY_PASS, null);88 Config.getPref().put(DefaultProxySelector.PROXY_PASS, null); 89 89 } else { 90 Main.pref.put(DefaultProxySelector.PROXY_PASS, String.valueOf(credentials.getPassword()));90 Config.getPref().put(DefaultProxySelector.PROXY_PASS, String.valueOf(credentials.getPassword())); 91 91 } 92 92 break; … … 103 103 @Override 104 104 public OAuthToken lookupOAuthAccessToken() throws CredentialsAgentException { 105 String accessTokenKey = Main.pref.get("oauth.access-token.key", null);106 String accessTokenSecret = Main.pref.get("oauth.access-token.secret", null);105 String accessTokenKey = Config.getPref().get("oauth.access-token.key", null); 106 String accessTokenSecret = Config.getPref().get("oauth.access-token.secret", null); 107 107 if (accessTokenKey == null && accessTokenSecret == null) 108 108 return null; … … 119 119 public void storeOAuthAccessToken(OAuthToken accessToken) throws CredentialsAgentException { 120 120 if (accessToken == null) { 121 Main.pref.put("oauth.access-token.key", null);122 Main.pref.put("oauth.access-token.secret", null);121 Config.getPref().put("oauth.access-token.key", null); 122 Config.getPref().put("oauth.access-token.secret", null); 123 123 } else { 124 Main.pref.put("oauth.access-token.key", accessToken.getKey());125 Main.pref.put("oauth.access-token.secret", accessToken.getSecret());124 Config.getPref().put("oauth.access-token.key", accessToken.getKey()); 125 Config.getPref().put("oauth.access-token.secret", accessToken.getSecret()); 126 126 } 127 127 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/PermissionPrefWithDefault.java
r8510 r12846 7 7 import java.util.List; 8 8 9 import org.openstreetmap.josm. Main;9 import org.openstreetmap.josm.spi.preferences.Config; 10 10 11 11 /** … … 54 54 55 55 public boolean isAllowed() { 56 return Main.pref.getBoolean(pref, defaultVal);56 return Config.getPref().getBoolean(pref, defaultVal); 57 57 } 58 58 -
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControl.java
r12703 r12846 11 11 import org.openstreetmap.josm.data.preferences.BooleanProperty; 12 12 import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler; 13 import org.openstreetmap.josm.spi.preferences.Config; 13 14 import org.openstreetmap.josm.tools.Logging; 14 15 … … 105 106 */ 106 107 public static InetAddress getInet6Address() throws UnknownHostException { 107 for (InetAddress a : InetAddress.getAllByName( Main.pref.get("remote.control.host.ipv6", "::1"))) {108 for (InetAddress a : InetAddress.getAllByName(Config.getPref().get("remote.control.host.ipv6", "::1"))) { 108 109 if (a instanceof Inet6Address) { 109 110 return a; … … 121 122 public static InetAddress getInet4Address() throws UnknownHostException { 122 123 // Return an address to the loopback interface by default 123 for (InetAddress a : InetAddress.getAllByName( Main.pref.get("remote.control.host.ipv4", "127.0.0.1"))) {124 for (InetAddress a : InetAddress.getAllByName(Config.getPref().get("remote.control.host.ipv4", "127.0.0.1"))) { 124 125 if (a instanceof Inet4Address) { 125 126 return a; -
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java
r12841 r12846 9 9 import java.net.SocketException; 10 10 11 import org.openstreetmap.josm. Main;11 import org.openstreetmap.josm.spi.preferences.Config; 12 12 import org.openstreetmap.josm.tools.Logging; 13 13 … … 33 33 public static void restartRemoteControlHttpServer() { 34 34 stopRemoteControlHttpServer(); 35 int port = Main.pref.getInt("remote.control.port", 8111);35 int port = Config.getPref().getInt("remote.control.port", 8111); 36 36 try { 37 37 instance4 = new RemoteControlHttpServer(port, false); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java
r12841 r12846 41 41 import org.openstreetmap.josm.Main; 42 42 import org.openstreetmap.josm.data.preferences.StringProperty; 43 import org.openstreetmap.josm.spi.preferences.Config; 43 44 import org.openstreetmap.josm.tools.Logging; 44 45 … … 312 313 stopRemoteControlHttpsServer(); 313 314 if (RemoteControl.PROP_REMOTECONTROL_HTTPS_ENABLED.get()) { 314 int port = Main.pref.getInt("remote.control.https.port", HTTPS_PORT);315 int port = Config.getPref().getInt("remote.control.https.port", HTTPS_PORT); 315 316 try { 316 317 instance4 = new RemoteControlHttpsServer(port, false); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandler.java
r12726 r12846 8 8 import java.util.Map; 9 9 10 import org.openstreetmap.josm.Main;11 10 import org.openstreetmap.josm.actions.AutoScaleAction; 12 11 import org.openstreetmap.josm.command.AddCommand; … … 20 19 import org.openstreetmap.josm.io.remotecontrol.AddTagsDialog; 21 20 import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault; 21 import org.openstreetmap.josm.spi.preferences.Config; 22 22 import org.openstreetmap.josm.tools.Logging; 23 23 … … 92 92 Point p = mapView.getPoint(ll); 93 93 node = mapView.getNearestNode(p, OsmPrimitive::isUsable); 94 if (node != null && node.getCoor().greatCircleDistance(ll) > Main.pref.getDouble("remotecontrol.tolerance", 0.1)) {94 if (node != null && node.getCoor().greatCircleDistance(ll) > Config.getPref().getDouble("remotecontrol.tolerance", 0.1)) { 95 95 node = null; // node is too far 96 96 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandler.java
r12726 r12846 28 28 import org.openstreetmap.josm.io.remotecontrol.AddTagsDialog; 29 29 import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault; 30 import org.openstreetmap.josm.spi.preferences.Config; 30 31 31 32 /** … … 130 131 MapView mapView = MainApplication.getMap().mapView; 131 132 nd = mapView.getNearestNode(mapView.getPoint(ll), OsmPrimitive::isUsable); 132 if (nd != null && nd.getCoor().greatCircleDistance(ll) > Main.pref.getDouble("remote.tolerance", 0.1)) {133 if (nd != null && nd.getCoor().greatCircleDistance(ll) > Config.getPref().getDouble("remote.tolerance", 0.1)) { 133 134 nd = null; // node is too far 134 135 } … … 138 139 for (Entry<LatLon, Node> entry : addedNodes.entrySet()) { 139 140 LatLon lOld = entry.getKey(); 140 if (lOld.greatCircleDistance(ll) < Main.pref.getDouble("remotecontrol.tolerance", 0.1)) {141 if (lOld.greatCircleDistance(ll) < Config.getPref().getDouble("remotecontrol.tolerance", 0.1)) { 141 142 prev = entry.getValue(); 142 143 break; -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java
r12643 r12846 15 15 import org.openstreetmap.josm.gui.MainApplication; 16 16 import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault; 17 import org.openstreetmap.josm.spi.preferences.Config; 17 18 import org.openstreetmap.josm.tools.Logging; 18 19 import org.openstreetmap.josm.tools.Utils; … … 40 41 Logging.debug("Remote control, /import: defaulting to DownloadOsmTask"); 41 42 new DownloadOsmTask().loadUrl(isLoadInNewLayer(), url.toExternalForm(), null); 42 } else if ( Main.pref.getBoolean("remotecontrol.import.interactive", true)) {43 } else if (Config.getPref().getBoolean("remotecontrol.import.interactive", true)) { 43 44 // OpenLocationAction queries the user if more than one task is suitable 44 45 MainApplication.getMenu().openLocation.openUrl(isLoadInNewLayer(), url.toExternalForm()); … … 101 102 protected void validateRequest() throws RequestHandlerBadRequestException { 102 103 String urlString = args != null ? args.get("url") : null; 103 if ( Main.pref.getBoolean("remotecontrol.importhandler.fix_url_query", true)) {104 if (Config.getPref().getBoolean("remotecontrol.importhandler.fix_url_query", true)) { 104 105 urlString = Utils.fixURLQuery(urlString); 105 106 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
r12656 r12846 23 23 import org.openstreetmap.josm.data.osm.Relation; 24 24 import org.openstreetmap.josm.data.osm.SimplePrimitiveId; 25 import org.openstreetmap.josm.data.osm.search.SearchCompiler; 25 26 import org.openstreetmap.josm.data.osm.search.SearchParseError; 26 import org.openstreetmap.josm.data.osm.search.SearchCompiler;27 27 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 28 28 import org.openstreetmap.josm.gui.MainApplication; -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java
r12620 r12846 20 20 import org.openstreetmap.josm.Main; 21 21 import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault; 22 import org.openstreetmap.josm.spi.preferences.Config; 22 23 import org.openstreetmap.josm.tools.Logging; 23 24 import org.openstreetmap.josm.tools.Utils; … … 147 148 */ 148 149 PermissionPrefWithDefault permissionPref = getPermissionPref(); 149 if (permissionPref != null && permissionPref.pref != null && ! Main.pref.getBoolean(permissionPref.pref, permissionPref.defaultVal)) {150 if (permissionPref != null && permissionPref.pref != null && !Config.getPref().getBoolean(permissionPref.pref, permissionPref.defaultVal)) { 150 151 String err = MessageFormat.format("RemoteControl: ''{0}'' forbidden by preferences", myCommand); 151 152 Logging.info(err); … … 156 157 * If yes, display specific confirmation message. 157 158 */ 158 if ( Main.pref.getBoolean(globalConfirmationKey, globalConfirmationDefault)) {159 if (Config.getPref().getBoolean(globalConfirmationKey, globalConfirmationDefault)) { 159 160 // Ensure dialog box does not exceed main window size 160 161 Integer maxWidth = (int) Math.max(200, Main.parent.getWidth()*0.6); … … 276 277 return args.get("new_layer") != null && !args.get("new_layer").isEmpty() 277 278 ? Boolean.parseBoolean(args.get("new_layer")) 278 : Main.pref.getBoolean(loadInNewLayerKey, loadInNewLayerDefault);279 : Config.getPref().getBoolean(loadInNewLayerKey, loadInNewLayerDefault); 279 280 } 280 281
Note:
See TracChangeset
for help on using the changeset viewer.