X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altoslib%2FAltosPreferences.java;h=484cb64411735f1881afb67e06aba5e4161f3c98;hb=0fd608868aa03f81b2d902e1da13ee0b1ab20b78;hp=e50b9b5cf05a9a856b1b60fb3af6fe604ac3db39;hpb=65b512c890a3ccf487655b79305ab1cfcf49259c;p=fw%2Faltos diff --git a/altoslib/AltosPreferences.java b/altoslib/AltosPreferences.java index e50b9b5c..484cb644 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_3; import java.io.*; import java.util.*; @@ -55,13 +55,16 @@ public class AltosPreferences { /* Launcher channel preference name */ public final static String launcherChannelPreference = "LAUNCHER-CHANNEL"; - + /* Default logdir is ~/TeleMetrum */ public final static String logdirName = "TeleMetrum"; /* 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; @@ -328,7 +349,7 @@ public class AltosPreferences { return launcher_channel; } } - + public static AltosPreferencesBackend bt_devices() { synchronized (backend) { return backend.node("bt_devices");