network-manager-applet r729 - in trunk: . src/connection-editor



Author: tambeti
Date: Fri May 23 07:58:09 2008
New Revision: 729
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=729&view=rev

Log:
2008-05-23  Tambet Ingo  <tambet gmail com>

	* src/connection-editor/page-ip4.c: Add a "DHCP with manual DNS settings"
	IP4 configuration method.


Modified:
   trunk/ChangeLog
   trunk/src/connection-editor/ce-page-ip4.glade
   trunk/src/connection-editor/page-ip4.c

Modified: trunk/src/connection-editor/ce-page-ip4.glade
==============================================================================
--- trunk/src/connection-editor/ce-page-ip4.glade	(original)
+++ trunk/src/connection-editor/ce-page-ip4.glade	Fri May 23 07:58:09 2008
@@ -61,7 +61,8 @@
 	      <property name="visible">True</property>
 	      <property name="items" translatable="yes">DHCP
 Auto IP
-Manual</property>
+Manual
+DHCP with manual DNS settings</property>
 	      <property name="add_tearoffs">False</property>
 	      <property name="focus_on_click">True</property>
 	    </widget>

Modified: trunk/src/connection-editor/page-ip4.c
==============================================================================
--- trunk/src/connection-editor/page-ip4.c	(original)
+++ trunk/src/connection-editor/page-ip4.c	Fri May 23 07:58:09 2008
@@ -56,9 +56,10 @@
 	gboolean disposed;
 } CEPageIP4Private;
 
-#define IP4_METHOD_DHCP   0
-#define IP4_METHOD_AUTOIP 1
-#define IP4_METHOD_MANUAL 2
+#define IP4_METHOD_DHCP            0
+#define IP4_METHOD_AUTOIP          1
+#define IP4_METHOD_MANUAL          2
+#define IP4_METHOD_DHCP_MANUAL_DNS 3
 
 #define COL_ADDRESS 0
 #define COL_NETMASK 1
@@ -123,6 +124,10 @@
 		else if (!strcmp (setting->method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL))
 			method = IP4_METHOD_MANUAL;
 	}
+
+	if (method == IP4_METHOD_DHCP && setting->ignore_dhcp_dns)
+		method = IP4_METHOD_DHCP_MANUAL_DNS;
+
 	gtk_combo_box_set_active (priv->method, method);
 	g_signal_connect (priv->method, "changed", G_CALLBACK (method_changed), self);
 
@@ -517,6 +522,7 @@
 	gboolean valid;
 	const char *text;
 	char **items = NULL, **iter;
+	gboolean ignore_dhcp_dns = FALSE;
 
 	/* Method */
 	switch (gtk_combo_box_get_active (priv->method)) {
@@ -526,6 +532,9 @@
 	case IP4_METHOD_MANUAL:
 		method = NM_SETTING_IP4_CONFIG_METHOD_MANUAL;
 		break;
+	case IP4_METHOD_DHCP_MANUAL_DNS:
+		ignore_dhcp_dns = TRUE;
+		/* fall through */
 	default:
 		method = NM_SETTING_IP4_CONFIG_METHOD_DHCP;
 		break;
@@ -621,6 +630,7 @@
 				  NM_SETTING_IP4_CONFIG_ADDRESSES, addresses,
 				  NM_SETTING_IP4_CONFIG_DNS, dns_servers,
 				  NM_SETTING_IP4_CONFIG_DNS_SEARCH, search_domains,
+				  NM_SETTING_IP4_CONFIG_IGNORE_DHCP_DNS, ignore_dhcp_dns,
 				  NULL);
 
 	if (addresses) {



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