- Timestamp:
- 2019-09-19T16:30:27+02:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/DownloadAlongAction.java
r15350 r15363 123 123 * @param gpxDownload Set to true if GPX data should be downloaded 124 124 * @param title the title string for the confirmation dialog 125 */ 126 protected static void confirmAndDownloadAreas(Area a, double maxArea, boolean osmDownload, boolean gpxDownload, String title) { 125 * @param newLayer Set to true if all areas should be put into a single new layer 126 */ 127 protected static void confirmAndDownloadAreas(Area a, double maxArea, boolean osmDownload, boolean gpxDownload, String title, 128 boolean newLayer) { 127 129 List<Rectangle2D> toDownload = new ArrayList<>(); 128 130 addToDownload(a, a.getBounds(), toDownload, maxArea); … … 140 142 final PleaseWaitProgressMonitor monitor = new PleaseWaitProgressMonitor(tr("Download data")); 141 143 final Future<?> future = new DownloadTaskList(Config.getPref().getBoolean("download.along.zoom-after-download")) 142 .download( false, toDownload, osmDownload, gpxDownload, monitor);144 .download(newLayer, toDownload, osmDownload, gpxDownload, monitor); 143 145 waitFuture(future, monitor); 144 146 } … … 179 181 * @param panel the panel that was displayed to the user and now contains his selections 180 182 * @param confirmTitle the title to display in the confirmation panel 183 * @param newLayer Set to true if all areas should be put into a single new layer 181 184 * @return the task or null if canceled by user 182 185 */ 183 protected PleaseWaitRunnable createCalcTask(Path2D alongPath, DownloadAlongPanel panel, String confirmTitle ) {186 protected PleaseWaitRunnable createCalcTask(Path2D alongPath, DownloadAlongPanel panel, String confirmTitle, boolean newLayer) { 184 187 /* 185 188 * Find the average latitude for the data we're contemplating, so we can know how many … … 221 224 222 225 private final Path2D downloadPath = new Path2D.Double(); 226 private final boolean newLayer; 223 227 private boolean cancel; 224 228 private int ticks; 225 229 private final Rectangle2D r = new Rectangle2D.Double(); 226 230 227 CalculateDownloadArea( ) {231 CalculateDownloadArea(boolean newLayer) { 228 232 super(tr("Calculating Download Area"), displayProgress ? null : NullProgressMonitor.INSTANCE, false); 233 this.newLayer = newLayer; 229 234 } 230 235 … … 245 250 } 246 251 confirmAndDownloadAreas(new Area(downloadPath), maxArea, panel.isDownloadOsmData(), panel.isDownloadGpxData(), 247 confirmTitle );252 confirmTitle, newLayer); 248 253 } 249 254 … … 291 296 } 292 297 293 return new CalculateDownloadArea( );298 return new CalculateDownloadArea(newLayer); 294 299 } 295 300 -
trunk/src/org/openstreetmap/josm/actions/DownloadAlongWayAction.java
r15028 r15363 54 54 PREF_DOWNLOAD_ALONG_WAY_DISTANCE, PREF_DOWNLOAD_ALONG_WAY_AREA, null); 55 55 56 if (0 != panel.showInDownloadDialog(tr("Download from OSM along selected ways"), HelpUtil.ht("/Tools/DownloadAlong"))) { 56 int ret = panel.showInDownloadDialog(tr("Download from OSM along selected ways"), HelpUtil.ht("/Tools/DownloadAlong")); 57 if (0 != ret && 1 != ret) { 57 58 return null; 58 59 } … … 71 72 } 72 73 } 73 return createCalcTask(alongPath, panel, tr("Download from OSM along selected ways")); 74 74 return createCalcTask(alongPath, panel, tr("Download from OSM along selected ways"), 1 == ret); 75 75 } 76 76 -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongPanel.java
r14273 r15363 172 172 ), 173 173 new ButtonSpec( 174 tr("Download as new layer"), 175 new ImageProvider("download_new_layer"), 176 tr("Click to download into a new data layer"), 177 null // no specific help text 178 ), 179 new ButtonSpec( 174 180 tr("Cancel"), 175 181 new ImageProvider("cancel"), … … 183 189 int ret = HelpAwareOptionPane.showOptionDialog(MainApplication.getMainFrame(), this, title, 184 190 JOptionPane.QUESTION_MESSAGE, null, options, options[0], helpTopic); 185 if (0 == ret ) {191 if (0 == ret || 1 == ret) { 186 192 rememberSettings(); 187 193 } -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackAction.java
r14962 r15363 50 50 PREF_DOWNLOAD_ALONG_TRACK_DISTANCE, PREF_DOWNLOAD_ALONG_TRACK_AREA, PREF_DOWNLOAD_ALONG_TRACK_NEAR); 51 51 52 if (0 != panel.showInDownloadDialog(tr("Download from OSM along this track"), HelpUtil.ht("/Action/DownloadAlongTrack"))) { 52 int ret = panel.showInDownloadDialog(tr("Download from OSM along this track"), HelpUtil.ht("/Action/DownloadAlongTrack")); 53 if (0 != ret && 1 != ret) { 53 54 return null; 54 55 } … … 79 80 } 80 81 } 81 return createCalcTask(gpxPath, panel, tr("Download from OSM along this track") );82 return createCalcTask(gpxPath, panel, tr("Download from OSM along this track"), 1 == ret); 82 83 } 83 84 }
Note:
See TracChangeset
for help on using the changeset viewer.