Ignore:
Timestamp:
2017-11-12T02:32:10+01:00 (2 years ago)
Author:
Don-vip
Message:

fix #12086 - fix EDT violation when no file exporter is found + choose note exporter by default when saving a note layer

File:
1 edited

Legend:

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

    r12537 r13115  
    2626
    2727import org.openstreetmap.josm.actions.SaveActionBase;
     28import org.openstreetmap.josm.gui.layer.NoteLayer;
    2829import org.openstreetmap.josm.gui.util.CellEditorSupport;
    2930import org.openstreetmap.josm.gui.widgets.JosmTextField;
     
    4950
    5051    private final transient CellEditorSupport cellEditorSupport = new CellEditorSupport(this);
     52    private String extension = "osm";
    5153    private File value;
    5254
     
    9092          .append(addLblLayerName(info));
    9193        if (info.isSavable()) {
     94            extension = info.getLayer() instanceof NoteLayer ? "osn" : "osm";
    9295            add(btnFileChooser, GBC.std());
    9396            sb.append("<br>")
     
    111114
    112115        if (info.isSavable()) {
     116            extension = info.getLayer() instanceof NoteLayer ? "osn" : "osm";
    113117            add(btnFileChooser, GBC.std());
    114118            add(tfFilename, GBC.eol().fill(GBC.HORIZONTAL).insets(1, 0, 0, 0));
     
    242246        @Override
    243247        public void actionPerformed(ActionEvent e) {
    244             File f = SaveActionBase.createAndOpenSaveFileChooser(tr("Select filename"), "osm");
     248            File f = SaveActionBase.createAndOpenSaveFileChooser(tr("Select filename"), extension);
    245249            if (f != null) {
    246250                tfFilename.setText(f.toString());
Note: See TracChangeset for help on using the changeset viewer.