import java.io.*;
import java.util.*;
-import javax.swing.filechooser.FileSystemView;
public class AltosPreferences {
public static AltosPreferencesBackend backend = null;
public static int launcher_channel;
- public static void init() {
- //preferences = Preferences.userRoot().node("/org/altusmetrum/altosui");
+ public static void init(AltosPreferencesBackend in_backend) {
+ backend = in_backend;
/* Initialize logdir from preferences */
String logdir_string = backend.getString(logdirPreference, null);
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();
}
AltosConvert.imperial_units = backend.getBoolean(unitsPreference, false);
}
- static { init(); }
-
public static void flush_preferences() {
backend.flush();
}