Ignore:
Timestamp:
15.06.2009 20:22:46 (3 years ago)
Author:
Gubaer
Message:

fixed: bug in OsmApi.getOsmApi()
cleanup: exception handling in interfacing with OSM API
new: new action for updating individual elements with the their current state on the server (including new menu item in the file menu)
new: improved user feedback in case of conflicts
new: handles 410 Gone conflicts when uploading a changeset
new: undoable command for "purging" a primitive from the current dataset (necessary if the primitive is already deleted on the server and the user wants to remove it from its local dataset)
new: undoable command for "undeleting" an already deleted primitive on the server (kind of "cloning")
new: after a full upload, checks whether there are primitives in the local dataset which might be deleted on the server.
new: data structures for history data
new: history download support in io package

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/UpdateDataAction.java

    r1465 r1670  
    1515import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTaskList; 
    1616import org.openstreetmap.josm.data.osm.DataSource; 
    17 import org.openstreetmap.josm.gui.ExtendedDialog; 
    1817import org.openstreetmap.josm.tools.Shortcut; 
    1918 
     
    2625                        tr("Update Data"), 
    2726                        KeyEvent.VK_U, 
    28                         Shortcut.GROUP_NONE), 
    29                 true); 
     27                        Shortcut.GROUP_HOTKEY), 
     28                        true); 
    3029    } 
    3130 
     
    3332        int bboxCount = 0; 
    3433        List<Area> areas = new ArrayList<Area>(); 
    35         for(DataSource ds : Main.main.editLayer().data.dataSources) 
     34        for(DataSource ds : Main.main.editLayer().data.dataSources) { 
    3635            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        } 
    4637 
    4738        // The next two blocks removes every intersection from every DataSource Area 
     
    6253 
    6354        for(Area a : areas) { 
    64             if(a.isEmpty()) 
     55            if(a.isEmpty()) { 
    6556                continue; 
     57            } 
    6658            bboxCount++; 
    6759        } 
     
    6961        if(bboxCount == 0) { 
    7062            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; 
    7365        } 
    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; 
    8466 
    8567        new DownloadOsmTaskList().download(false, areas); 
    8668    } 
    87  
    8869} 
Note: See TracChangeset for help on using the changeset viewer.