diff --git a/gui/dialogs/route-manager.xml b/gui/dialogs/route-manager.xml index 257d1a1ae..c99faae34 100644 --- a/gui/dialogs/route-manager.xml +++ b/gui/dialogs/route-manager.xml @@ -44,18 +44,26 @@ command interface /autopilot/route-manager/input: var insert = func { var insertIndex = sel_index(); - if (insertIndex >= 0) { - # when selection index is valid, insert *after* the waypoint - insertIndex = insertIndex + 1; + if (insertIndex < 0) { + var msg = "Select the waypoint after which new waypoints should be added"; + setprop("sim/messages/copilot", msg); + return; + } + + # Input is a list of space-separated waypoint specifications + var argv = split(" ", input.getValue()); + foreach (var arg; argv) { + # When argument is not empty (caused by multiple space + # separators) insert *after* waypoint + if (size(arg) > 0) { + insertIndex += 1; + cmd.setValue("@insert" ~ insertIndex ~ ":" ~ arg); + } } - cmd.setValue("@insert" ~ insertIndex ~ ":" ~ input.getValue()); input.setValue(""); - - if (insertIndex >= 0) { - selection.setValue(insertIndex); - gui.dialog_update("route-manager"); - } + selection.setValue(insertIndex); + gui.dialog_update("route-manager"); } var remove = func { @@ -645,7 +653,7 @@ command interface /autopilot/route-manager/input: 1 - + 0.7 0.7