Make a menu option to force offline poi edition
This commit is contained in:
parent
4c41948378
commit
cd2c835a13
5 changed files with 11 additions and 1 deletions
|
@ -1,5 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<resources>
|
||||
<string name="offline_poi_edition">Offline POI edition</string>
|
||||
<string name="offline_poi_edition_descr">If you want to use only offline POI edition</string>
|
||||
|
||||
<string name="tip_recent_changes_0_7_1_t">Changes in 0.7.1 :
|
||||
\n\t- Offline POI editing
|
||||
\n\t- Live Tracking option - send coordinates to web service periodically (read how to setup your own web service in HowTo Articles)
|
||||
|
|
|
@ -109,6 +109,8 @@
|
|||
<EditTextPreference android:title="@string/user_name" android:summary="@string/user_name_descr" android:key="user_name"></EditTextPreference>
|
||||
<EditTextPreference android:title="@string/user_password" android:password="true" android:summary="@string/user_password_descr"
|
||||
android:key="user_password"></EditTextPreference>
|
||||
<CheckBoxPreference android:summary="@string/offline_poi_edition_descr" android:title="@string/offline_poi_edition"
|
||||
android:key="offline_poi_edition"></CheckBoxPreference>
|
||||
<Preference android:title="@string/local_openstreetmap_settings" android:key="local_openstreetmap_points" android:summary="@string/local_openstreetmap_settings_descr"></Preference>
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="OsmAnd debugging and development">
|
||||
|
|
|
@ -439,6 +439,10 @@ public class OsmandSettings {
|
|||
public final OsmandPreference<String> USER_PASSWORD =
|
||||
new StringPreference("user_password", "", true);
|
||||
|
||||
// this value boolean is synchronized with settings_pref.xml preference offline POI edition
|
||||
public final OsmandPreference<Boolean> OFFLINE_POI_EDITION =
|
||||
new BooleanPreference("offline_poi_edition", false, true);
|
||||
|
||||
public static final String LOCAL_OPENSTREETMAP_POINTS = "local_openstreetmap_points";
|
||||
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ public class EditingPOIActivity implements DialogProvider {
|
|||
this.ctx = uiContext;
|
||||
|
||||
OsmandSettings settings = OsmandSettings.getOsmandSettings(ctx);
|
||||
if(!settings.isInternetConnectionAvailable(true)){
|
||||
if(settings.OFFLINE_POI_EDITION.get() || !settings.isInternetConnectionAvailable(true)){
|
||||
this.openstreetmapUtil = new OpenstreetmapLocalUtil(ctx);
|
||||
} else {
|
||||
this.openstreetmapUtil = new OpenstreetmapRemoteUtil(ctx, ctx.getMapView());
|
||||
|
|
|
@ -196,6 +196,7 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
|
|||
|
||||
registerEditTextPreference(osmandSettings.USER_NAME, screen);
|
||||
registerEditTextPreference(osmandSettings.USER_PASSWORD, screen);
|
||||
registerBooleanPreference(osmandSettings.OFFLINE_POI_EDITION, screen);
|
||||
registerEditTextPreference(osmandSettings.LIVE_MONITORING_URL, screen);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue