Re: Another patch to improve nautilus accessibility



Martin Wehner wrote:
On Tue, 2006-10-31 at 11:08 +0000, Padraig O'Briain wrote:
This is a request for permission for the attached patch to be applied to nautilus to improve accessibility of File management Preferences dialog. See http://bugzilla.gnome.org/show_bug.cgi?id=356124

The targets of the "label-for" relations don't match the ids of the
labelled widgets (combo_box vs. combobox). Is this on purpose?

Martin


Corrected patch attached.

Padraig
--- fm-properties-window.c.orig	2006-10-05 15:41:26.000000000 +0100
+++ fm-properties-window.c	2006-10-18 15:22:10.968640000 +0100
@@ -1701,7 +1701,7 @@
 	return attach_label (table, row, column, initial_text, FALSE, FALSE, TRUE, TRUE, FALSE);
 }
 
-static void
+static GtkWidget*
 attach_value_field_internal (FMPropertiesWindow *window,
 			     GtkTable *table,
 			     int row,
@@ -1731,9 +1731,10 @@
 
 	window->details->value_fields = g_list_prepend (window->details->value_fields,
 							value_field);
+	return GTK_WIDGET(value_field);
 }			     
 
-static void
+static GtkWidget*
 attach_value_field (FMPropertiesWindow *window,
 		    GtkTable *table,
 		    int row,
@@ -1742,7 +1743,7 @@
 		    const char *inconsistent_string,
 		    gboolean show_original)
 {
-	attach_value_field_internal (window, 
+	return attach_value_field_internal (window, 
 				     table, row, column, 
 				     file_attribute_name, 
 				     inconsistent_string,
@@ -1750,7 +1751,7 @@
 				     FALSE);
 }
 
-static void
+static GtkWidget*
 attach_ellipsizing_value_field (FMPropertiesWindow *window,
 				GtkTable *table,
 		    	  	int row,
@@ -1759,7 +1760,7 @@
 				const char *inconsistent_string,
 				gboolean show_original)
 {
-	attach_value_field_internal (window,
+	return attach_value_field_internal (window,
 				     table, row, column, 
 				     file_attribute_name, 
 				     inconsistent_string, 
@@ -2687,13 +2688,15 @@
 			 gboolean show_original)
 {
 	guint last_row;
+	GtkLabel *title_label;
+	GtkWidget *value;
 
-	last_row = append_title_field (table, title, NULL);
-	attach_value_field (window, table, last_row, VALUE_COLUMN, 
+	last_row = append_title_field (table, title, &title_label);
+	value = attach_value_field (window, table, last_row, VALUE_COLUMN, 
 			    file_attribute_name,
 			    inconsistent_state,
 			    show_original); 
-
+	gtk_label_set_mnemonic_widget (title_label, value);
 	return last_row;
 }
 
@@ -2705,13 +2708,16 @@
 				    const char *inconsistent_state,
 				    gboolean show_original)
 {
+	GtkLabel *title_label;
+	GtkWidget *value;
 	guint last_row;
 
-	last_row = append_title_field (table, title, NULL);
-	attach_ellipsizing_value_field (window, table, last_row, VALUE_COLUMN, 
+	last_row = append_title_field (table, title, &title_label);
+	value = attach_ellipsizing_value_field (window, table, last_row, VALUE_COLUMN, 
 					file_attribute_name,
 					inconsistent_state,
 					show_original);
+	gtk_label_set_mnemonic_widget (title_label, value);
 
 	return last_row;
 }
@@ -2732,6 +2738,7 @@
 	value_field = attach_directory_contents_value_field 
 		(window, table, last_row);
 
+	gtk_label_set_mnemonic_widget(title_field, GTK_WIDGET(value_field));
 	return last_row;
 }
 
@@ -3468,6 +3475,7 @@
 	GtkWidget *check_button;
 	gboolean a11y_enabled;
 	
+	
 	check_button = gtk_check_button_new_with_mnemonic (label);
 	gtk_widget_show (check_button);
 	gtk_table_attach (table, check_button,
@@ -3820,17 +3828,18 @@
 			   gboolean short_label)
 {
 	GtkWidget *combo;
+	GtkLabel *label;
 	GtkListStore *store;
 	GtkCellRenderer *cell;
 	GtkTreeIter iter;
 	int row;
 
 	if (short_label) {
-		row = append_title_field (table, _("Access:"), NULL);
+		row = append_title_field (table, _("Access:"), &label);
 	} else if (is_folder) {
-		row = append_title_field (table, _("Folder Access:"), NULL);
+		row = append_title_field (table, _("Folder Access:"), &label);
 	} else {
-		row = append_title_field (table, _("File Access:"), NULL);
+		row = append_title_field (table, _("File Access:"), &label);
 	}
 	
 	store = gtk_list_store_new (3, G_TYPE_STRING, G_TYPE_INT, G_TYPE_BOOLEAN);
@@ -3878,6 +3887,7 @@
 					"text", 0,
 					NULL);
 	
+	gtk_label_set_mnemonic_widget (label, combo);
 	gtk_widget_show (combo);
 	
 	gtk_table_attach (table, combo,
@@ -3921,6 +3931,7 @@
 static void
 append_special_execution_flags (FMPropertiesWindow *window, GtkTable *table)
 {
+	GtkLabel *title;
 	append_special_execution_checkbox 
 		(window, table, _("Set _user ID"), GNOME_VFS_PERM_SUID);
 
@@ -4017,6 +4028,8 @@
 	gboolean has_file, has_directory;
 	GtkLabel *group_label;
 	GtkLabel *owner_label;
+	GtkLabel *execute_label;
+	GtkWidget *value;
 	GtkComboBox *group_combo_box;
 	GtkComboBox *owner_combo_box;
 	guint last_row;
@@ -4033,13 +4046,14 @@
 		gtk_label_set_mnemonic_widget (owner_label,
 					       GTK_WIDGET (owner_combo_box));
 	} else {
-		attach_title_field (page_table, last_row, _("Owner:"));
+		owner_label = attach_title_field (page_table, last_row, _("Owner:"));
 		/* Static text in this case. */
-		attach_value_field (window, 
+		value = attach_value_field (window, 
 				    page_table, last_row, VALUE_COLUMN,
 				    "owner",
 				    _("--"),
 				    FALSE); 
+		gtk_label_set_mnemonic_widget (owner_label, value);
 	}
 	
 	if (has_directory) {
@@ -4065,13 +4079,14 @@
 	} else {
 		last_row = append_title_field (page_table,
 					       _("Group:"),
-					       NULL);
+					       &group_label);
 		/* Static text in this case. */
-		attach_value_field (window, page_table, last_row, 
+		value = attach_value_field (window, page_table, last_row, 
 				    VALUE_COLUMN, 
 				    "group",
 				    _("--"),
 				    FALSE); 
+		gtk_label_set_mnemonic_widget (group_label, value);
 	}
 	
 	if (has_directory) {
@@ -4106,12 +4121,12 @@
 	
 	last_row = append_title_field (page_table,
 				       _("Execute:"),
-				       NULL);
+				       &execute_label);
 	add_permissions_checkbox_with_label (window, page_table,
 					     last_row, 1,
 					     _("Allow _executing file as program"),
 					     GNOME_VFS_PERM_USER_EXEC|GNOME_VFS_PERM_GROUP_EXEC|GNOME_VFS_PERM_OTHER_EXEC,
-					     NULL, FALSE);
+					     execute_label, FALSE);
 	
 }
 
@@ -4237,13 +4252,16 @@
 		gtk_label_set_mnemonic_widget (owner_label,
 					       GTK_WIDGET (owner_combo_box));
 	} else {
-		attach_title_field (page_table, last_row, _("Owner:"));
+		GtkWidget *value;
+
+		owner_label = attach_title_field (page_table, last_row, _("Owner:"));
 		/* Static text in this case. */
-		attach_value_field (window, 
+		value = attach_value_field (window, 
 				    page_table, last_row, VALUE_COLUMN,
 				    "owner",
 				    _("--"),
 				    FALSE); 
+		gtk_label_set_mnemonic_widget (owner_label, value);
 	}
 	
 	if (!is_multi_file_window (window) && nautilus_file_can_set_group (get_target_file (window))) {


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