network-manager-applet r814 - in trunk: . src/connection-editor src/gconf-helpers



Author: dcbw
Date: Fri Aug  1 14:34:21 2008
New Revision: 814
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=814&view=rev

Log:
2008-08-01  Dan Williams  <dcbw redhat com>

	* src/gconf-helpers/gconf-upgrade.c
	  src/gconf-helpers/gconf-upgrade.h
		- (nm_gconf_migrate_0_7_ip4_method): Update ipv4 method names to match
			NM svn r3882 and later

	* gconf-helpers/gconf-helpers.c
		- (nm_gconf_get_all_connections): convert method names

	* src/connection-editor/page-ip4.c
		- (populate_ui, ui_to_setting): use new method names



Modified:
   trunk/ChangeLog
   trunk/src/connection-editor/page-ip4.c
   trunk/src/gconf-helpers/gconf-helpers.c
   trunk/src/gconf-helpers/gconf-upgrade.c
   trunk/src/gconf-helpers/gconf-upgrade.h

Modified: trunk/src/connection-editor/page-ip4.c
==============================================================================
--- trunk/src/connection-editor/page-ip4.c	(original)
+++ trunk/src/connection-editor/page-ip4.c	Fri Aug  1 14:34:21 2008
@@ -225,7 +225,7 @@
 	/* Method */
 	gtk_combo_box_set_active (priv->method, 0);
 	if (setting->method) {
-		if (!strcmp (setting->method, NM_SETTING_IP4_CONFIG_METHOD_AUTOIP))
+		if (!strcmp (setting->method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL))
 			method = IP4_METHOD_LINK_LOCAL;
 		else if (!strcmp (setting->method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL))
 			method = IP4_METHOD_MANUAL;
@@ -600,7 +600,7 @@
 
 	switch (int_method) {
 	case IP4_METHOD_LINK_LOCAL:
-		method = NM_SETTING_IP4_CONFIG_METHOD_AUTOIP;
+		method = NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL;
 		break;
 	case IP4_METHOD_MANUAL:
 		method = NM_SETTING_IP4_CONFIG_METHOD_MANUAL;
@@ -612,7 +612,7 @@
 		ignore_dhcp_dns = TRUE;
 		/* fall through */
 	default:
-		method = NM_SETTING_IP4_CONFIG_METHOD_DHCP;
+		method = NM_SETTING_IP4_CONFIG_METHOD_AUTO;
 		break;
 	}
 
@@ -716,7 +716,7 @@
 	search_domains = g_slist_reverse (search_domains);
 
 	/* DHCP client ID */
-	if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DHCP)) {
+	if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) {
 		dhcp_client_id = gtk_entry_get_text (priv->dhcp_client_id_entry);
 		if (dhcp_client_id && !strlen (dhcp_client_id))
 			dhcp_client_id = NULL;

Modified: trunk/src/gconf-helpers/gconf-helpers.c
==============================================================================
--- trunk/src/gconf-helpers/gconf-helpers.c	(original)
+++ trunk/src/gconf-helpers/gconf-helpers.c	Fri Aug  1 14:34:21 2008
@@ -752,6 +752,7 @@
 	nm_gconf_migrate_0_7_vpn_connections (client);
 	nm_gconf_migrate_0_7_wireless_security (client);
 	nm_gconf_migrate_0_7_netmask_to_prefix (client);
+	nm_gconf_migrate_0_7_ip4_method (client);
 
 	connections = gconf_client_all_dirs (client, GCONF_PATH_CONNECTIONS, NULL);
 	if (!connections) {

Modified: trunk/src/gconf-helpers/gconf-upgrade.c
==============================================================================
--- trunk/src/gconf-helpers/gconf-upgrade.c	(original)
+++ trunk/src/gconf-helpers/gconf-upgrade.c	Fri Aug  1 14:34:21 2008
@@ -1063,3 +1063,41 @@
 	gconf_client_suggest_sync (client, NULL);
 }
 
+void
+nm_gconf_migrate_0_7_ip4_method (GConfClient *client)
+{
+	GSList *connections, *iter;
+
+	connections = gconf_client_all_dirs (client, GCONF_PATH_CONNECTIONS, NULL);
+	for (iter = connections; iter; iter = iter->next) {
+		char *id = g_path_get_basename ((const char *) iter->data);
+		char *method = NULL;
+
+		if (!nm_gconf_get_string_helper (client, iter->data,
+		                                 NM_SETTING_IP4_CONFIG_METHOD,
+		                                 NM_SETTING_IP4_CONFIG_SETTING_NAME,
+		                                 &method))
+			goto next;
+
+		if (!strcmp (method, "autoip")) {
+			nm_gconf_set_string_helper (client, iter->data,
+			                            NM_SETTING_IP4_CONFIG_METHOD,
+			                            NM_SETTING_IP4_CONFIG_SETTING_NAME,
+			                            NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL);
+		} else if (!strcmp (method, "dhcp")) {
+			nm_gconf_set_string_helper (client, iter->data,
+			                            NM_SETTING_IP4_CONFIG_METHOD,
+			                            NM_SETTING_IP4_CONFIG_SETTING_NAME,
+			                            NM_SETTING_IP4_CONFIG_METHOD_AUTO);
+		}
+
+		g_free (method);
+
+next:
+		g_free (id);
+	}
+	free_slist (connections);
+
+	gconf_client_suggest_sync (client, NULL);
+}
+

Modified: trunk/src/gconf-helpers/gconf-upgrade.h
==============================================================================
--- trunk/src/gconf-helpers/gconf-upgrade.h	(original)
+++ trunk/src/gconf-helpers/gconf-upgrade.h	Fri Aug  1 14:34:21 2008
@@ -36,5 +36,7 @@
 
 void nm_gconf_migrate_0_7_netmask_to_prefix (GConfClient *client);
 
+void nm_gconf_migrate_0_7_ip4_method (GConfClient *client);
+
 #endif	/* GCONF_UPGRADE_H */
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]