diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2016-01-22 21:48:56 +0100 |
---|---|---|
committer | Rui Matos <tiagomatos@gmail.com> | 2016-01-26 16:51:09 +0100 |
commit | 62683047c5cd804c2b275501a65f80181a3883c5 (patch) | |
tree | 3dee9fc25249e96bcf8b2c39db81432c79402876 | |
parent | 90a2e30c01399f542e65c02832174b85b176f5db (diff) | |
download | gnome-control-center-62683047c5cd804c2b275501a65f80181a3883c5.tar.gz |
network: read secrets for the VPN connections
The VPN page needs secrets too. Don't initialize it until the secrets are
loaded, otherwise the secrets are lost on each connection edit.
https://bugzilla.gnome.org/show_bug.cgi?id=761004
-rw-r--r-- | panels/network/connection-editor/ce-page-vpn.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/panels/network/connection-editor/ce-page-vpn.c b/panels/network/connection-editor/ce-page-vpn.c index c77d753d0..44f33a056 100644 --- a/panels/network/connection-editor/ce-page-vpn.c +++ b/panels/network/connection-editor/ce-page-vpn.c @@ -188,13 +188,29 @@ ce_page_vpn_class_init (CEPageVpnClass *class) page_class->validate = validate; } +static void +finish_setup (CEPageVpn *page, gpointer unused, GError *error, gpointer user_data) +{ + NMConnection *connection = CE_PAGE (page)->connection; + const char *vpn_type; + + page->setting_connection = nm_connection_get_setting_connection (connection); + page->setting_vpn = nm_connection_get_setting_vpn (connection); + vpn_type = nm_setting_vpn_get_service_type (page->setting_vpn); + + page->plugin = vpn_get_plugin_by_service (vpn_type); + if (page->plugin) + load_vpn_plugin (page, connection); + + connect_vpn_page (page); +} + CEPage * ce_page_vpn_new (NMConnection *connection, NMClient *client, NMRemoteSettings *settings) { CEPageVpn *page; - const char *vpn_type; page = CE_PAGE_VPN (ce_page_new (CE_TYPE_PAGE_VPN, connection, @@ -206,15 +222,9 @@ ce_page_vpn_new (NMConnection *connection, page->name = GTK_ENTRY (gtk_builder_get_object (CE_PAGE (page)->builder, "entry_name")); page->box = GTK_BOX (gtk_builder_get_object (CE_PAGE (page)->builder, "page")); - page->setting_connection = nm_connection_get_setting_connection (connection); - page->setting_vpn = nm_connection_get_setting_vpn (connection); - vpn_type = nm_setting_vpn_get_service_type (page->setting_vpn); + g_signal_connect (page, "initialized", G_CALLBACK (finish_setup), NULL); - page->plugin = vpn_get_plugin_by_service (vpn_type); - if (page->plugin) - load_vpn_plugin (page, connection); - - connect_vpn_page (page); + CE_PAGE (page)->security_setting = NM_SETTING_VPN_SETTING_NAME; return CE_PAGE (page); } |