Changeset 16575 in josm
- Timestamp:
- 2020-06-08T21:17:38+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreference.java
r15469 r16575 104 104 remote.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL)); 105 105 106 loadInNewLayer.setSelected(Config.getPref().getBoolean( 107 RequestHandler.loadInNewLayerKey, RequestHandler.loadInNewLayerDefault)); 108 alwaysAskUserConfirm.setSelected(Config.getPref().getBoolean( 109 RequestHandler.globalConfirmationKey, RequestHandler.globalConfirmationDefault)); 106 loadInNewLayer.setSelected(RequestHandler.LOAD_IN_NEW_LAYER.get()); 107 alwaysAskUserConfirm.setSelected(RequestHandler.GLOBAL_CONFIRMATION.get()); 110 108 111 109 ActionListener remoteControlEnabled = e -> GuiHelper.setEnabledRec(wrapper, enableRemoteControl.isSelected()); … … 123 121 Config.getPref().putBoolean(p.getKey().pref, p.getValue().isSelected()); 124 122 } 125 Config.getPref().putBoolean(RequestHandler.loadInNewLayerKey,loadInNewLayer.isSelected());126 Config.getPref().putBoolean(RequestHandler.globalConfirmationKey,alwaysAskUserConfirm.isSelected());123 RequestHandler.LOAD_IN_NEW_LAYER.put(loadInNewLayer.isSelected()); 124 RequestHandler.GLOBAL_CONFIRMATION.put(alwaysAskUserConfirm.isSelected()); 127 125 } 128 126 if (changed) { -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java
r16190 r16575 24 24 import org.openstreetmap.josm.data.osm.DownloadPolicy; 25 25 import org.openstreetmap.josm.data.osm.UploadPolicy; 26 import org.openstreetmap.josm.data.preferences.BooleanProperty; 26 27 import org.openstreetmap.josm.gui.MainApplication; 27 28 import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault; … … 38 39 public abstract class RequestHandler { 39 40 40 /** preference key to determine if all Remote Control actions must be confirmed manually */ 41 public static final String globalConfirmationKey = "remotecontrol.always-confirm"; 42 /** whether remote control actions must be confirmed manually by default */ 43 public static final boolean globalConfirmationDefault = false; 44 /** preference key to determine if remote control loads data in a new layer */ 45 public static final String loadInNewLayerKey = "remotecontrol.new-layer"; 46 /** whether remote control loads data in a new layer by default */ 47 public static final boolean loadInNewLayerDefault = false; 41 /** preference to determine if all Remote Control actions must be confirmed manually */ 42 public static final BooleanProperty GLOBAL_CONFIRMATION = new BooleanProperty("remotecontrol.always-confirm", false); 43 /** preference to determine if remote control loads data in a new layer */ 44 public static final BooleanProperty LOAD_IN_NEW_LAYER = new BooleanProperty("remotecontrol.new-layer", false); 48 45 49 46 protected static final Pattern SPLITTER_COMMA = Pattern.compile(",\\s*"); … … 199 196 * If yes, display specific confirmation message. 200 197 */ 201 if ( Config.getPref().getBoolean(globalConfirmationKey, globalConfirmationDefault)) {198 if (GLOBAL_CONFIRMATION.get()) { 202 199 // Ensure dialog box does not exceed main window size 203 200 Integer maxWidth = (int) Math.max(200, MainApplication.getMainFrame().getWidth()*0.6); … … 341 338 342 339 private boolean isLoadInNewLayer() { 343 return get("new_layer", Boolean::parseBoolean, () -> Config.getPref().getBoolean(loadInNewLayerKey, loadInNewLayerDefault));340 return get("new_layer", Boolean::parseBoolean, LOAD_IN_NEW_LAYER::get); 344 341 } 345 342
Note:
See TracChangeset
for help on using the changeset viewer.