diff options
author | Keith Packard <keithp@keithp.com> | 2013-05-09 21:06:52 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-05-09 21:06:52 -0700 |
commit | 106d212ff5920c39d95751ef6249dc141970412c (patch) | |
tree | 47f7715d037e06d8cf6deec1deb40540c6e62342 /altoslib | |
parent | ecb128579e7576fc27c8ca93708f316b9ac91630 (diff) | |
parent | 09d5d6f546ccef2bfd4941e590f047485bb73d76 (diff) |
Merge branch 'master-fixes' into stm-flash-fixes
Diffstat (limited to 'altoslib')
-rw-r--r-- | altoslib/AltosPreferences.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/altoslib/AltosPreferences.java b/altoslib/AltosPreferences.java index 392497ef..088ca3d7 100644 --- a/altoslib/AltosPreferences.java +++ b/altoslib/AltosPreferences.java @@ -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; |