X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altoslib%2FAltosPreferences.java;h=159951e46f83ffd501f94ee46989acdd275536ef;hp=65a46eb6f87f38675e99c76b5e3a58f63ec55d09;hb=c8078d352a7f54a4a97d25af080155d3f875536a;hpb=5a3c5de6657d1c26e52015a8acec0cd05e294cef diff --git a/altoslib/AltosPreferences.java b/altoslib/AltosPreferences.java index 65a46eb6..159951e4 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_5; 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");