From 8170036dae1b1f4cdea87513bc73b325ba2f0ee8 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 28 Aug 2014 00:25:11 +0200 Subject: [PATCH] Provide option to reset Remember my choice for trip recording --- OsmAnd/res/values/strings.xml | 2 +- .../net/osmand/plus/activities/SettingsBaseActivity.java | 6 +++--- .../osmand/plus/monitoring/OsmandMonitoringPlugin.java | 9 ++++----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 0326132f6b..aada4a24df 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -9,7 +9,7 @@ 3. All your modified/created strings are in the top of the file (to make easier find what\'s translated). PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy --> - Confirm every run + Ask every run Choose logging interval for track recording enabled by selecting widget on the map. Default Global Logging interval GPS Wake-up interval diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java index 042560161f..17f9c5292c 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java @@ -272,18 +272,18 @@ public abstract class SettingsBaseActivity extends SherlockPreferenceActivity im int summary) { int minutesLength = minutes == null ? 0 : minutes.length; int secondsLength = seconds == null ? 0 : seconds.length; - Integer[] ints = new Integer[secondsLength + minutesLength + (disable == null ? 0 : 1)]; + Integer[] ints = new Integer[secondsLength + minutesLength]; String[] intDescriptions = new String[ints.length]; int k = 0; for (int i = 0; i < secondsLength; i++) { - k++; ints[k] = seconds[i] * coeff; intDescriptions[k] = seconds[i] + " " + getString(R.string.int_seconds); //$NON-NLS-1$ + k++; } for (int i = 0; i < minutesLength; i++) { - k++; ints[k] = (minutes[i] * 60) * coeff; intDescriptions[k] = minutes[i] + " " + getString(R.string.int_min); //$NON-NLS-1$ + k++; } ListPreference lp = createListPreference(b, intDescriptions, ints, title, summary); registerDisablePreference(b, getString(R.string.confirm_every_run), disable); diff --git a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java index ad634312a3..81395fbf19 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java @@ -352,10 +352,9 @@ public class OsmandMonitoringPlugin extends OsmandPlugin implements MonitoringIn app.startNavigationService(NavigationService.USED_BY_GPX); } }; - //Comment this out for now as we have no way to reverse the REMEMBER flag?! - //if(choice.value) { - // runnable.run(); - //} else { + if(choice.value) { + runnable.run(); + } else { showIntervalChooseDialog(map, app.getString(R.string.save_track_interval_globally) + " : %s", app.getString(R.string.save_track_to_gpx_globally), SECONDS, MINUTES, choice, vs, new OnClickListener() { @@ -364,7 +363,7 @@ public class OsmandMonitoringPlugin extends OsmandPlugin implements MonitoringIn runnable.run(); } }); - //} + } }