Changeset 3325 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2010-06-09T20:03:00+02:00 (14 years ago)
Author:
bastiK
Message:

see #5123 - save last directory for each type of usage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java

    r3280 r3325  
    325325                    return;
    326326                }
    327                 JFileChooser fc = new JFileChooser(Main.pref.get("geoimage.lastdirectory", Main.pref.get("lastDirectory")));
     327                String curDir = Main.pref.get("geoimage.lastdirectory", Main.pref.get("lastDirectory"));
     328                if (curDir.equals("")) {
     329                    curDir = ".";
     330                }
     331                JFileChooser fc = new JFileChooser(new File(curDir));
     332
    328333                fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    329334                fc.setMultiSelectionEnabled(true);
     
    336341                if (sel == null || sel.length == 0)
    337342                    return;
     343                if (!fc.getCurrentDirectory().getAbsolutePath().equals(curDir)) {
     344                    Main.pref.put("geoimage.lastdirectory", fc.getCurrentDirectory().getAbsolutePath());
     345                }
    338346                addRecursiveFiles(files, sel);
    339347                importer.importDataHandleExceptions(files, NullProgressMonitor.INSTANCE);
Note: See TracChangeset for help on using the changeset viewer.