[network-manager-applet] editor: don't enable "IP Required" checkbutton when IP method is disabled



commit a2113fe42c19ab7ea3cc7ff06f37a9acc4f68f63
Author: Dan Williams <dcbw redhat com>
Date:   Mon May 3 01:00:57 2010 -0700

    editor: don't enable "IP Required" checkbutton when IP method is disabled

 src/connection-editor/page-ip4.c |    5 ++++-
 src/connection-editor/page-ip6.c |    6 ++++++
 2 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/connection-editor/page-ip4.c b/src/connection-editor/page-ip4.c
index 1827a15..d1b449a 100644
--- a/src/connection-editor/page-ip4.c
+++ b/src/connection-editor/page-ip4.c
@@ -236,6 +236,7 @@ method_changed (GtkComboBox *combo, gpointer user_data)
 	gboolean dns_enabled = FALSE;
 	gboolean dhcp_enabled = FALSE;
 	gboolean routes_enabled = FALSE;
+	gboolean ip4_required_enabled = TRUE;
 	GtkTreeIter iter;
 
 	if (gtk_combo_box_get_active_iter (priv->method, &iter)) {
@@ -256,7 +257,7 @@ method_changed (GtkComboBox *combo, gpointer user_data)
 		addr_enabled = dns_enabled = routes_enabled = TRUE;
 		break;
 	case IP4_METHOD_DISABLED:
-		addr_enabled = dns_enabled = dhcp_enabled = routes_enabled = FALSE;
+		addr_enabled = dns_enabled = dhcp_enabled = routes_enabled = ip4_required_enabled = FALSE;
 	default:
 		break;
 	}
@@ -296,6 +297,8 @@ method_changed (GtkComboBox *combo, gpointer user_data)
 	if (!dhcp_enabled)
 		gtk_entry_set_text (priv->dhcp_client_id, "");
 
+	gtk_widget_set_sensitive (GTK_WIDGET (priv->ip4_required), ip4_required_enabled);
+
 	gtk_widget_set_sensitive (GTK_WIDGET (priv->routes_button), routes_enabled);
 
 	ce_page_changed (CE_PAGE (user_data));
diff --git a/src/connection-editor/page-ip6.c b/src/connection-editor/page-ip6.c
index fb5cc7f..ffb3131 100644
--- a/src/connection-editor/page-ip6.c
+++ b/src/connection-editor/page-ip6.c
@@ -239,6 +239,7 @@ method_changed (GtkComboBox *combo, gpointer user_data)
 	gboolean addr_enabled = FALSE;
 	gboolean dns_enabled = FALSE;
 	gboolean routes_enabled = FALSE;
+	gboolean ip6_required_enabled = TRUE;
 	GtkTreeIter iter;
 
 	if (gtk_combo_box_get_active_iter (priv->method, &iter)) {
@@ -262,6 +263,9 @@ method_changed (GtkComboBox *combo, gpointer user_data)
 	case IP6_METHOD_MANUAL:
 		addr_enabled = dns_enabled = routes_enabled = TRUE;
 		break;
+	case IP6_METHOD_IGNORE:
+		ip6_required_enabled = FALSE;
+		break;
 	default:
 		break;
 	}
@@ -287,6 +291,8 @@ method_changed (GtkComboBox *combo, gpointer user_data)
 	if (!dns_enabled)
 		gtk_entry_set_text (priv->dns_searches, "");
 
+	gtk_widget_set_sensitive (GTK_WIDGET (priv->ip6_required), ip6_required_enabled);
+
 	gtk_widget_set_sensitive (GTK_WIDGET (priv->routes_button), routes_enabled);
 
 	ce_page_changed (CE_PAGE (user_data));



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