From dca3584b26c419f8d876b9cffc34533ff10cac27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Fri, 24 May 2013 22:36:24 +0200 Subject: cli: 'dev wifi list': change SECURITY values * remove "Encrypted" tag The "Encrypted: " stuff was initially copied from nm-tool, but it doesn't help here much. See also http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=a734c836a56f3170202f0555f1a03c9b2835775c for APs with WPA & RSN IEs, but no privacy flag. * remove a space from "WPA ", etc. strings. Translators often leave it out and thus break output. * change "WPA" to "WPA1" to make it clearer * use "802.1X" instead of "Enterprise" to save some characters --- cli/src/devices.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/cli/src/devices.c b/cli/src/devices.c index f9add57013..005bd9f456 100644 --- a/cli/src/devices.c +++ b/cli/src/devices.c @@ -441,22 +441,26 @@ fill_output_access_point (gpointer data, gpointer user_data) sig_level_0; security_str = g_string_new (NULL); - if ( !(flags & NM_802_11_AP_FLAGS_PRIVACY) - && (wpa_flags != NM_802_11_AP_SEC_NONE) - && (rsn_flags != NM_802_11_AP_SEC_NONE)) - g_string_append (security_str, _("Encrypted: ")); if ( (flags & NM_802_11_AP_FLAGS_PRIVACY) && (wpa_flags == NM_802_11_AP_SEC_NONE) - && (rsn_flags == NM_802_11_AP_SEC_NONE)) - g_string_append (security_str, _("WEP ")); - if (wpa_flags != NM_802_11_AP_SEC_NONE) - g_string_append (security_str, _("WPA ")); - if (rsn_flags != NM_802_11_AP_SEC_NONE) - g_string_append (security_str, _("WPA2 ")); + && (rsn_flags == NM_802_11_AP_SEC_NONE)) { + g_string_append (security_str, _("WEP")); + g_string_append_c (security_str, ' '); + } + if (wpa_flags != NM_802_11_AP_SEC_NONE) { + g_string_append (security_str, _("WPA1")); + g_string_append_c (security_str, ' '); + } + if (rsn_flags != NM_802_11_AP_SEC_NONE) { + g_string_append (security_str, _("WPA2")); + g_string_append_c (security_str, ' '); + } if ( (wpa_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X) - || (rsn_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X)) - g_string_append (security_str, _("Enterprise ")); + || (rsn_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X)) { + g_string_append (security_str, _("802.1X")); + g_string_append_c (security_str, ' '); + } if (security_str->len > 0) g_string_truncate (security_str, security_str->len-1); /* Chop off last space */ -- cgit v1.2.1