Changeset 1670 in josm for trunk/src/org/openstreetmap/josm/actions/UpdateDataAction.java
- Timestamp:
- 15.06.2009 20:22:46 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/UpdateDataAction.java
r1465 r1670 15 15 import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTaskList; 16 16 import org.openstreetmap.josm.data.osm.DataSource; 17 import org.openstreetmap.josm.gui.ExtendedDialog;18 17 import org.openstreetmap.josm.tools.Shortcut; 19 18 … … 26 25 tr("Update Data"), 27 26 KeyEvent.VK_U, 28 Shortcut.GROUP_ NONE),29 true);27 Shortcut.GROUP_HOTKEY), 28 true); 30 29 } 31 30 … … 33 32 int bboxCount = 0; 34 33 List<Area> areas = new ArrayList<Area>(); 35 for(DataSource ds : Main.main.editLayer().data.dataSources) 34 for(DataSource ds : Main.main.editLayer().data.dataSources) { 36 35 areas.add(new Area(ds.bounds.asRect())); 37 38 // This would loop over all DataLayers but download all data to the currently 39 // selected one 40 /*for(Layer l : Main.map.mapView.getAllLayers()) { 41 if(!(l instanceof OsmDataLayer)) continue; 42 43 for(DataSource ds : ((OsmDataLayer)l).data.dataSources) 44 areas.add(new Area(ds.bounds.asRect())); 45 }*/ 36 } 46 37 47 38 // The next two blocks removes every intersection from every DataSource Area … … 62 53 63 54 for(Area a : areas) { 64 if(a.isEmpty()) 55 if(a.isEmpty()) { 65 56 continue; 57 } 66 58 bboxCount++; 67 59 } … … 69 61 if(bboxCount == 0) { 70 62 JOptionPane.showMessageDialog(Main.parent, 71 tr("No data to update found. Have you already opened or downloaded a data layer?"));72 return;63 tr("No data to update found. Have you already opened or downloaded a data layer?")); 64 return; 73 65 } 74 75 int result = new ExtendedDialog(Main.parent,76 tr("Update Data"),77 tr("This action will require {0} individual download requests. "78 + "Do you wish to continue?", bboxCount),79 new String[] { tr("Update Data"), tr("Cancel") },80 new String[] { "updatedata.png", "cancel.png" }).getValue();81 82 if(result != 1)83 return;84 66 85 67 new DownloadOsmTaskList().download(false, areas); 86 68 } 87 88 69 }
Note: See TracChangeset
for help on using the changeset viewer.
