- Timestamp:
- 2014-02-06T00:03:52+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java
r6643 r6815 68 68 try { 69 69 boolean exported = false; 70 boolean canceled = false; 70 71 for (FileExporter exporter : ExtensionFileFilter.exporters) { 71 72 if (exporter.acceptFile(file, layer)) { 72 73 exporter.exportData(file, layer); 73 74 exported = true; 75 canceled = exporter.isCanceled(); 74 76 break; 75 77 } … … 78 80 JOptionPane.showMessageDialog(Main.parent, tr("No Exporter found! Nothing saved."), tr("Warning"), 79 81 JOptionPane.WARNING_MESSAGE); 82 return false; 83 } else if (canceled) { 80 84 return false; 81 85 } -
trunk/src/org/openstreetmap/josm/io/FileExporter.java
r6070 r6815 16 16 17 17 private boolean enabled; 18 private boolean canceled; 18 19 20 /** 21 * Constructs a new {@code FileExporter}. 22 * @param filter The extension file filter 23 */ 19 24 public FileExporter(ExtensionFileFilter filter) { 20 25 this.filter = filter; … … 62 67 // To be overriden by subclasses if needed 63 68 } 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 } 64 87 } -
trunk/src/org/openstreetmap/josm/io/GpxExporter.java
r6716 r6815 127 127 ed.showDialog(); 128 128 129 if (ed.getValue() != 1) 129 if (ed.getValue() != 1) { 130 setCanceled(true); 130 131 return; 132 } 133 setCanceled(false); 131 134 132 135 Main.pref.put("lastAddAuthor", author.isSelected());
Note:
See TracChangeset
for help on using the changeset viewer.