Changeset 13115 in josm


Ignore:
Timestamp:
2017-11-12T02:32:10+01:00 (7 days 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

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

Legend:

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

    r12894 r13115  
    2121import org.openstreetmap.josm.gui.layer.Layer;
    2222import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     23import org.openstreetmap.josm.gui.util.GuiHelper;
    2324import org.openstreetmap.josm.gui.widgets.AbstractFileChooser;
    2425import org.openstreetmap.josm.spi.preferences.Config;
     
    105106            }
    106107            if (!exported) {
    107                 JOptionPane.showMessageDialog(Main.parent, tr("No Exporter found! Nothing saved."), tr("Warning"),
    108                         JOptionPane.WARNING_MESSAGE);
     108                GuiHelper.runInEDTAndWait(() ->
     109                    JOptionPane.showMessageDialog(Main.parent, tr("No Exporter found! Nothing saved."), tr("Warning"),
     110                        JOptionPane.WARNING_MESSAGE));
    109111                return false;
    110112            } else if (canceled) {
  • 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.