[network-manager-applet/danw/vlan: 4/5] connection-editor: change some slave handling to be bond-slave specific



commit c7d201bff10e67f2ae036514de84e0060d758698
Author: Dan Winship <danw gnome org>
Date:   Wed Sep 26 12:49:16 2012 -0400

    connection-editor: change some slave handling to be bond-slave specific
    
    VLAN slaves should be shown in the connection list, and should have
    IPv4 and IPv6 pages; it's only bond slaves that should be
    hidden/IP-less.

 src/connection-editor/nm-connection-editor.c |    4 +++-
 src/connection-editor/nm-connection-list.c   |    8 +++++---
 2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/connection-editor/nm-connection-editor.c b/src/connection-editor/nm-connection-editor.c
index 1c4325f..802b41c 100644
--- a/src/connection-editor/nm-connection-editor.c
+++ b/src/connection-editor/nm-connection-editor.c
@@ -799,6 +799,7 @@ nm_connection_editor_set_connection (NMConnectionEditor *editor,
 {
 	NMSettingConnection *s_con;
 	const char *connection_type;
+	const char *slave_type;
 	gboolean success = FALSE;
 	GSList *iter, *copy;
 	gboolean add_ip4 = TRUE, add_ip6 = TRUE;
@@ -861,7 +862,8 @@ nm_connection_editor_set_connection (NMConnectionEditor *editor,
 		g_warning ("Unhandled setting type '%s'", connection_type);
 	}
 
-	if (nm_setting_connection_get_master (s_con))
+	slave_type = nm_setting_connection_get_slave_type (s_con);
+	if (!g_strcmp0 (slave_type, NM_SETTING_BOND_SETTING_NAME))
 		add_ip4 = add_ip6 = FALSE;
 
 	if (add_ip4 && !add_page (editor, ce_page_ip4_new, editor->connection, error))
diff --git a/src/connection-editor/nm-connection-list.c b/src/connection-editor/nm-connection-list.c
index 84f15bd..2a7b708 100644
--- a/src/connection-editor/nm-connection-list.c
+++ b/src/connection-editor/nm-connection-list.c
@@ -562,6 +562,7 @@ tree_model_visible_func (GtkTreeModel *model,
 	NMConnection *connection;
 	NMSettingConnection *s_con;
 	const char *master;
+	const char *slave_type;
 
 	gtk_tree_model_get (model, iter, COL_CONNECTION, &connection, -1);
 	if (!connection) {
@@ -569,15 +570,16 @@ tree_model_visible_func (GtkTreeModel *model,
 		return gtk_tree_model_iter_has_child  (model, iter);
 	}
 
-	/* A connection node is visible unless it is a slave to another
-	 * known connection.
+	/* A connection node is visible unless it is a bond slave to
+	 * another known connection.
 	 */
 	s_con = nm_connection_get_setting_connection (connection);
 	g_object_unref (connection);
 	g_return_val_if_fail (s_con != NULL, FALSE);
 
 	master = nm_setting_connection_get_master (s_con);
-	if (!master)
+	slave_type = nm_setting_connection_get_slave_type (s_con);
+	if (!master || g_strcmp0 (slave_type, NM_SETTING_BOND_SETTING_NAME) != 0)
 		return TRUE;
 
 	if (nm_remote_settings_get_connection_by_uuid (self->settings, master))



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