From c058ec2d6070458a0b7d3ef56041e985412ee565 Mon Sep 17 00:00:00 2001 From: Mike Beattie Date: Tue, 18 Sep 2012 23:46:17 +1200 Subject: altos{lib,ui,droid}: move OS specific code out of altoslib This is to allow the usage of AltosLog on Android - no swing, so we need to push the "home directory" code used to pick a default telemetry logging path - using the PreferencesBackend interface for now. Signed-off-by: Mike Beattie --- altosui/AltosUIPreferencesBackend.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'altosui/AltosUIPreferencesBackend.java') diff --git a/altosui/AltosUIPreferencesBackend.java b/altosui/AltosUIPreferencesBackend.java index 210dcb8b..3131fd32 100644 --- a/altosui/AltosUIPreferencesBackend.java +++ b/altosui/AltosUIPreferencesBackend.java @@ -17,8 +17,10 @@ package altosui; +import java.io.File; import java.util.prefs.*; import org.altusmetrum.AltosLib.*; +import javax.swing.filechooser.FileSystemView; public class AltosUIPreferencesBackend implements AltosPreferencesBackend { @@ -92,4 +94,8 @@ public class AltosUIPreferencesBackend implements AltosPreferencesBackend { } } + public File homeDirectory() { + /* Use the file system view default directory */ + return FileSystemView.getFileSystemView().getDefaultDirectory(); + } } -- cgit v1.2.3