mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-04 03:06:12 +00:00
feat(nav): share a waypoint as a message
Waypoints list → Hold Enter → Send hands the point to the Messages screen
as "[WAY]<lat>,<lon> <label>" (same text format geo::parseLatLon already
reads). The user picks a contact or channel, the text lands prefilled in
the keyboard to confirm/edit, then sends — closing the loop with the
Navigate / Save waypoint actions on the receiving end.
- QuickMsgScreen: share-compose mode (startShare/beginShareCompose). Picking
a recipient jumps straight to the prefilled keyboard; cancel returns home;
afterSend clears the mode.
- UITask::shareToMessage hands off from TrailScreen to the Messages screen.
- TrailScreen: "Send" added to the waypoint Rename/Delete popup; builds the
[WAY] payload at the {loc} precision (5 dp).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -119,13 +119,22 @@ public:
|
||||
_wp_kb.begin(_task->waypoints().at(wi).label, WAYPOINT_LABEL_LEN - 1);
|
||||
_kb_active = true;
|
||||
}
|
||||
} else { // Delete
|
||||
} else if (sel == 1) { // Delete
|
||||
if (wi >= 0 && wi < _task->waypoints().count()) {
|
||||
_task->waypoints().remove(wi);
|
||||
_task->saveWaypoints();
|
||||
if (_wp_sel >= wpListCount()) _wp_sel = wpListCount() - 1;
|
||||
if (_wp_sel < 0) _wp_sel = 0;
|
||||
}
|
||||
} else { // Send (share in a message)
|
||||
if (wi >= 0 && wi < _task->waypoints().count()) {
|
||||
const Waypoint& w = _task->waypoints().at(wi);
|
||||
double lat = w.lat_1e6 / 1000000.0, lon = w.lon_1e6 / 1000000.0;
|
||||
char text[80];
|
||||
if (w.label[0]) snprintf(text, sizeof(text), WAYPOINT_MSG_TAG "%.5f,%.5f %s", lat, lon, w.label);
|
||||
else snprintf(text, sizeof(text), WAYPOINT_MSG_TAG "%.5f,%.5f", lat, lon);
|
||||
_task->shareToMessage(text); // hands off to the Messages screen
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -147,9 +156,10 @@ public:
|
||||
if (c == KEY_ENTER && n > 0) { _wp_mode = WP_NAV; return true; }
|
||||
// Rename/Delete apply to saved waypoints only — not the Trail-start row.
|
||||
if (c == KEY_CONTEXT_MENU && !selIsStart() && wpIndex() < _task->waypoints().count()) {
|
||||
_wp_ctx.begin("Waypoint", 2);
|
||||
_wp_ctx.begin("Waypoint", 3);
|
||||
_wp_ctx.addItem("Rename");
|
||||
_wp_ctx.addItem("Delete");
|
||||
_wp_ctx.addItem("Send");
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user