Changeset 561 in josm for trunk/src


Ignore:
Timestamp:
2008-02-25T12:20:00+01:00 (17 years ago)
Author:
david
Message:

Remember the directory last opened

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

Legend:

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

    r554 r561  
    161161                applyAudio.addActionListener(new ActionListener() {
    162162                        public void actionPerformed(ActionEvent e) {
    163                                 JFileChooser fc = new JFileChooser(Main.pref.get("tagimages.lastdirectory"));
     163                                String dir = Main.pref.get("markers.lastaudiodirectory");
     164                                JFileChooser fc = new JFileChooser(dir);
    164165                                fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
    165166                                fc.setAcceptAllFileFilterUsed(false);
     
    174175                                fc.showOpenDialog(Main.parent);
    175176                                File sel = fc.getSelectedFile();
     177                                if (!fc.getCurrentDirectory().getAbsolutePath().equals(dir))
     178                                        Main.pref.put("markers.lastaudiodirectory", fc.getCurrentDirectory().getAbsolutePath());
    176179                                if (sel == null)
    177180                                        return;
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java

    r554 r561  
    295295                applyaudio.addActionListener(new ActionListener(){
    296296                        public void actionPerformed(ActionEvent e) {
    297                                 JFileChooser fc = new JFileChooser(Main.pref.get("tagimages.lastdirectory"));
     297                                String dir = Main.pref.get("markers.lastaudiodirectory");
     298                                JFileChooser fc = new JFileChooser(dir);
    298299                                fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
    299300                                fc.setAcceptAllFileFilterUsed(false);
     
    308309                                fc.showOpenDialog(Main.parent);
    309310                                File sel = fc.getSelectedFile();
     311                                if (!fc.getCurrentDirectory().getAbsolutePath().equals(dir))
     312                                        Main.pref.put("markers.lastaudiodirectory", fc.getCurrentDirectory().getAbsolutePath());
    310313                                if (sel == null)
    311314                                        return;
Note: See TracChangeset for help on using the changeset viewer.