[Nautilus-list] news sidebar keynav patch



This patch adds some mnemonics to widgets in the news sidebar.  

-dave


Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/nautilus/ChangeLog,v
retrieving revision 1.5137
diff -u -r1.5137 ChangeLog
--- ChangeLog	14 Mar 2002 12:25:12 -0000	1.5137
+++ ChangeLog	14 Mar 2002 20:36:59 -0000
@@ -1,3 +1,11 @@
+2002-03-14  Dave Camp  <dave ximian com>
+
+	* components/news/nautilus-news.c: (add_command_buttons),
+	(news_label_new), (make_remove_widgets), (make_add_widgets),
+	(set_up_edit_widgets), (site_list_mnemonic_activate),
+	(set_up_configure_widgets), (set_up_main_widgets): Add mnemonics
+	to various controls and labels.
+
 2002-03-11  Michael Meeks  <michael ximian com>
 
 	* libnautilus-private/nautilus-bonobo-extensions.c
Index: components/news/nautilus-news.c
===================================================================
RCS file: /cvs/gnome/nautilus/components/news/nautilus-news.c,v
retrieving revision 1.60
diff -u -r1.60 nautilus-news.c
--- components/news/nautilus-news.c	7 Mar 2002 19:35:47 -0000	1.60
+++ components/news/nautilus-news.c	14 Mar 2002 20:37:01 -0000
@@ -1845,6 +1845,8 @@
         }
 }
 
+
+
 /* utility routine to create the button box and constituent buttons */
 static GtkWidget *
 add_command_buttons (News *news_data, const char* label, gboolean from_configure)
@@ -1867,7 +1869,7 @@
 	gtk_box_set_spacing (GTK_BOX (button_box), 4);
 	
 	if (from_configure) {
-		button = gtk_button_new_with_label (_("Edit"));
+		button = gtk_button_new_with_mnemonic (_("Edi_t"));
                 gtk_widget_show (button);
 		gtk_container_add (GTK_CONTAINER (button_box), button);
 
@@ -2099,7 +2101,7 @@
 {
 	GtkWidget *label;
 	
-	label = gtk_label_new (label_text);
+	label = gtk_label_new_with_mnemonic (label_text);
 	if (title_mode) {
 		eel_gtk_label_make_bold (GTK_LABEL (label));
 	}
@@ -2165,7 +2167,7 @@
 	gtk_button_box_set_layout (GTK_BUTTON_BOX (button_box), GTK_BUTTONBOX_END);
 	gtk_box_set_spacing (GTK_BOX (button_box), 4);
 	
-	news->remove_button = gtk_button_new_with_label (_("Remove Site"));
+	news->remove_button = gtk_button_new_with_mnemonic (_("_Remove Site"));
         gtk_widget_show (news->remove_button);
         
 	gtk_container_add (GTK_CONTAINER (button_box), news->remove_button);
@@ -2191,11 +2193,14 @@
 	gtk_box_pack_start (GTK_BOX (container), temp_vbox, FALSE, FALSE, 0);
 
 	/* allocate the name field */
-	label = news_label_new (_("Site Name:"), FALSE);
+	label = news_label_new (_("Site _Name:"), FALSE);
         gtk_widget_show (label);
 	gtk_box_pack_start (GTK_BOX (temp_vbox), label, FALSE, FALSE, 0);
 
 	news->item_name_field = nautilus_entry_new ();
+        gtk_label_set_mnemonic_widget (GTK_LABEL (label), 
+                                       news->item_name_field);
+        
 	gtk_widget_show (news->item_name_field);
 	gtk_box_pack_start (GTK_BOX (temp_vbox), news->item_name_field, FALSE, FALSE, 0);
 	nautilus_undo_editable_set_undo_key (GTK_EDITABLE (news->item_name_field), TRUE);
@@ -2206,15 +2211,17 @@
         
 	gtk_box_pack_start (GTK_BOX (container), temp_vbox, FALSE, FALSE, 0);
 
-	label = news_label_new (_("Site RSS URL:"), FALSE);
+	label = news_label_new (_("Site _RSS URL:"), FALSE);
         gtk_widget_show (label);
 	gtk_box_pack_start (GTK_BOX (temp_vbox), label, FALSE, FALSE, 0);
 
 	news->item_location_field = nautilus_entry_new ();
+        gtk_label_set_mnemonic_widget (GTK_LABEL (label), 
+                                       news->item_location_field);
         gtk_widget_show (news->item_location_field);
 	gtk_box_pack_start (GTK_BOX (temp_vbox), news->item_location_field, FALSE, FALSE, 0);
 	nautilus_undo_editable_set_undo_key (GTK_EDITABLE (news->item_location_field), TRUE);
-
+        
 	/* install the add buttons */
     	button_box = gtk_hbutton_box_new ();
         gtk_widget_show (button_box);
@@ -2224,7 +2231,7 @@
 	gtk_button_box_set_layout (GTK_BUTTON_BOX (button_box), GTK_BUTTONBOX_END);
 	gtk_box_set_spacing (GTK_BOX (button_box), 4);
 	
-	button = gtk_button_new_with_label (_("Add New Site"));
+	button = gtk_button_new_with_mnemonic (_("_Add New Site"));
         gtk_widget_show (button);
 
 	gtk_container_add (GTK_CONTAINER (button_box), button);
@@ -2265,7 +2272,7 @@
 	/* allocate the remove label */
 	temp_vbox = gtk_vbox_new (FALSE, 0);
 
-	label = news_label_new (_("Remove a Site:"), TRUE);
+	label = news_label_new (_("Remove a _Site:"), TRUE);
         gtk_widget_show (label);
         
 	gtk_box_pack_start (GTK_BOX (temp_vbox), label, FALSE, FALSE, 0);
@@ -2273,6 +2280,9 @@
         
 	/* allocate the remove widgets */
 	make_remove_widgets (news, temp_vbox);
+        gtk_label_set_mnemonic_widget (GTK_LABEL (label), 
+                                       news->remove_site_list);
+        
 	gtk_box_pack_start (GTK_BOX (expand_box), temp_vbox, TRUE, TRUE, 0);
 	
 	/* add the button box at the bottom with a cancel button */
@@ -2281,6 +2291,21 @@
 	gtk_box_pack_start (GTK_BOX (news->edit_site_box), button_box, FALSE, FALSE, 0);	
 }
 
+static gboolean
+site_list_mnemonic_activate (GtkWidget *widget, gboolean group_cycling,
+                             gpointer data)
+{
+        News *news;
+        RSSChannelData *channel_data;
+        
+        news = (News*)data;
+        channel_data = (RSSChannelData*)news->channel_list->data;
+        
+        gtk_widget_grab_focus (channel_data->checkbox);
+
+        return TRUE;
+}
+
 /* allocate the widgets for the configure mode */
 static void
 set_up_configure_widgets (News *news, GtkWidget *container)
@@ -2297,13 +2322,20 @@
                                   news->configure_box, NULL, PAGE_CONFIGURE);
 
 	/* add a descriptive label */
