cli: device: color WEP APs differently in "wifi list"

Provide a visual cue suggesting that an attempt to associate with an WEP
access point might not work. Whether it actually will work up to the daemon.
This commit is contained in:
Lubomir Rintel
2022-03-08 12:09:05 +01:00
parent 422ae6bea6
commit 550e3bbdd8

View File

@@ -1237,6 +1237,9 @@ compare_aps(gconstpointer a, gconstpointer b, gpointer user_data)
NMAccessPoint *apa = *(NMAccessPoint **) a;
NMAccessPoint *apb = *(NMAccessPoint **) b;
/* Sort the deprecated WEP connections last. */
NM_CMP_DIRECT(_ap_is_wep(apb), _ap_is_wep(apa));
NM_CMP_DIRECT(nm_access_point_get_strength(apb), nm_access_point_get_strength(apa));
NM_CMP_DIRECT(nm_access_point_get_frequency(apa), nm_access_point_get_frequency(apb));
NM_CMP_DIRECT(nm_access_point_get_max_bitrate(apb), nm_access_point_get_max_bitrate(apa));
@@ -1382,6 +1385,8 @@ fill_output_access_point(NMAccessPoint *ap, const APInfo *info)
/* Set colors */
color = wifi_signal_to_color(strength);
if (_ap_is_wep(ap))
color = NM_META_COLOR_WIFI_DEPRECATED;
set_val_color_all(arr, color);
if (active)
arr[15].color = NM_META_COLOR_CONNECTION_ACTIVATED;