Changeset 8830 in josm for trunk/src/org


Ignore:
Timestamp:
2015-10-05T23:07:07+02:00 (4 years ago)
Author:
simon04
Message:

fix #9012 - Saving a converted osm/gpx layer should save with correct file extension preselected

Location:
trunk/src/org/openstreetmap/josm/gui/layer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r8807 r8830  
    743743            final GpxData data = toGpxData();
    744744            final GpxLayer gpxLayer = new GpxLayer(data, tr("Converted from: {0}", getName()));
     745            gpxLayer.setAssociatedFile(new File(getAssociatedFile().getParentFile(), getAssociatedFile().getName() + ".gpx"));
    745746            Main.main.addLayer(gpxLayer);
    746747            if (Main.pref.getBoolean("marker.makeautomarkers", true) && !data.waypoints.isEmpty()) {
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerAction.java

    r8804 r8830  
    77import java.awt.GridBagLayout;
    88import java.awt.event.ActionEvent;
     9import java.io.File;
    910import java.util.ArrayList;
    1011import java.util.List;
     
    128129        }
    129130        final DataSet ds = convert();
    130         final OsmDataLayer layer = new OsmDataLayer(ds, tr("Converted from: {0}", this.layer.getName()), this.layer.getAssociatedFile());
     131        final OsmDataLayer layer = new OsmDataLayer(ds, tr("Converted from: {0}", this.layer.getName()), null);
     132        layer.setAssociatedFile(new File(this.layer.getAssociatedFile().getParentFile(), this.layer.getAssociatedFile().getName() + ".osm"));
    131133        layer.setUploadDiscouraged(true);
    132134        Main.main.addLayer(layer);
Note: See TracChangeset for help on using the changeset viewer.