diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2018-11-08 17:55:55 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2019-02-27 10:13:38 +0100 |
commit | 484729a9378ce4db417776c0642f05415e59b16f (patch) | |
tree | 8ec0b56652673065260ec8c973c252d9b523a5b4 | |
parent | e8f61c61d311c83f1a7fecba718b322a08681636 (diff) | |
download | network-manager-applet-484729a9378ce4db417776c0642f05415e59b16f.tar.gz |
applet/info-dialog: do not show "Ignore" labels for IPv4/IPv6
Just omit the whole section.
-rw-r--r-- | src/applet-dialogs.c | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/src/applet-dialogs.c b/src/applet-dialogs.c index 89915488..052002b1 100644 --- a/src/applet-dialogs.c +++ b/src/applet-dialogs.c @@ -652,34 +652,30 @@ info_dialog_add_page (GtkNotebook *notebook, row++; /*--- IPv6 ---*/ - gtk_grid_attach (grid, create_info_group_label (_("IPv6"), FALSE), - 0, row, 1, 1); - row++; - s_ip6 = nm_connection_get_setting_ip6_config (connection); if (s_ip6) method = nm_setting_ip_config_get_method (s_ip6); - if (!method || !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) { - gtk_grid_attach (grid, create_info_label (_("Ignored"), FALSE), + if (method && strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE) != 0) { + gtk_grid_attach (grid, create_info_group_label (_("IPv6"), FALSE), 0, row, 1, 1); row++; - } - addresses = NULL; - ip6_config = nm_device_get_ip6_config (device); - if (ip6_config) { - addresses = nm_ip_config_get_addresses (ip6_config); - gateway = nm_ip_config_get_gateway (ip6_config); - } else { addresses = NULL; - gateway = NULL; - } + ip6_config = nm_device_get_ip6_config (device); + if (ip6_config) { + addresses = nm_ip_config_get_addresses (ip6_config); + gateway = nm_ip_config_get_gateway (ip6_config); + } else { + addresses = NULL; + gateway = NULL; + } - if (addresses && addresses->len > 0) - def6_addr = (NMIPAddress *) g_ptr_array_index (addresses, 0); + if (addresses && addresses->len > 0) + def6_addr = (NMIPAddress *) g_ptr_array_index (addresses, 0); - display_ip6_info (def6_addr, addresses, method, grid, &row); + display_ip6_info (def6_addr, addresses, method, grid, &row); + } /* Gateway */ if (gateway && *gateway) { @@ -867,19 +863,15 @@ info_dialog_add_page_for_vpn (GtkNotebook *notebook, /*--- IPv6 ---*/ ip6_config = nm_active_connection_get_ip6_config (active); if (ip6_config) { - gtk_grid_attach (grid, create_info_group_label (_("IPv6"), FALSE), - 0, row, 1, 1); - row++; - s_ip6 = nm_connection_get_setting_ip6_config (connection); if (s_ip6) method = nm_setting_ip_config_get_method (s_ip6); + } - if (!method || !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) { - gtk_grid_attach (grid, create_info_label (_("Ignored"), FALSE), - 0, row, 1, 1); - row++; - } + if (method && strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE) != 0) { + gtk_grid_attach (grid, create_info_group_label (_("IPv6"), FALSE), + 0, row, 1, 1); + row++; addresses = nm_ip_config_get_addresses (ip6_config); if (addresses && addresses->len > 0) |