Index: fm-properties-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-properties-window.c,v
retrieving revision 1.153
diff -u -p -r1.153 fm-properties-window.c
--- fm-properties-window.c	17 May 2002 19:58:13 -0000	1.153
+++ fm-properties-window.c	8 Jul 2002 19:22:50 -0000
@@ -102,7 +102,9 @@ struct FMPropertiesWindowDetails {
 };
 
 enum {
+#if 0
 	PERMISSIONS_CHECKBOXES_TITLE_ROW,
+#endif
 	PERMISSIONS_CHECKBOXES_OWNER_ROW,
 	PERMISSIONS_CHECKBOXES_GROUP_ROW,
 	PERMISSIONS_CHECKBOXES_OTHERS_ROW,
@@ -670,13 +672,18 @@ attach_label (GtkTable *table,
 	      gboolean right_aligned,
 	      gboolean bold,
 	      gboolean ellipsize_text,
-	      gboolean selectable)
+	      gboolean selectable,
+	      gboolean mnemonic)
 {
 	GtkWidget *label_field;
 
-	label_field = ellipsize_text
-		? eel_ellipsizing_label_new (initial_text)
-		: gtk_label_new (initial_text);	
+	if (ellipsize_text) {
+		label_field = eel_ellipsizing_label_new (initial_text);
+	} else if (mnemonic) {
+		label_field = gtk_label_new_with_mnemonic (initial_text);
+	} else {
+		label_field = gtk_label_new (initial_text);
+	}
 
 	if (selectable) {
 		gtk_label_set_selectable (GTK_LABEL (label_field), TRUE);
@@ -705,7 +712,7 @@ attach_value_label (GtkTable *table,
 	      		  int column,
 	      		  const char *initial_text)
 {
-	return attach_label (table, row, column, initial_text, FALSE, FALSE, FALSE, TRUE);
+	return attach_label (table, row, column, initial_text, FALSE, FALSE, FALSE, TRUE, FALSE);
 }
 
 static GtkLabel *
@@ -714,7 +721,7 @@ attach_ellipsizing_value_label (GtkTable
 				int column,
 				const char *initial_text)
 {
-	return attach_label (table, row, column, initial_text, FALSE, FALSE, TRUE, TRUE);
+	return attach_label (table, row, column, initial_text, FALSE, FALSE, TRUE, TRUE, FALSE);
 }
 
 static void
@@ -913,7 +920,7 @@ attach_option_menu (GtkTable *table,
 	return GTK_OPTION_MENU (option_menu);
 }		    	
 
-static void
+static GtkOptionMenu*
 attach_group_menu (GtkTable *table,
 		   int row,
 		   NautilusFile *file)
@@ -928,6 +935,7 @@ attach_group_menu (GtkTable *table,
 	g_signal_connect_object (file, "changed",
 				 G_CALLBACK (synch_groups_menu),
 				 option_menu, G_CONNECT_SWAPPED);	
+	return option_menu;
 }	
 
 static void
@@ -1254,16 +1262,21 @@ attach_title_field (GtkTable *table,
 		     int row,
 		     const char *title)
 {
-	return attach_label (table, row, TITLE_COLUMN, title, TRUE, TRUE, FALSE, FALSE);
+	return attach_label (table, row, TITLE_COLUMN, title, TRUE, TRUE, FALSE, FALSE, TRUE);
 }		      
 
 static guint
-append_title_field (GtkTable *table, const char *title)
+append_title_field (GtkTable *table, const char *title, GtkLabel **label)
 {
 	guint last_row;
+	GtkLabel *title_label;
 
 	last_row = append_row (table);
-	attach_title_field (table, last_row, title);
+	title_label = attach_title_field (table, last_row, title);
+
+	if (label) {
+		*label = title_label;
+	}
 
 	return last_row;
 }
@@ -1276,7 +1289,7 @@ append_title_value_pair (GtkTable *table
 {
 	guint last_row;
 
-	last_row = append_title_field (table, title);
+	last_row = append_title_field (table, title, NULL);
 	attach_value_field (table, last_row, VALUE_COLUMN, file, file_attribute_name); 
 
 	return last_row;
@@ -1290,7 +1303,7 @@ append_title_and_ellipsizing_value (GtkT
 {
 	guint last_row;
 
-	last_row = append_title_field (table, title);
+	last_row = append_title_field (table, title, NULL);
 	attach_ellipsizing_value_field (table, last_row, VALUE_COLUMN, file, file_attribute_name);
 
 	return last_row;
@@ -1522,6 +1535,7 @@ create_basic_page (FMPropertiesWindow *w
 	GtkWidget *button_box, *temp_button;
 	char *image_uri;
 	NautilusFile *target_file, *original_file;
+	GtkWidget *hbox, *name_label;
 
 	target_file = window->details->target_file;
 	original_file = window->details->original_file;
@@ -1534,6 +1548,16 @@ create_basic_page (FMPropertiesWindow *w
 	window->details->basic_table = table;
 	
 	/* Icon pixmap */
+	hbox = gtk_hbox_new (FALSE, 4);
+	gtk_widget_show (hbox);
+	gtk_table_attach (table,
+			  hbox,
+			  TITLE_COLUMN, 
+			  TITLE_COLUMN + 1,
+			  0, 1,
+			  0, 0,
+			  0, 0);
+
 	icon_pixmap_widget = create_image_widget_for_file (original_file);
 	gtk_widget_show (icon_pixmap_widget);
 	
@@ -1541,13 +1565,13 @@ create_basic_page (FMPropertiesWindow *w
 	gtk_widget_show (icon_aligner);
 
 	gtk_container_add (GTK_CONTAINER (icon_aligner), icon_pixmap_widget);
-	gtk_table_attach (table,
-			  icon_aligner,
-			  TITLE_COLUMN, 
-			  TITLE_COLUMN + 1,
-			  0, 1,
-			  0, 0,
-			  0, 0);
+	gtk_box_pack_start (GTK_BOX (hbox), icon_aligner, TRUE, TRUE, 0);
+
+	/* Name label */
+	name_label = gtk_label_new_with_mnemonic (_("_Name"));
+	eel_gtk_label_make_bold (GTK_LABEL (name_label));
+	gtk_widget_show (name_label);
+	gtk_box_pack_end (GTK_BOX (hbox), name_label, FALSE, FALSE, 0);
 
 	/* Name field */
 	name_field = nautilus_entry_new ();
@@ -1560,7 +1584,8 @@ create_basic_page (FMPropertiesWindow *w
 			  0, 1,
 			  GTK_FILL, 0,
 			  0, 0);
-				   
+	gtk_label_set_mnemonic_widget (GTK_LABEL (name_label), name_field);
+
 	/* Attach parameters and signal handler. */
 	nautilus_file_ref (original_file);
 	g_object_set_data_full (G_OBJECT (name_field),"nautilus_file",
@@ -1610,14 +1635,14 @@ create_basic_page (FMPropertiesWindow *w
 	}
 	append_title_and_ellipsizing_value (table, _("Location:"), target_file, "where");
 	if (should_show_link_target (window)) {
-		append_title_and_ellipsizing_value (table, _("Link Target:"), target_file, "link_target");
+		append_title_and_ellipsizing_value (table, _("Link target:"), target_file, "link_target");
 	}
 	if (should_show_mime_type (window)) {
-		append_title_value_pair (table, _("MIME Type:"), target_file, "mime_type");
+		append_title_value_pair (table, _("MIME type:"), target_file, "mime_type");
 	}				  
 	
 	/* Blank title ensures standard row height */
-	append_title_field (table, "");
+	append_title_field (table, "", NULL);
 	
 	append_title_value_pair (table, _("Modified:"), target_file, "date_modified");
 
@@ -1729,6 +1754,7 @@ create_emblems_page (FMPropertiesWindow 
 	gtk_widget_show_all (emblems_table);
 }
 
+#if 0
 static void
 add_permissions_column_label (GtkTable *table, 
 			      NautilusFile *file,
@@ -1750,6 +1776,7 @@ add_permissions_column_label (GtkTable *
 			  	   PERMISSIONS_CHECKBOXES_TITLE_ROW, 
 			  	   PERMISSIONS_CHECKBOXES_TITLE_ROW + 1);
 }	
+#endif
 
 static void
 update_permissions_check_button_state (GtkWidget *check_button, NautilusFile *file)
@@ -1857,8 +1884,17 @@ add_permissions_checkbox (GtkTable *tabl
 			  GnomeVFSFilePermissions permission_to_check)
 {
 	GtkWidget *check_button;
+	gchar *label;
+
+	if (column == PERMISSIONS_CHECKBOXES_READ_COLUMN) {
+		label = _("_Read");
+	} else if (column == PERMISSIONS_CHECKBOXES_WRITE_COLUMN) {
+		label = _("_Write");
+	} else {
+		label = _("E_xecute");
+	}
 
-	check_button = gtk_check_button_new ();
+	check_button = gtk_check_button_new_with_mnemonic (label);
 	gtk_widget_show (check_button);
 	gtk_table_attach (table, check_button,
 			  column, column + 1,
@@ -1880,7 +1916,7 @@ append_special_execution_checkbox (FMPro
 
 	last_row = append_row (table);
 
-	check_button = gtk_check_button_new_with_label (label_text);
+	check_button = gtk_check_button_new_with_mnemonic (label_text);
 	gtk_widget_show (check_button);
 
 	gtk_table_attach (table, check_button,
@@ -1927,17 +1963,17 @@ append_special_execution_flags (FMProper
 				GtkTable *table)
 {
 	remember_special_flags_widget (window, append_special_execution_checkbox 
-		(window, table, _("Set User ID"), GNOME_VFS_PERM_SUID));
+		(window, table, _("Set _user ID"), GNOME_VFS_PERM_SUID));
 
 	window->details->first_special_flags_row = table->nrows - 1;
 
 	remember_special_flags_widget (window, GTK_WIDGET (attach_title_field 
-		(table, table->nrows - 1, _("Special Flags:"))));
+		(table, table->nrows - 1, _("Special flags:"))));
 
 	remember_special_flags_widget (window, append_special_execution_checkbox 
-		(window, table, _("Set Group ID"), GNOME_VFS_PERM_SGID));
+		(window, table, _("Set gro_up ID"), GNOME_VFS_PERM_SGID));
 	remember_special_flags_widget (window, append_special_execution_checkbox 
-		(window, table, _("Sticky"), GNOME_VFS_PERM_STICKY));
+		(window, table, _("_Sticky"), GNOME_VFS_PERM_STICKY));
 
 	remember_special_flags_widget (window, append_separator (table));
 	++window->details->num_special_flags_rows;
@@ -1960,6 +1996,8 @@ create_permissions_page (FMPropertiesWin
 	NautilusFile *file;
 	guint last_row;
 	guint checkbox_titles_row;
+	GtkLabel *group_label;
+	GtkOptionMenu *group_menu;
 
 	file = window->details->target_file;
 
@@ -1982,7 +2020,7 @@ create_permissions_page (FMPropertiesWin
 				    GTK_WIDGET (page_table), 
 				    TRUE, TRUE, 0);
 
-		attach_title_field (page_table, last_row, _("File Owner:"));
+		attach_title_field (page_table, last_row, _("File owner:"));
 		if (nautilus_file_can_set_owner (file)) {
 			/* Option menu in this case. */
 			attach_owner_menu (page_table, last_row, file);
@@ -1991,11 +2029,19 @@ create_permissions_page (FMPropertiesWin
 			attach_value_field (page_table, last_row, VALUE_COLUMN, file, "owner"); 
 		}
 
-		last_row = append_title_field (page_table, _("File Group:"));
 		if (nautilus_file_can_set_group (file)) {
+			last_row = append_title_field (page_table,
+						       _("_File group:"),
+						       &group_label);
 			/* Option menu in this case. */
-			attach_group_menu (page_table, last_row, file);
+			group_menu = attach_group_menu (page_table, last_row,
+							file);
+			gtk_label_set_mnemonic_widget (GTK_LABEL (group_label),
+						       GTK_WIDGET (group_menu));
 		} else {
+			last_row = append_title_field (page_table,
+						       _("File group:"),
+						       NULL);
 			/* Static text in this case. */
 			attach_value_field (page_table, last_row, VALUE_COLUMN, file, "group"); 
 		}
@@ -2007,11 +2053,13 @@ create_permissions_page (FMPropertiesWin
 		 * the checkboxes sub-table so the other row titles will
 		 * line up horizontally with the checkbox rows.
 		 */
-		checkbox_titles_row = append_title_field (page_table, "");
-
-		append_title_field (page_table, _("Owner:"));
-		append_title_field (page_table, _("Group:"));
-		append_title_field (page_table, _("Others:"));
+#if 0
+		checkbox_titles_row = append_title_field (page_table, "",
+							  NULL);
+#endif
+		checkbox_titles_row = append_title_field (page_table, _("Owner:"), NULL);
+		append_title_field (page_table, _("Group:"), NULL);
+		append_title_field (page_table, _("Others:"), NULL);
 		
 		/* Make separate table for grid of checkboxes so it can be
 		 * homogeneous; we don't want overall table to be homogeneous though.
@@ -2028,6 +2076,12 @@ create_permissions_page (FMPropertiesWin
 				  0, 0,
 				  0, 0);
 
+#if 0
+		/* I've taken this title row out, since we currently add
+		   "Read"/"Write"/"Execute" labels for each checkbox so that
+		   keyboard navigation works OK. If a checkbox doesn't have
+		   a label keyboard navigation doesn't work well since it
+		   doesn't display a focus indicator. */
 		add_permissions_column_label (check_button_table, file,
 					      PERMISSIONS_CHECKBOXES_READ_COLUMN,
 					      _("Read"));
@@ -2039,6 +2093,7 @@ create_permissions_page (FMPropertiesWin
 		add_permissions_column_label (check_button_table, file,
 					      PERMISSIONS_CHECKBOXES_EXECUTE_COLUMN,
 					      _("Execute"));
+#endif
 
 		add_permissions_checkbox (check_button_table, file, 
 					  PERMISSIONS_CHECKBOXES_OWNER_ROW,
@@ -2089,9 +2144,9 @@ create_permissions_page (FMPropertiesWin
 
 		append_special_execution_flags (window, page_table);
 
-		append_title_value_pair (page_table, _("Text View:"), file, "permissions");		
-		append_title_value_pair (page_table, _("Number View:"), file, "octal_permissions");
-		append_title_value_pair (page_table, _("Last Changed:"), file, "date_permissions");
+		append_title_value_pair (page_table, _("Text view:"), file, "permissions");		
+		append_title_value_pair (page_table, _("Number view:"), file, "octal_permissions");
+		append_title_value_pair (page_table, _("Last changed:"), file, "date_permissions");
 		
 	} else {
 		file_name = nautilus_file_get_display_name (file);
