Clarify message about track/bus name restrictions

see also 5b746b186a. Route::ensure_track_or_route_name
uses `legalize_for_universal_path`.
This commit is contained in:
Robin Gareus 2025-10-20 16:59:13 +02:00
parent 87a8b727d0
commit 768f2dc768
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -1747,19 +1747,16 @@ RouteUI::set_color_from_route ()
bool
RouteUI::verify_new_route_name (const std::string& name)
{
if (name.find (':') == string::npos) {
if (name == legalize_for_universal_path (name)) {
return true;
}
MessageDialog colon_msg (
_("The use of colons (':') is discouraged in track and bus names.\nDo you want to use this new name?"),
false, MESSAGE_QUESTION, BUTTONS_NONE
);
MessageDialog (
_("The name includes special characters (<>:\"/\\|?*) which is discouraged in track and bus names, due to filename restrictiosn on some systems.\n"),
false, MESSAGE_INFO, BUTTONS_OK
).run ();
colon_msg.add_button (_("Use the new name"), Gtk::RESPONSE_ACCEPT);
colon_msg.add_button (_("Re-edit the name"), Gtk::RESPONSE_CANCEL);
return (colon_msg.run () == Gtk::RESPONSE_ACCEPT);
return false;
}
void