more new resources from hardcoded messages
This commit is contained in:
parent
b9cd75b7a0
commit
3acbd96575
2 changed files with 28 additions and 10 deletions
|
@ -380,14 +380,14 @@ public class BRouterView extends View {
|
||||||
try {
|
try {
|
||||||
cor.readAllPoints();
|
cor.readAllPoints();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
msg = "Error reading waypoints: " + e;
|
msg = getContext().getString(R.string.msg_read_wpt_error)+ ": " + e;
|
||||||
}
|
}
|
||||||
|
|
||||||
int size = cor.allpoints.size();
|
int size = cor.allpoints.size();
|
||||||
if (size < 1)
|
if (size < 1)
|
||||||
msg = "coordinate source does not contain any waypoints!";
|
msg = getContext().getString(R.string.msg_no_wpt);
|
||||||
if (size > 1000)
|
if (size > 1000)
|
||||||
msg = "coordinate source contains too much waypoints: " + size + "(please use from/to/via names)";
|
msg = getContext().getString(R.string.msg_to_much_wpts, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg != null) {
|
if (msg != null) {
|
||||||
|
@ -471,13 +471,13 @@ public class BRouterView extends View {
|
||||||
if (needsWaypointSelection) {
|
if (needsWaypointSelection) {
|
||||||
StringBuilder msg;
|
StringBuilder msg;
|
||||||
if (wpList.size() == 0) {
|
if (wpList.size() == 0) {
|
||||||
msg = new StringBuilder("Expecting waypoint selection\n" + "(coordinate-source: " + cor.basedir + cor.rootdir + ")");
|
msg = new StringBuilder(getContext().getString(R.string.msg_no_wpt_selection) + "(coordinate-source: " + cor.basedir + cor.rootdir + ")");
|
||||||
} else {
|
} else {
|
||||||
msg = new StringBuilder("current waypoint selection:\n");
|
msg = new StringBuilder(getContext().getString(R.string.msg_wpt_selection));
|
||||||
for (int i = 0; i < wpList.size(); i++)
|
for (int i = 0; i < wpList.size(); i++)
|
||||||
msg.append(i > 0 ? "->" : "").append(wpList.get(i).name);
|
msg.append(i > 0 ? "->" : "").append(wpList.get(i).name);
|
||||||
}
|
}
|
||||||
((BRouterActivity) getContext()).showResultMessage("Select Action", msg.toString(), wpList.size());
|
((BRouterActivity) getContext()).showResultMessage(getContext().getString(R.string.title_action), msg.toString(), wpList.size());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -718,8 +718,13 @@ public class BRouterView extends View {
|
||||||
((BRouterActivity) getContext()).showErrorMessage(cr.getErrorMessage());
|
((BRouterActivity) getContext()).showErrorMessage(cr.getErrorMessage());
|
||||||
} else {
|
} else {
|
||||||
String memstat = memoryClass + "mb pathPeak " + ((cr.getPathPeak() + 500) / 1000) + "k";
|
String memstat = memoryClass + "mb pathPeak " + ((cr.getPathPeak() + 500) / 1000) + "k";
|
||||||
String result = "version = BRouter-" + getContext().getString(R.string.app_version) + "\n" + "mem = " + memstat + "\ndistance = " + cr.getDistance() / 1000. + " km\n" + "filtered ascend = " + cr.getAscend()
|
String result = getContext().getString(R.string.msg_status_result,
|
||||||
+ " m\n" + "plain ascend = " + cr.getPlainAscend() + " m\n" + "estimated time = " + cr.getTime();
|
getContext().getString(R.string.app_version),
|
||||||
|
memstat,
|
||||||
|
Double.toString(cr.getDistance() / 1000.),
|
||||||
|
Integer.toString(cr.getAscend()),
|
||||||
|
Integer.toString(cr.getPlainAscend()),
|
||||||
|
cr.getTime());
|
||||||
|
|
||||||
rawTrack = cr.getFoundRawTrack();
|
rawTrack = cr.getFoundRawTrack();
|
||||||
|
|
||||||
|
@ -728,9 +733,9 @@ public class BRouterView extends View {
|
||||||
writeRawTrackToPath(rawTrackPath);
|
writeRawTrackToPath(rawTrackPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
String title = "Success";
|
String title = getContext().getString(R.string.success);
|
||||||
if (cr.getAlternativeIndex() > 0)
|
if (cr.getAlternativeIndex() > 0)
|
||||||
title += " / " + cr.getAlternativeIndex() + ". Alternative";
|
title += " / " + cr.getAlternativeIndex() + ". " + getContext().getString(R.string.msg_alternative);
|
||||||
|
|
||||||
((BRouterActivity) getContext()).showResultMessage(title, result, rawTrackPath == null ? -1 : -3);
|
((BRouterActivity) getContext()).showResultMessage(title, result, rawTrackPath == null ? -1 : -3);
|
||||||
trackOutfile = cr.getOutfile();
|
trackOutfile = cr.getOutfile();
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
maptool, with the exact same destination point and a close-by starting point,
|
maptool, with the exact same destination point and a close-by starting point,
|
||||||
this request is guaranteed not to time out.</string>
|
this request is guaranteed not to time out.</string>
|
||||||
<string name="title_sdcard">Enter SDCARD base dir:</string>
|
<string name="title_sdcard">Enter SDCARD base dir:</string>
|
||||||
|
<string name="title_action">Select Action</string>
|
||||||
|
|
||||||
<string name="action_via_select">Check VIA Selection:</string>
|
<string name="action_via_select">Check VIA Selection:</string>
|
||||||
<string name="action_nogo_select">Check NoGo Selection:</string>
|
<string name="action_nogo_select">Check NoGo Selection:</string>
|
||||||
|
@ -55,5 +56,17 @@
|
||||||
<string name="msg_no_used_profile">, no used profile</string>
|
<string name="msg_no_used_profile">, no used profile</string>
|
||||||
<string name="msg_too_much_data">Too much data for download. Please reduce.</string>
|
<string name="msg_too_much_data">Too much data for download. Please reduce.</string>
|
||||||
<string name="msg_download_start">Download scheduled. Check internet connection if it doesn\'t start.</string>
|
<string name="msg_download_start">Download scheduled. Check internet connection if it doesn\'t start.</string>
|
||||||
|
<string name="msg_wpt_selection">current waypoint selection:\n</string>
|
||||||
|
<string name="msg_no_wpt_selection">Expecting waypoint selection\n</string>
|
||||||
|
<string name="msg_alternative">Alternative</string>
|
||||||
|
<string name="msg_status_result">version = BRouter-%1$s \n
|
||||||
|
mem = %2$s \n
|
||||||
|
distance = %3$s km\n
|
||||||
|
filtered ascend = %4$s m\n
|
||||||
|
plain ascend = %5$s m\n
|
||||||
|
estimated time = %6$s</string>
|
||||||
|
<string name="msg_read_wpt_error">Error reading waypoints</string>
|
||||||
|
<string name="msg_no_wpt">coordinate source does not contain any waypoints!</string>
|
||||||
|
<string name="msg_to_much_wpts">"coordinate source contains too much waypoints: %1$d (please use from/to/via names)</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in a new issue