Changeset 1023 in josm for trunk/src/org/openstreetmap/josm/actions/DiskAccessAction.java
- Timestamp:
- 2008-10-05T17:06:27+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/DiskAccessAction.java
r693 r1023 10 10 11 11 import org.openstreetmap.josm.Main; 12 import org.openstreetmap.josm.tools.ShortCut; 12 13 13 14 /** … … 16 17 abstract public class DiskAccessAction extends JosmAction { 17 18 19 public DiskAccessAction(String name, String iconName, String tooltip, ShortCut shortCut) { 20 super(name, iconName, tooltip, shortCut, true); 21 } 22 23 @Deprecated 18 24 public DiskAccessAction(String name, String iconName, String tooltip, int shortCut, int modifiers) { 19 25 super(name, iconName, tooltip, shortCut, modifiers, true); 20 26 } 21 27 22 28 protected static JFileChooser createAndOpenFileChooser(boolean open, boolean multiple, String title) { 23 29 String curDir = Main.pref.get("lastDirectory"); … … 32 38 fc.addChoosableFileFilter(ExtensionFileFilter.filters[i]); 33 39 fc.setAcceptAllFileFilterUsed(true); 34 40 35 41 int answer = open ? fc.showOpenDialog(Main.parent) : fc.showSaveDialog(Main.parent); 36 42 if (answer != JFileChooser.APPROVE_OPTION) 37 43 return null; 38 44 39 45 if (!fc.getCurrentDirectory().getAbsolutePath().equals(curDir)) 40 46 Main.pref.put("lastDirectory", fc.getCurrentDirectory().getAbsolutePath()); … … 42 48 if (!open) { 43 49 File file = fc.getSelectedFile(); 44 if (file == null || (file.exists() && JOptionPane.YES_OPTION != 50 if (file == null || (file.exists() && JOptionPane.YES_OPTION != 45 51 JOptionPane.showConfirmDialog(Main.parent, tr("File exists. Overwrite?"), tr("Overwrite"), JOptionPane.YES_NO_OPTION))) 46 52 return null; 47 53 } 48 54 49 55 return fc; 50 56 }
Note:
See TracChangeset
for help on using the changeset viewer.