This is used to record the last directory for reading or writing log
files so that the UI can pop back to the same place next time.
Signed-off-by: Keith Packard <keithp@keithp.com>
/* Log directory */
public static File logdir;
/* Log directory */
public static File logdir;
+ /* Last log directory - use this next time we open or save something */
+ public static File last_logdir;
+
/* Map directory -- hangs of logdir */
public static File mapdir;
/* Map directory -- hangs of logdir */
public static File mapdir;
+ public static File last_logdir() {
+ synchronized (backend) {
+ if (last_logdir == null)
+ last_logdir = logdir;
+ return last_logdir;
+ }
+ }
+
+ public static void set_last_logdir(File file) {
+ synchronized(backend) {
+ if (file != null && !file.isDirectory())
+ file = file.getParentFile();
+ if (file == null)
+ file = new File(".");
+ last_logdir = file;
+ }
+ }
+
public static File mapdir() {
synchronized (backend) {
return mapdir;
public static File mapdir() {
synchronized (backend) {
return mapdir;