Changeset 4883 in josm
- Timestamp:
- 2012-02-01T19:39:19+01:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/RemoteControlPreference.java
r4310 r4883 52 52 private JCheckBox permissionChangeViewport = new JCheckBox(tr("Change the viewport")); 53 53 private JCheckBox permissionReadProtocolversion = new JCheckBox(tr("Read protocol version")); 54 private JCheckBox loadInNewLayer = new JCheckBox(tr("Download objects to new layer")); 54 55 private JCheckBox alwaysAskUserConfirm = new JCheckBox(tr("Confirm all Remote Control actions manually")); 55 56 … … 84 85 wrapper.add(new JSeparator(), GBC.eop().fill(GBC.HORIZONTAL).insets(15, 5, 15, 5)); 85 86 87 wrapper.add(loadInNewLayer, GBC.eol().fill(GBC.HORIZONTAL)); 88 86 89 wrapper.add(alwaysAskUserConfirm, GBC.eol().fill(GBC.HORIZONTAL)); 87 90 … … 101 104 permissionCreateObjects.setSelected(Main.pref.getBoolean(AddNodeHandler.permissionKey, AddNodeHandler.permissionDefault)); 102 105 permissionReadProtocolversion.setSelected(Main.pref.getBoolean(VersionHandler.permissionKey, VersionHandler.permissionDefault)); 106 loadInNewLayer.setSelected(Main.pref.getBoolean(RequestHandler.loadInNewLayerKey, RequestHandler.loadInNewLayerDefault)); 103 107 alwaysAskUserConfirm.setSelected(Main.pref.getBoolean(RequestHandler.globalConfirmationKey, RequestHandler.globalConfirmationDefault)); 104 108 … … 128 132 Main.pref.put(AddNodeHandler.permissionKey, permissionCreateObjects.isSelected()); 129 133 Main.pref.put(VersionHandler.permissionKey, permissionReadProtocolversion.isSelected()); 134 Main.pref.put(RequestHandler.loadInNewLayerKey, loadInNewLayer.isSelected()); 130 135 Main.pref.put(RequestHandler.globalConfirmationKey, alwaysAskUserConfirm.isSelected()); 131 136 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
r4858 r4883 68 68 minlon = Double.parseDouble(args.get("left")); 69 69 maxlon = Double.parseDouble(args.get("right")); 70 boolean newLayer = Boolean.parseBoolean(args.get("new_layer"));70 boolean newLayer = isLoadInNewLayer(); 71 71 72 72 if(command.equals(myCommand)) -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandler.java
r4834 r4883 33 33 ps.add(SimplePrimitiveId.fromString(i)); 34 34 } 35 boolean newLayer = Boolean.parseBoolean(args.get("new_layer"));35 boolean newLayer = isLoadInNewLayer(); 36 36 boolean relationMembers = Boolean.parseBoolean(args.get("relation_members")); 37 37 DownloadPrimitiveAction.processItems(newLayer, ps, true, relationMembers); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java
r4834 r4883 24 24 public static final String globalConfirmationKey = "remotecontrol.always-confirm"; 25 25 public static final boolean globalConfirmationDefault = false; 26 public static final String loadInNewLayerKey = "remotecontrol.new-layer"; 27 public static final boolean loadInNewLayerDefault = false; 26 28 27 29 /** The GET request arguments */ … … 210 212 } 211 213 214 protected boolean isLoadInNewLayer() { 215 return args.get("new_layer") != null && !args.get("new_layer").isEmpty() 216 ? Boolean.parseBoolean(args.get("new_layer")) 217 : Main.pref.getBoolean(loadInNewLayerKey, loadInNewLayerDefault); 218 } 219 212 220 public static class RequestHandlerException extends Exception { 213 221
Note:
See TracChangeset
for help on using the changeset viewer.