Changeset 28204 in osm for applications/editors


Ignore:
Timestamp:
2012-04-05T21:16:32+02:00 (13 years ago)
Author:
jttt
Message:

Improve "Drop existing path" option

Location:
applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/GPXLayerImportAction.java

    r26202 r28204  
    8181
    8282            JCheckBox dropFirst = new JCheckBox(tr("Drop existing path"));
     83            dropFirst.setEnabled(!this.data.getTracks().isEmpty());
    8384
    8485            panel.add(layerList);
     
    99100            }
    100101
    101             for (Object o : layerList.getSelectedValues()) {
    102                 GpxLayer gpx = (GpxLayer )o;
    103                 synchronized(importing) {
    104                     this.data.load(gpx.data, dropFirst.isSelected());
     102            if (dropFirst.isSelected()) {
     103                this.data.getTracks().clear();
     104            }
     105            synchronized(importing) {
     106                for (Object o : layerList.getSelectedValues()) {
     107                    GpxLayer gpx = (GpxLayer )o;
     108                    this.data.load(gpx.data);
    105109                }
    106110            }
  • applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxData.java

    r23650 r28204  
    1616    private final List<WayPoint> waypoints = new ArrayList<WayPoint>();
    1717
    18     public void load(GpxData data, boolean drop) {
    19         if(drop)
    20             tracks.clear();
     18    public void load(GpxData data) {
    2119        for (GpxTrack track: data.tracks) {
    2220            tracks.add(new EditGpxTrack(track));
Note: See TracChangeset for help on using the changeset viewer.