X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altoslib%2FAltosPreferences.java;h=c4051f9b58e2155a56a5a81e8ebf7d186d7f87fb;hb=f65880cf5bfcba5005c32db2b300448e585f3e45;hp=e50b9b5cf05a9a856b1b60fb3af6fe604ac3db39;hpb=6db192898eebf750c4d51516eff7916bc4da493b;p=fw%2Faltos diff --git a/altoslib/AltosPreferences.java b/altoslib/AltosPreferences.java index e50b9b5c..c4051f9b 100644 --- a/altoslib/AltosPreferences.java +++ b/altoslib/AltosPreferences.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.AltosLib; +package org.altusmetrum.altoslib_2; import java.io.*; import java.util.*; @@ -62,6 +62,9 @@ public class AltosPreferences { /* 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; @@ -198,6 +201,24 @@ public class AltosPreferences { } } + 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;