X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altoslib%2FAltosPreferences.java;h=b8920d266c2324ef01474c7f3c7133aa59a3425d;hp=392497ef6909de1324a26d62d47db3aba8b1624e;hb=081455dcba860f3e4df8cd66f3fe686b204034ad;hpb=8d1d8d2a3c129cdbd55427bcda0f26715b02f1ee diff --git a/altoslib/AltosPreferences.java b/altoslib/AltosPreferences.java index 392497ef..b8920d26 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_1; +package org.altusmetrum.altoslib_3; 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;