diff --git a/panels/network/connection-editor/net-connection-editor.c b/panels/network/connection-editor/net-connection-editor.c index 44fcc676c..d08d011e8 100644 --- a/panels/network/connection-editor/net-connection-editor.c +++ b/panels/network/connection-editor/net-connection-editor.c @@ -505,6 +505,9 @@ net_connection_editor_set_connection (NetConnectionEditor *editor, GSList *pages, *l; NMSettingConnection *sc; const gchar *type; + gboolean is_wired; + gboolean is_wifi; + gboolean is_vpn; editor->is_new_connection = !nm_client_get_connection_by_uuid (editor->client, nm_connection_get_uuid (connection)); @@ -527,19 +530,18 @@ net_connection_editor_set_connection (NetConnectionEditor *editor, sc = nm_connection_get_setting_connection (connection); type = nm_setting_connection_get_connection_type (sc); + is_wired = g_str_equal (type, NM_SETTING_WIRED_SETTING_NAME); + is_wifi = g_str_equal (type, NM_SETTING_WIRELESS_SETTING_NAME); + is_vpn = g_str_equal (type, NM_SETTING_VPN_SETTING_NAME); + if (!editor->is_new_connection) add_page (editor, ce_page_details_new (editor->connection, editor->client, editor->device, editor->ap, editor)); - if (strcmp (type, NM_SETTING_WIRELESS_SETTING_NAME) == 0) - add_page (editor, ce_page_security_new (editor->connection, editor->client)); - else if (strcmp (type, NM_SETTING_WIRED_SETTING_NAME) == 0) - add_page (editor, ce_page_8021x_security_new (editor->connection, editor->client)); - - if (strcmp (type, NM_SETTING_WIRELESS_SETTING_NAME) == 0) + if (is_wifi) add_page (editor, ce_page_wifi_new (editor->connection, editor->client)); - else if (strcmp (type, NM_SETTING_WIRED_SETTING_NAME) == 0) + else if (is_wired) add_page (editor, ce_page_ethernet_new (editor->connection, editor->client)); - else if (strcmp (type, NM_SETTING_VPN_SETTING_NAME) == 0) + else if (is_vpn) add_page (editor, ce_page_vpn_new (editor->connection, editor->client)); else { /* Unsupported type */ @@ -550,6 +552,11 @@ net_connection_editor_set_connection (NetConnectionEditor *editor, add_page (editor, ce_page_ip4_new (editor->connection, editor->client)); add_page (editor, ce_page_ip6_new (editor->connection, editor->client)); + if (is_wifi) + add_page (editor, ce_page_security_new (editor->connection, editor->client)); + else if (is_wired) + add_page (editor, ce_page_8021x_security_new (editor->connection, editor->client)); + pages = g_slist_copy (editor->initializing_pages); for (l = pages; l; l = l->next) { CEPage *page = l->data;