Changeset 6509 in josm for trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java
- Timestamp:
- 2013-12-22T18:18:43+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java
r6380 r6509 307 307 308 308 /** 309 * Remembers the current settings in the download dialog 310 * 309 * Remembers the current settings in the download dialog. 311 310 */ 312 311 public void rememberSettings() { … … 320 319 } 321 320 321 /** 322 * Restores the previous settings in the download dialog. 323 */ 322 324 public void restoreSettings() { 323 325 cbDownloadOsmData.setSelected(Main.pref.getBoolean("download.osm", true)); … … 339 341 boundingBoxChanged(currentBounds,null); 340 342 } 341 else if (!Main.pref.get("osm-download.bounds").isEmpty()) { 342 // read the bounding box from the preferences 343 else { 344 Bounds bounds = getSavedDownloadBounds(); 345 if (bounds != null) { 346 currentBounds = bounds; 347 boundingBoxChanged(currentBounds, null); 348 } 349 } 350 } 351 352 /** 353 * Returns the previously saved bounding box from preferences. 354 * @return The bounding box saved in preferences if any, {@code null} otherwise 355 * @since 6509 356 */ 357 public static Bounds getSavedDownloadBounds() { 358 String value = Main.pref.get("osm-download.bounds"); 359 if (!value.isEmpty()) { 343 360 try { 344 currentBounds = new Bounds(Main.pref.get("osm-download.bounds"), ";"); 345 boundingBoxChanged(currentBounds,null); 346 } 347 catch (Exception e) { 348 e.printStackTrace(); 349 } 350 } 351 } 352 361 return new Bounds(value, ";"); 362 } catch (IllegalArgumentException e) { 363 Main.warn(e); 364 } 365 } 366 return null; 367 } 368 369 /** 370 * Determines if the dialog autorun is enabled in preferences. 371 * @return {@code true} if the download dialog must be open at startup, {@code false} otherwise 372 */ 353 373 public static boolean isAutorunEnabled() { 354 374 return Main.pref.getBoolean("download.autorun",false); … … 362 382 363 383 /** 364 * Replies the currently selected download area. May be null, if no download area is selected yet. 384 * Replies the currently selected download area. 385 * @return the currently selected download area. May be {@code null}, if no download area is selected yet. 365 386 */ 366 387 public Bounds getSelectedDownloadArea() {
Note:
See TracChangeset
for help on using the changeset viewer.