Commit de2215e7 authored by Dan Williams's avatar Dan Williams Committed by Dan Williams
Browse files

src/gconf-helpers/gconf-helpers.c src/gconf-helpers/gconf-helpers.h -

2008-12-05  Dan Williams  <dcbw@redhat.com>

	* src/gconf-helpers/gconf-helpers.c
	  src/gconf-helpers/gconf-helpers.h
		- (nm_gconf_clear_private_connection_values): new function to clear
			applet private values from a connection

	* src/connection-editor/page-wired-security.c
		- (ce_page_wired_security_new): ensure setting gets updated when
			security is changed
		- (validate): copy applet private values to the real connection when
			using 802.1x security; clear applet private values when there's no
			security

	* src/connection-editor/page-wireless-security.c
		- (validate): clear applet private values when there's no security


svn path=/trunk/; revision=1054
parent bdbc87b9
2008-12-05 Dan Williams <dcbw@redhat.com>
* src/gconf-helpers/gconf-helpers.c
src/gconf-helpers/gconf-helpers.h
- (nm_gconf_clear_private_connection_values): new function to clear
applet private values from a connection
* src/connection-editor/page-wired-security.c
- (ce_page_wired_security_new): ensure setting gets updated when
security is changed
- (validate): copy applet private values to the real connection when
using 802.1x security; clear applet private values when there's no
security
* src/connection-editor/page-wireless-security.c
- (validate): clear applet private values when there's no security
2008-11-26 Dan Williams <dcbw@redhat.com>
* Release 0.7
......
......@@ -93,6 +93,7 @@ ce_page_wired_security_new (NMConnection *connection)
G_CALLBACK (enable_toggled), self);
gtk_toggle_button_set_active (priv->enabled, setting != NULL);
g_signal_connect_swapped (priv->enabled, "toggled", G_CALLBACK (ce_page_changed), self);
gtk_widget_set_sensitive (priv->security_widget, setting != NULL);
gtk_box_pack_start (GTK_BOX (parent->page), GTK_WIDGET (priv->enabled), FALSE, TRUE, 12);
......@@ -123,13 +124,15 @@ validate (CEPage *page, NMConnection *connection, GError **error)
s_8021x = nm_connection_get_setting (tmp_connection, NM_TYPE_SETTING_802_1X);
nm_connection_add_setting (connection, NM_SETTING (g_object_ref (s_8021x)));
nm_gconf_copy_private_connection_values (connection, tmp_connection);
g_object_unref (tmp_connection);
} else
g_set_error (error, 0, 0, "Invalid 802.1x security");
} else {
valid = TRUE;
nm_connection_remove_setting (connection, NM_TYPE_SETTING_802_1X);
nm_gconf_clear_private_connection_values (connection);
valid = TRUE;
}
return valid;
......
......@@ -29,6 +29,7 @@
#include <nm-setting-connection.h>
#include <nm-setting-wireless.h>
#include <nm-setting-wireless-security.h>
#include <nm-setting-8021x.h>
#include <nm-utils.h>
#include "wireless-security.h"
......@@ -407,6 +408,9 @@ validate (CEPage *page, NMConnection *connection, GError **error)
} else {
/* No security, unencrypted */
g_object_set (s_wireless, NM_SETTING_WIRELESS_SEC, NULL, NULL);
nm_connection_remove_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY);
nm_connection_remove_setting (connection, NM_TYPE_SETTING_802_1X);
nm_gconf_clear_private_connection_values (connection);
valid = TRUE;
}
......
......@@ -1830,6 +1830,24 @@ nm_gconf_copy_private_connection_values (NMConnection *dst, NMConnection *src)
copy_str_item (dst, src, NMA_PHASE2_PRIVATE_KEY_PASSWORD_TAG);
}
void
nm_gconf_clear_private_connection_values (NMConnection *connection)
{
g_return_if_fail (NM_IS_CONNECTION (connection));
g_object_set_data (G_OBJECT (connection), NMA_CA_CERT_IGNORE_TAG, NULL);
g_object_set_data (G_OBJECT (connection), NMA_PHASE2_CA_CERT_IGNORE_TAG, NULL);
g_object_set_data (G_OBJECT (connection), NMA_PATH_CLIENT_CERT_TAG, NULL);
g_object_set_data (G_OBJECT (connection), NMA_PATH_PHASE2_CLIENT_CERT_TAG, NULL);
g_object_set_data (G_OBJECT (connection), NMA_PATH_CA_CERT_TAG, NULL);
g_object_set_data (G_OBJECT (connection), NMA_PATH_PHASE2_CA_CERT_TAG, NULL);
g_object_set_data (G_OBJECT (connection), NMA_PATH_PRIVATE_KEY_TAG, NULL);
g_object_set_data (G_OBJECT (connection), NMA_PRIVATE_KEY_PASSWORD_TAG, NULL);
g_object_set_data (G_OBJECT (connection), NMA_PATH_PHASE2_PRIVATE_KEY_TAG, NULL);
g_object_set_data (G_OBJECT (connection), NMA_PHASE2_PRIVATE_KEY_PASSWORD_TAG, NULL);
}
NMConnection *
nm_gconf_connection_duplicate (NMConnection *connection)
{
......
......@@ -48,6 +48,7 @@
NMConnection *nm_gconf_connection_duplicate (NMConnection *connection);
void nm_gconf_copy_private_connection_values (NMConnection *dst, NMConnection *src);
void nm_gconf_clear_private_connection_values (NMConnection *connection);
#define KEYRING_UUID_TAG "connection-uuid"
#define KEYRING_SN_TAG "setting-name"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment