Ignore:
Timestamp:
2014-02-06T00:03:52+01:00 (6 years ago)
Author:
Don-vip
Message:

fix #9662 - correct handling of canceled gpx export

Location:
trunk/src/org/openstreetmap/josm/io
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/FileExporter.java

    r6070 r6815  
    1616
    1717    private boolean enabled;
     18    private boolean canceled;
    1819
     20    /**
     21     * Constructs a new {@code FileExporter}.
     22     * @param filter The extension file filter
     23     */
    1924    public FileExporter(ExtensionFileFilter filter) {
    2025        this.filter = filter;
     
    6267        // To be overriden by subclasses if needed
    6368    }
     69
     70    /**
     71     * Determines if this exporter has been canceled during export.
     72     * @return true if this {@code FileExporter} has been canceled
     73     * @since 6815
     74     */
     75    public final boolean isCanceled() {
     76        return canceled;
     77    }
     78
     79    /**
     80     * Marks this exporter as canceled.
     81     * @param canceled true to mark this exporter as canceled, {@code false} otherwise
     82     * @since 6815
     83     */
     84    public final void setCanceled(boolean canceled) {
     85        this.canceled = canceled;
     86    }
    6487}
  • trunk/src/org/openstreetmap/josm/io/GpxExporter.java

    r6716 r6815  
    127127        ed.showDialog();
    128128
    129         if (ed.getValue() != 1)
     129        if (ed.getValue() != 1) {
     130            setCanceled(true);
    130131            return;
     132        }
     133        setCanceled(false);
    131134
    132135        Main.pref.put("lastAddAuthor", author.isSelected());
Note: See TracChangeset for help on using the changeset viewer.