summaryrefslogtreecommitdiff
path: root/altoslib
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-09-20 11:30:19 +0200
committerKeith Packard <keithp@keithp.com>2012-09-20 11:30:19 +0200
commit2f2734bb418f5c3a89fa3f1bf1b98ce4cfe432e1 (patch)
tree5a5400d13c22e7ca6c666c00f4d391ed8429e3a6 /altoslib
parente69a433fd93b9f6bd2297d8045eb075fee29e73b (diff)
parent3fe5c2f9fc01258d45c20070e9874d76bc6c8c07 (diff)
Merge remote-tracking branch 'mjb/altosdroid'
Diffstat (limited to 'altoslib')
-rw-r--r--altoslib/AltosLog.java6
-rw-r--r--altoslib/AltosPreferences.java4
-rw-r--r--altoslib/AltosPreferencesBackend.java4
3 files changed, 8 insertions, 6 deletions
diff --git a/altoslib/AltosLog.java b/altoslib/AltosLog.java
index 3c124700..1c7069ce 100644
--- a/altoslib/AltosLog.java
+++ b/altoslib/AltosLog.java
@@ -25,7 +25,7 @@ import java.util.concurrent.LinkedBlockingQueue;
* This creates a thread to capture telemetry data and write it to
* a log file
*/
-class AltosLog implements Runnable {
+public class AltosLog implements Runnable {
LinkedBlockingQueue<AltosLine> input_queue;
LinkedBlockingQueue<String> pending_queue;
@@ -45,7 +45,7 @@ class AltosLog implements Runnable {
}
}
- void close() {
+ public void close() {
close_log_file();
if (log_thread != null) {
log_thread.interrupt();
@@ -53,7 +53,7 @@ class AltosLog implements Runnable {
}
}
- File file() {
+ public File file() {
return file;
}
diff --git a/altoslib/AltosPreferences.java b/altoslib/AltosPreferences.java
index a82ea3f6..47196d6e 100644
--- a/altoslib/AltosPreferences.java
+++ b/altoslib/AltosPreferences.java
@@ -19,7 +19,6 @@ package org.altusmetrum.AltosLib;
import java.io.*;
import java.util.*;
-import javax.swing.filechooser.FileSystemView;
public class AltosPreferences {
public static AltosPreferencesBackend backend = null;
@@ -145,8 +144,7 @@ public class AltosPreferences {
if (logdir_string != null)
logdir = new File(logdir_string);
else {
- /* Use the file system view default directory */
- logdir = new File(FileSystemView.getFileSystemView().getDefaultDirectory(), logdirName);
+ logdir = new File(backend.homeDirectory(), logdirName);
if (!logdir.exists())
logdir.mkdirs();
}
diff --git a/altoslib/AltosPreferencesBackend.java b/altoslib/AltosPreferencesBackend.java
index 3fc4b0aa..a1184c0b 100644
--- a/altoslib/AltosPreferencesBackend.java
+++ b/altoslib/AltosPreferencesBackend.java
@@ -17,6 +17,8 @@
package org.altusmetrum.AltosLib;
+import java.io.File;
+
public interface AltosPreferencesBackend {
public String getString(String key, String def);
@@ -38,4 +40,6 @@ public interface AltosPreferencesBackend {
public void remove(String key);
public void flush();
+
+ public File homeDirectory();
}