[sword-cvs] r40 - trunk/app/src/org/crosswire/flashcards
Apache
apache at crosswire.org
Thu Sep 16 17:39:04 MST 2004
Author:
Date: 2004-09-16 17:39:04 -0700 (Thu, 16 Sep 2004)
New Revision: 40
Modified:
trunk/app/src/org/crosswire/flashcards/EditorFrame.java
Log:
Made Editor remember browsed directory when opening flashcard lessons, so we save back to
correct directory. Still need to pick a better initial directory than "./". Also need to
see if Quiz directory loading works again.
Modified: trunk/app/src/org/crosswire/flashcards/EditorFrame.java
===================================================================
--- trunk/app/src/org/crosswire/flashcards/EditorFrame.java 2004-09-17 00:29:41 UTC (rev 39)
+++ trunk/app/src/org/crosswire/flashcards/EditorFrame.java 2004-09-17 00:39:04 UTC (rev 40)
@@ -69,6 +69,7 @@
//
// Attributes
//
+ String cwdPath = "./";
JPanel contentPane;
JToolBar jToolBar = new JToolBar();
@@ -295,7 +296,7 @@
lesson.setProperty("word"+Integer.toString(i), we.word);
lesson.setProperty("answers"+Integer.toString(i), we.answers);
}
- lesson.store(new FileOutputStream(lesson.getProperty("fileName")),
+ lesson.store(new FileOutputStream(cwdPath + "/" + lesson.getProperty("fileName")),
"Flash Lesson");
} catch (IOException ex) { ex.printStackTrace(); }
}
@@ -379,10 +380,11 @@
}
public String getDescription() { return "Flash Card Lessons"; }
});
- dialog.setCurrentDirectory(new File("./"));
+ dialog.setCurrentDirectory(new File(cwdPath));
if (dialog.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
try {
loadLesson(dialog.getSelectedFile().getCanonicalPath());
+ cwdPath = dialog.getCurrentDirectory().getCanonicalPath();
} catch( IOException ioe ) {
ioe.printStackTrace( );
}
More information about the sword-cvs
mailing list