Changeset 9461 in josm for trunk/src/org


Ignore:
Timestamp:
2016-01-15T13:04:22+01:00 (9 years ago)
Author:
bastiK
Message:

applied #12369 - default extension for saving files read from preferences (patch by kolesar)

Location:
trunk/src/org/openstreetmap/josm
Files:
5 edited

Legend:

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

    r8510 r9461  
    8383                    layer.getClass().getName()));
    8484
    85         File file = createAndOpenSaveFileChooser(tr("Export GPX file"), GpxImporter.FILE_FILTER);
     85        File file = createAndOpenSaveFileChooser(tr("Export GPX file"), GpxImporter.getFileFilter());
    8686        if (file == null)
    8787            return;
  • trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java

    r8846 r9461  
    363363    @Override
    364364    public File createAndOpenSaveFileChooser() {
    365         return SaveActionBase.createAndOpenSaveFileChooser(tr("Save GPX file"), GpxImporter.FILE_FILTER);
     365        return SaveActionBase.createAndOpenSaveFileChooser(tr("Save GPX file"), GpxImporter.getFileFilter());
    366366    }
    367367
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r9078 r9461  
    965965    @Override
    966966    public File createAndOpenSaveFileChooser() {
    967         return SaveActionBase.createAndOpenSaveFileChooser(tr("Save OSM file"), "osm");
     967        String extension = Main.pref.get("save.extension.osm", "osm");
     968        return SaveActionBase.createAndOpenSaveFileChooser(tr("Save OSM file"), extension);
    968969    }
    969970
  • trunk/src/org/openstreetmap/josm/io/GpxExporter.java

    r9231 r9461  
    6363     */
    6464    public GpxExporter() {
    65         super(GpxImporter.FILE_FILTER);
     65        super(GpxImporter.getFileFilter());
    6666    }
    6767
  • trunk/src/org/openstreetmap/josm/io/GpxImporter.java

    r9078 r9461  
    2424 */
    2525public class GpxImporter extends FileImporter {
    26 
    27     /**
    28      * The GPX file filter (*.gpx and *.gpx.gz files).
    29      */
    30     public static final ExtensionFileFilter FILE_FILTER = ExtensionFileFilter.newFilterWithArchiveExtensions(
    31             "gpx", "gpx", tr("GPX Files"), true);
    3226
    3327    /**
     
    7165     */
    7266    public GpxImporter() {
    73         super(FILE_FILTER);
     67        super(getFileFilter());
     68    }
     69
     70    /**
     71     * Returns a GPX file filter (*.gpx and *.gpx.gz files).
     72     */
     73    public static ExtensionFileFilter getFileFilter() {
     74        return ExtensionFileFilter.newFilterWithArchiveExtensions(
     75            "gpx", Main.pref.get("save.extension.gpx", "gpx"), tr("GPX Files"), true);
    7476    }
    7577
Note: See TracChangeset for help on using the changeset viewer.