network-manager-applet r1138 - in branches/NETWORKMANAGER_APPLET_0_7: . src/connection-editor



Author: dcbw
Date: Fri Feb  6 18:16:18 2009
New Revision: 1138
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=1138&view=rev

Log:
2009-02-06  Dan Williams  <dcbw redhat com>

	* src/connection-editor/page-ip4.c
		- (method_changed): disable "DHCP Client ID" entry for VPN connections



Modified:
   branches/NETWORKMANAGER_APPLET_0_7/ChangeLog
   branches/NETWORKMANAGER_APPLET_0_7/src/connection-editor/page-ip4.c

Modified: branches/NETWORKMANAGER_APPLET_0_7/src/connection-editor/page-ip4.c
==============================================================================
--- branches/NETWORKMANAGER_APPLET_0_7/src/connection-editor/page-ip4.c	(original)
+++ branches/NETWORKMANAGER_APPLET_0_7/src/connection-editor/page-ip4.c	Fri Feb  6 18:16:18 2009
@@ -54,6 +54,7 @@
 typedef struct {
 	NMSettingIP4Config *setting;
 	char *connection_id;
+	gboolean vpn;
 
 	GtkComboBox *method;
 	GtkListStore *method_store;
@@ -101,7 +102,6 @@
 	NMSettingConnection *s_con;
 	const char *connection_type;
 	char *str_auto = NULL, *str_auto_only = NULL;
-	gboolean is_vpn = FALSE;
 
 	xml = CE_PAGE (self)->xml;
 
@@ -113,7 +113,7 @@
 	if (!strcmp (connection_type, NM_SETTING_VPN_SETTING_NAME)) {
 		str_auto = _("Automatic (VPN)");
 		str_auto_only = _("Automatic (VPN) addresses only");
-		is_vpn = TRUE;
+		priv->vpn = TRUE;
 	} else if (   !strcmp (connection_type, NM_SETTING_GSM_SETTING_NAME)
 	           || !strcmp (connection_type, NM_SETTING_CDMA_SETTING_NAME)) {
 		str_auto = _("Automatic (PPP)");
@@ -148,7 +148,7 @@
 	                    METHOD_COL_NUM, IP4_METHOD_MANUAL,
 	                    -1);
 
-	if (!is_vpn) {
+	if (!priv->vpn) {
 		/* Link-local is pointless for VPNs */
 		gtk_list_store_append (priv->method_store, &iter);
 		gtk_list_store_set (priv->method_store, &iter,
@@ -213,6 +213,12 @@
 		break;
 	}
 
+	/* Disable DHCP stuff for VPNs (though in the future we should support
+	 * DHCP over tap interfaces for OpenVPN and vpnc).
+	 */
+	if (priv->vpn)
+		dhcp_enabled = FALSE;
+
 	gtk_widget_set_sensitive (priv->addr_label, addr_enabled);
 	gtk_widget_set_sensitive (GTK_WIDGET (priv->addr_add), addr_enabled);
 	gtk_widget_set_sensitive (GTK_WIDGET (priv->addr_delete), addr_enabled);



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