Ticket #2273: FixConvertActions.patch

File FixConvertActions.patch, 2.3 KB (added by xeen, 16 years ago)

Copy Filename when converting

  • src/org/openstreetmap/josm/gui/layer/GpxLayer.java

     
    668668                    ds.ways.add(w);
    669669                }
    670670            }
    671             Main.main.addLayer(new OsmDataLayer(ds, tr("Converted from: {0}", GpxLayer.this.name), null));
     671            Main.main.addLayer(new OsmDataLayer(ds, tr("Converted from: {0}", GpxLayer.this.name),
     672                        data.storageFile));
    672673            Main.main.removeLayer(GpxLayer.this);
    673674        }
    674675    }
  • src/org/openstreetmap/josm/gui/layer/Layer.java

     
    1515import org.openstreetmap.josm.tools.Destroyable;
    1616
    1717/**
    18  * A layer encapsulates the gui componente of one dataset and its representation.
     18 * A layer encapsulates the gui component of one dataset and its representation.
    1919 *
    20  * Some layers may display data directly importet from OSM server. Other only
     20 * Some layers may display data directly imported from OSM server. Other only
    2121 * display background images. Some can be edited, some not. Some are static and
    2222 * other changes dynamically (auto-updated).
    2323 *
  • src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

     
    381381        }
    382382    }
    383383
    384     public static GpxData toGpxData(DataSet data) {
     384    public static GpxData toGpxData(DataSet data, File file) {
    385385        GpxData gpxData = new GpxData();
     386        gpxData.storageFile = file;
    386387        HashSet<Node> doneNodes = new HashSet<Node>();
    387388        for (Way w : data.ways) {
    388389            if (w.incomplete || w.deleted) continue;
     
    432433    }
    433434
    434435    public GpxData toGpxData() {
    435         return toGpxData(data);
     436        return toGpxData(data, associatedFile);
    436437    }
    437438
    438439    public class ConvertToGpxLayerAction extends AbstractAction {