-	label = news_label_new (_("Select Sites:"), TRUE);
+	label = news_label_new (_("_Select Sites:"), TRUE);
+
         gtk_widget_show (label);
         
 	gtk_box_pack_start (GTK_BOX (news->configure_box), label, FALSE, FALSE, 0);
 	
 	/* allocate a table to hold the check boxes */
 	news->checkbox_list = gtk_vbox_new (FALSE, 0);
+        g_signal_connect (GTK_WIDGET (news->checkbox_list), 
+                          "mnemonic_activate", 
+                          G_CALLBACK (site_list_mnemonic_activate), news);
+
+        gtk_label_set_mnemonic_widget (GTK_LABEL (label), news->checkbox_list);
+
         gtk_widget_show (news->checkbox_list);
         
 	scrolled_window = GTK_SCROLLED_WINDOW (gtk_scrolled_window_new (NULL, NULL));
@@ -2320,7 +2352,7 @@
  	gtk_box_pack_start (GTK_BOX (news->configure_box), GTK_WIDGET (scrolled_window), TRUE, TRUE, 0);
 		
 	/* allocate the button box for the done button */
-        button_box = add_command_buttons (news, _("Done"), TRUE);
+        button_box = add_command_buttons (news, _("_Done"), TRUE);
         gtk_widget_show (button_box);
 	gtk_box_pack_start (GTK_BOX (news->configure_box), button_box, FALSE, FALSE, 0); 
 }
@@ -2412,7 +2444,7 @@
                           G_CALLBACK (nautilus_news_button_release_event), news);
 
         /* create a button box to hold the command buttons */
-        button_box = add_command_buttons (news, _("Select Sites"), FALSE);
+        button_box = add_command_buttons (news, _("_Select Sites"), FALSE);
         gtk_widget_show (button_box);
         gtk_box_pack_start (GTK_BOX (news->main_box), button_box, FALSE, FALSE, 0); 
 }


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