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



Author: dcbw
Date: Mon Oct 27 15:04:38 2008
New Revision: 981
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=981&view=rev

Log:
2008-10-26  Dan Williams  <dcbw redhat com>

	Patch from Jaap A. Haitsma <jaap haitsma org>

	* src/connection-editor/nm-connection-editor.c
	  src/connection-editor/nm-connection-list.c
		- Make default window icons actually work (bgo #553170)



Modified:
   trunk/ChangeLog
   trunk/src/connection-editor/nm-connection-editor.c
   trunk/src/connection-editor/nm-connection-list.c

Modified: trunk/src/connection-editor/nm-connection-editor.c
==============================================================================
--- trunk/src/connection-editor/nm-connection-editor.c	(original)
+++ trunk/src/connection-editor/nm-connection-editor.c	Mon Oct 27 15:04:38 2008
@@ -167,6 +167,7 @@
 system_checkbutton_toggled_cb (GtkWidget *widget, NMConnectionEditor *editor)
 {
 	gboolean req_privs = FALSE;
+	NMSettingConnection *s_con;
 
 	/* If the connection was originally a system connection, obviously
 	 * privileges are required to change it.  If it was originally a user
@@ -185,6 +186,11 @@
 	else
 		g_object_set (editor->system_gnome_action, "polkit-action", NULL, NULL);
 
+	/* Can't ever modify read-only connections */
+	s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (editor->connection, NM_TYPE_SETTING_CONNECTION));
+	if (nm_setting_connection_get_read_only (s_con))
+		gtk_widget_set_sensitive (editor->ok_button, FALSE);
+
 	connection_editor_validate (editor);
 }
 
@@ -220,8 +226,16 @@
 static void
 update_sensitivity (NMConnectionEditor *editor, PolKitResult pk_result)
 {
+	NMSettingConnection *s_con;
 	gboolean denied = FALSE;
 
+	s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (editor->connection, NM_TYPE_SETTING_CONNECTION));
+	/* Can't ever modify read-only connections */
+	if (nm_setting_connection_get_read_only (s_con)) {
+		set_editor_sensitivity (editor, FALSE);
+		return;
+	}
+
 	if (pk_result == POLKIT_RESULT_UNKNOWN)
 		pk_result = polkit_gnome_action_get_polkit_result (editor->system_gnome_action);
 
@@ -290,9 +304,6 @@
 
 	editor->window = glade_xml_get_widget (editor->xml, "nm-connection-editor");
 	editor->cancel_button = glade_xml_get_widget (editor->xml, "cancel_button");
-
-	gtk_window_set_default_icon_name ("preferences-system-network");
-
 	editor->system_checkbutton = glade_xml_get_widget (editor->xml, "system_checkbutton");
 
 	editor->system_action = polkit_action_new ();

Modified: trunk/src/connection-editor/nm-connection-list.c
==============================================================================
--- trunk/src/connection-editor/nm-connection-list.c	(original)
+++ trunk/src/connection-editor/nm-connection-list.c	Mon Oct 27 15:04:38 2008
@@ -1626,6 +1626,8 @@
 		goto error;
 	}
 
+	gtk_window_set_default_icon_name ("preferences-system-network");
+
 	list->icon_theme = gtk_icon_theme_get_for_screen (gdk_screen_get_default ());
 
 	/* Load icons */



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