diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index ea7a7cc243..1861689a46 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -1001,12 +1001,12 @@ Créer un filtre des PI Styles de rendu En continu -\tVous pouvez modifier l'orientation de la carte par un appui court sur l\'icône de la boussole +\tVous pouvez modifier l\'orientation de la carte par un appui court sur l\'icône de la boussole \n\tLes choix sont : \n\t\'Ne pas tourner (nord vers le haut)\' - La carte ne changera pas d\'orientation, le nord sera toujours vers le haut \n\t\'Direction du déplacement\' - La carte est continuellement alignée dans la direction du déplacement \n\t\'Boussole\' - La carte est continuellement alignée sur la valeur de la boussole -"\tLe style de la carte peut, pour certaines cartes vectorielles, être modifié selon qu'il fait jour (plus clair) ou nuit (plus sombre) +"\tLe style de la carte peut, pour certaines cartes vectorielles, être modifié selon qu\'il fait jour (plus clair) ou nuit (plus sombre) \n\tLes couleurs de nuit sont plus sûres pour la conduite nocturne \n\tVous pouvez configurer la politique de bascule jour/nuit dans \'Navigation\'->\'Mode jour/nuit\' \n\tLes choix sont: diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 7405b580af..a25013b3a1 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -9,6 +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 --> + Do you want to use displayed track for navigation? Add as destination point Select GPX … Select Destination diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 161b98456a..af17108666 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -41,6 +41,7 @@ import net.osmand.plus.activities.actions.StartGPSStatus; import net.osmand.plus.activities.search.SearchActivity; import net.osmand.plus.development.OsmandDevelopmentPlugin; import net.osmand.plus.routing.RoutingHelper; +import net.osmand.plus.routing.RouteProvider.GPXRouteParamsBuilder; import net.osmand.plus.routing.RouteProvider.RouteService; import net.osmand.plus.views.BaseMapLayer; import net.osmand.plus.views.MapTileLayer; @@ -448,11 +449,56 @@ public class MapActivityActions implements DialogProvider { builder.create().show(); } - public void enterRoutePlanningMode(LatLon from, String fromName) { + public void setGPXRouteParams(GPXFile result) { + GPXRouteParamsBuilder params = new GPXRouteParamsBuilder(result, mapActivity.getMyApplication().getSettings()); + params.setAnnounceWaypoints(settings.SPEAK_GPX_WPT.get()); + params.setCalculateOsmAndRoute(settings.CALC_GPX_ROUTE.get()); + List ps = params.getPoints(); + + if(!ps.isEmpty()) { + Location loc = ps.get(ps.size() -1); + TargetPointsHelper tg = mapActivity.getMyApplication().getTargetPointsHelper(); + tg.navigateToPoint(new LatLon(loc.getLatitude(), loc.getLongitude()), false, -1); + if(tg.getPointToStart() == null) { + loc = ps.get(0); + tg.setStartPoint(new LatLon(loc.getLatitude(), loc.getLongitude()), false, null); + } + tg.updateRoutingHelper(); + } + mapActivity.getRoutingHelper().setGpxParams(params); + settings.FOLLOW_THE_GPX_ROUTE.set(result.path); + } + + public void enterRoutePlanningMode(final LatLon from, final String fromName) { + final GPXFile gpxFile = mapActivity.getMyApplication().getGpxFileToDisplay(); + if(gpxFile != null) { + Builder bld = new AlertDialog.Builder(mapActivity); + bld.setMessage(R.string.use_displayed_track_for_navigation); + bld.setPositiveButton(R.string.default_buttons_yes, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + setGPXRouteParams(gpxFile); + enterRoutePlanningModeImpl(from, fromName); + } + }); + bld.setPositiveButton(R.string.default_buttons_no, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + enterRoutePlanningModeImpl(from, fromName); + } + }); + bld.show(); + } else { + enterRoutePlanningModeImpl(from, fromName); + } + } + + private void enterRoutePlanningModeImpl(LatLon from, String fromName) { ApplicationMode mode = settings.DEFAULT_APPLICATION_MODE.get(); if(mode == ApplicationMode.DEFAULT) { mode = ApplicationMode.CAR; } + OsmandApplication app = mapActivity.getMyApplication(); TargetPointsHelper targets = app.getTargetPointsHelper(); app.getSettings().APPLICATION_MODE.set(mode); diff --git a/OsmAnd/src/net/osmand/plus/activities/SavingTrackHelper.java b/OsmAnd/src/net/osmand/plus/activities/SavingTrackHelper.java index 0cc015bb25..148acab487 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SavingTrackHelper.java +++ b/OsmAnd/src/net/osmand/plus/activities/SavingTrackHelper.java @@ -27,7 +27,6 @@ import org.apache.commons.logging.Log; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; -import android.location.Location; import android.text.format.DateFormat; public class SavingTrackHelper extends SQLiteOpenHelper { diff --git a/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java index 3e7e116eb6..4dc7efc826 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java @@ -273,7 +273,6 @@ public class GeoIntentActivity extends OsmandListActivity { } public MapObject checkGeoPoint() { - // TODO Auto-generated method stub double lat = Double.NaN; double lon = Double.NaN; for(String e : elements) { diff --git a/OsmAnd/src/net/osmand/plus/views/controls/MapRoutePreferencesControl.java b/OsmAnd/src/net/osmand/plus/views/controls/MapRoutePreferencesControl.java index 9260120b1b..264e29e024 100644 --- a/OsmAnd/src/net/osmand/plus/views/controls/MapRoutePreferencesControl.java +++ b/OsmAnd/src/net/osmand/plus/views/controls/MapRoutePreferencesControl.java @@ -7,8 +7,6 @@ import java.util.List; import java.util.Set; import net.osmand.CallbackWithObject; -import net.osmand.Location; -import net.osmand.data.LatLon; import net.osmand.data.RotatedTileBox; import net.osmand.plus.ApplicationMode; import net.osmand.plus.GPXUtilities; @@ -16,7 +14,6 @@ import net.osmand.plus.GPXUtilities.GPXFile; import net.osmand.plus.OsmandSettings; import net.osmand.plus.OsmandSettings.CommonPreference; import net.osmand.plus.R; -import net.osmand.plus.TargetPointsHelper; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.SettingsBaseActivity; import net.osmand.plus.activities.SettingsNavigationActivity; @@ -306,23 +303,7 @@ public class MapRoutePreferencesControl extends MapControls { @Override public boolean processResult(GPXFile result) { - GPXRouteParamsBuilder params = new GPXRouteParamsBuilder(result, mapActivity.getMyApplication().getSettings()); - params.setAnnounceWaypoints(settings.SPEAK_GPX_WPT.get()); - params.setCalculateOsmAndRoute(settings.CALC_GPX_ROUTE.get()); - List ps = params.getPoints(); - - if(!ps.isEmpty()) { - Location loc = ps.get(ps.size() -1); - TargetPointsHelper tg = mapActivity.getMyApplication().getTargetPointsHelper(); - tg.navigateToPoint(new LatLon(loc.getLatitude(), loc.getLongitude()), false, -1); - if(tg.getPointToStart() == null) { - loc = ps.get(0); - tg.setStartPoint(new LatLon(loc.getLatitude(), loc.getLongitude()), false, null); - } - tg.updateRoutingHelper(); - } - mapActivity.getRoutingHelper().setGpxParams(params); - settings.FOLLOW_THE_GPX_ROUTE.set(result.path); + mapActivity.getMapActions().setGPXRouteParams(result); mapActivity.getRoutingHelper().recalculateRouteDueToSettingsChange(); updateSpinnerItems(gpxSpinner); updateParameters();