diff options
Diffstat (limited to 'main/src/cgeo/geocaching/Settings.java')
-rw-r--r-- | main/src/cgeo/geocaching/Settings.java | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/main/src/cgeo/geocaching/Settings.java b/main/src/cgeo/geocaching/Settings.java index ee201e2..92241c2 100644 --- a/main/src/cgeo/geocaching/Settings.java +++ b/main/src/cgeo/geocaching/Settings.java @@ -22,6 +22,7 @@ import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.content.res.Configuration; import android.content.res.Resources; +import android.os.Environment; import android.preference.PreferenceManager; import java.util.Locale; @@ -36,7 +37,6 @@ public final class Settings { private static final String KEY_HELP_SHOWN = "helper"; private static final String KEY_ANYLONGITUDE = "anylongitude"; private static final String KEY_ANYLATITUDE = "anylatitude"; - private static final String KEY_PUBLICLOC = "publicloc"; private static final String KEY_USE_OFFLINEMAPS = "offlinemaps"; private static final String KEY_USE_OFFLINEWPMAPS = "offlinewpmaps"; private static final String KEY_WEB_DEVICE_CODE = "webDeviceCode"; @@ -96,6 +96,7 @@ public final class Settings { private static final String KEY_LAST_TRACKABLE_ACTION = "trackableaction"; private static final String KEY_SHARE_AFTER_EXPORT = "shareafterexport"; private static final String KEY_GPX_EXPORT_DIR = "gpxExportDir"; + private static final String KEY_GPX_IMPORT_DIR = "gpxImportDir"; private final static int unitsMetric = 1; @@ -150,7 +151,6 @@ public final class Settings { e.putBoolean(KEY_HELP_SHOWN, old.getInt(KEY_HELP_SHOWN, 0) != 0); e.putFloat(KEY_ANYLONGITUDE, old.getFloat(KEY_ANYLONGITUDE, 0)); e.putFloat(KEY_ANYLATITUDE, old.getFloat(KEY_ANYLATITUDE, 0)); - e.putBoolean(KEY_PUBLICLOC, 0 != old.getInt(KEY_PUBLICLOC, 0)); e.putBoolean(KEY_USE_OFFLINEMAPS, 0 != old.getInt(KEY_USE_OFFLINEMAPS, 1)); e.putBoolean(KEY_USE_OFFLINEWPMAPS, 0 != old.getInt(KEY_USE_OFFLINEWPMAPS, 0)); e.putString(KEY_WEB_DEVICE_CODE, old.getString(KEY_WEB_DEVICE_CODE, null)); @@ -721,20 +721,6 @@ public final class Settings { }); } - public static boolean isPublicLoc() { - return sharedPrefs.getBoolean(KEY_PUBLICLOC, false); - } - - public static void setPublicLoc(final boolean publicLocation) { - editSharedSettings(new PrefRunnable() { - - @Override - public void edit(Editor edit) { - edit.putBoolean(KEY_PUBLICLOC, publicLocation); - } - }); - } - public static boolean isTrackableAutoVisit() { return sharedPrefs.getBoolean(KEY_AUTO_VISIT_TRACKABLES, false); } @@ -1168,7 +1154,7 @@ public final class Settings { } public static String getGpxExportDir() { - return sharedPrefs.getString(KEY_GPX_EXPORT_DIR, "/sdcard/gpx"); + return sharedPrefs.getString(KEY_GPX_EXPORT_DIR, Environment.getExternalStorageDirectory().getPath() + "/gpx"); } public static void setGpxExportDir(final String gpxExportDir) { @@ -1180,6 +1166,19 @@ public final class Settings { }); } + public static String getGpxImportDir() { + return sharedPrefs.getString(KEY_GPX_IMPORT_DIR, Environment.getExternalStorageDirectory().getPath() + "/gpx"); + } + + public static void setGpxImportDir(final String gpxImportDir) { + editSharedSettings(new PrefRunnable() { + @Override + public void edit(Editor edit) { + edit.putString(KEY_GPX_IMPORT_DIR, gpxImportDir); + } + }); + } + public static boolean getShareAfterExport() { return sharedPrefs.getBoolean(KEY_SHARE_AFTER_EXPORT, true); } |