java: Bump java library versions for next release
[fw/altos] / altoslib / AltosPreferences.java
index 392497ef6909de1324a26d62d47db3aba8b1624e..159951e46f83ffd501f94ee46989acdd275536ef 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_1;
+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");