libnmc/secret-agent-simple: advise if WPS PBC enrollment is active

Print a different message on "nmcli --ask d wifi connect" if WPS
enrollment is in progress.

This is the same as GNOME Shell's secret agent (and perhaps
others) do.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1961
This commit is contained in:
Lubomir Rintel 2024-06-05 15:06:08 +02:00
parent 6de187cb37
commit 77c508c8e7

View File

@ -907,9 +907,15 @@ request_secrets_from_ui(RequestData *request)
ssid_utf8 = nm_utils_ssid_to_utf8(g_bytes_get_data(ssid, NULL), g_bytes_get_size(ssid));
title = _("Authentication required by wireless network");
msg = g_strdup_printf(
_("Passwords or encryption keys are required to access the wireless network '%s'."),
ssid_utf8);
if (request->flags & NM_SECRET_AGENT_GET_SECRETS_FLAG_WPS_PBC_ACTIVE) {
msg = g_strdup_printf(_("Push of the WPS button on the router or a password is "
"required to access the wireless network '%s'."),
ssid_utf8);
} else {
msg = g_strdup_printf(
_("Passwords or encryption keys are required to access the wireless network '%s'."),
ssid_utf8);
}
if (!add_wireless_secrets(request, secrets))
goto out_fail;