diff --git a/src/org/openstreetmap/josm/actions/OpenFileAction.java b/src/org/openstreetmap/josm/actions/OpenFileAction.java
index 079cd8af3a..32127a54e6 100644
a
|
b
|
import org.openstreetmap.josm.gui.io.importexport.FileImporter;
|
44 | 44 | import org.openstreetmap.josm.gui.io.importexport.Options; |
45 | 45 | import org.openstreetmap.josm.gui.util.GuiHelper; |
46 | 46 | import org.openstreetmap.josm.gui.widgets.AbstractFileChooser; |
| 47 | import org.openstreetmap.josm.gui.widgets.FileChooserManager; |
| 48 | import org.openstreetmap.josm.gui.widgets.NativeFileChooser; |
47 | 49 | import org.openstreetmap.josm.io.OsmTransferException; |
48 | 50 | import org.openstreetmap.josm.spi.preferences.Config; |
49 | 51 | import org.openstreetmap.josm.tools.Logging; |
… |
… |
public class OpenFileAction extends DiskAccessAction {
|
78 | 80 | |
79 | 81 | @Override |
80 | 82 | public void actionPerformed(ActionEvent e) { |
81 | | AbstractFileChooser fc = createAndOpenFileChooser(true, true, null, null, JFileChooser.FILES_AND_DIRECTORIES, |
82 | | true, null); |
| 83 | final AbstractFileChooser fc; |
| 84 | // If the user explicitly wants native file dialogs, let them use it. |
| 85 | // Rather unfortunately, this means that they will not be able to select files and directories. |
| 86 | if (Boolean.TRUE.equals(FileChooserManager.PROP_USE_NATIVE_FILE_DIALOG.get()) |
| 87 | // This is almost redundant, as the JDK currently doesn't support this with (all?) native file choosers. |
| 88 | && !NativeFileChooser.supportsSelectionMode(JFileChooser.FILES_AND_DIRECTORIES)) { |
| 89 | fc = createAndOpenFileChooser(true, true, null); |
| 90 | } else { |
| 91 | fc = createAndOpenFileChooser(true, true, null, null, |
| 92 | JFileChooser.FILES_AND_DIRECTORIES, true, null); |
| 93 | } |
83 | 94 | if (fc == null) |
84 | 95 | return; |
85 | 96 | File[] files = fc.getSelectedFiles(); |