Ignore:
Timestamp:
2015-07-15T16:34:32+02:00 (9 years ago)
Author:
nokutu
Message:

Now the imports remember the last visited directory

Location:
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportAction.java

    r31359 r31376  
    5353  public void actionPerformed(ActionEvent e) {
    5454    chooser = new JFileChooser();
    55     chooser.setCurrentDirectory(new java.io.File(System.getProperty("user.home")));
     55    File startDirectory = new File(Main.pref.get("mapillary.start-directory", System.getProperty("user.home")));
     56    chooser.setCurrentDirectory(startDirectory);
    5657    chooser.setDialogTitle(tr("Select pictures"));
    5758    chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
     
    6263      for (int i = 0; i < chooser.getSelectedFiles().length; i++) {
    6364        File file = chooser.getSelectedFiles()[i];
     65        Main.pref.put("mapillary.start-directory", file.getParent());
    6466        MapillaryLayer.getInstance();
    6567        if (file.isDirectory()) {
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportIntoSequenceAction.java

    r31359 r31376  
    5050
    5151    chooser = new JFileChooser();
    52     chooser.setCurrentDirectory(new java.io.File(System.getProperty("user.home")));
    53     chooser.setDialogTitle(tr("Select pictures"));
     52    File startDirectory = new File(Main.pref.get("mapillary.start-directory", System.getProperty("user.home")));
     53    chooser.setCurrentDirectory(startDirectory);    chooser.setDialogTitle(tr("Select pictures"));
    5454    chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    5555    chooser.setAcceptAllFileFilterUsed(false);
     
    5959      for (int i = 0; i < chooser.getSelectedFiles().length; i++) {
    6060        File file = chooser.getSelectedFiles()[i];
     61        Main.pref.put("mapillary.start-directory", file.getParent());
    6162        if (file.isDirectory()) {
    6263          // TODO import directory
Note: See TracChangeset for help on using the changeset viewer.