changeset 15294:e5c75076c6d1

[gaim-migrate @ 18085] GTK+ adds an accelerator key for buttons on it's own, but it's better if we specify one ourselves (even if it's the same as the one that GTK+ uses) so that translators know that they should add the _ to the string in their translations if there are two buttons that start with the same letter. Is my reasoning sound? committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 08 Jan 2007 04:04:16 +0000
parents 4bcc40bd4e20
children 7d6bd7a4994f
files libgaim/protocols/oscar/oscar.c libgaim/request.h
diffstat 2 files changed, 27 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/libgaim/protocols/oscar/oscar.c	Mon Jan 08 00:08:10 2007 +0000
+++ b/libgaim/protocols/oscar/oscar.c	Mon Jan 08 04:04:16 2007 +0000
@@ -1428,8 +1428,8 @@
 	gaim_request_input(gc, NULL, _("Enter SecurID"), primary,
 					   _("Enter the 6 digit number from the digital display."),
 					   FALSE, FALSE, NULL,
-					   _("OK"), G_CALLBACK(gaim_parse_auth_securid_request_yes_cb),
-					   _("Cancel"), G_CALLBACK(gaim_parse_auth_securid_request_no_cb),
+					   _("_OK"), G_CALLBACK(gaim_parse_auth_securid_request_yes_cb),
+					   _("_Cancel"), G_CALLBACK(gaim_parse_auth_securid_request_no_cb),
 					   gc);
 	g_free(primary);
 
@@ -2230,8 +2230,8 @@
 
 	gaim_request_input(data->gc, NULL, _("Authorization Request Message:"),
 					   NULL, _("Please authorize me!"), TRUE, FALSE, NULL,
-					   _("OK"), G_CALLBACK(gaim_auth_request),
-					   _("Cancel"), G_CALLBACK(gaim_auth_dontrequest),
+					   _("_OK"), G_CALLBACK(gaim_auth_request),
+					   _("_Cancel"), G_CALLBACK(gaim_auth_dontrequest),
 					   data);
 }
 
@@ -2276,8 +2276,8 @@
 {
 	gaim_request_input(data->gc, NULL, _("Authorization Denied Message:"),
 					   NULL, _("No reason given."), TRUE, FALSE, NULL,
-					   _("OK"), G_CALLBACK(gaim_auth_dontgrant),
-					   _("Cancel"), G_CALLBACK(oscar_free_name_data),
+					   _("_OK"), G_CALLBACK(gaim_auth_dontgrant),
+					   _("_Cancel"), G_CALLBACK(oscar_free_name_data),
 					   data);
 }
 
@@ -2463,7 +2463,7 @@
 										_("Do you want to add this buddy "
 										  "to your buddy list?"),
 										GAIM_DEFAULT_ACTION_NONE, data, 2,
-										_("Add"), G_CALLBACK(gaim_icq_buddyadd),
+										_("_Add"), G_CALLBACK(gaim_icq_buddyadd),
 										_("_Decline"), G_CALLBACK(oscar_free_name_data));
 					g_free(message);
 				}
@@ -5834,8 +5834,8 @@
 	title = g_strdup_printf(_("Buddy Comment for %s"), data->name);
 	gaim_request_input(gc, title, _("Buddy Comment:"), NULL,
 					   comment_utf8, TRUE, FALSE, NULL,
-					   _("OK"), G_CALLBACK(oscar_ssi_editcomment),
-					   _("Cancel"), G_CALLBACK(oscar_free_name_data),
+					   _("_OK"), G_CALLBACK(oscar_ssi_editcomment),
+					   _("_Cancel"), G_CALLBACK(oscar_free_name_data),
 					   data);
 	g_free(title);
 
@@ -5886,8 +5886,8 @@
 			  "may be considered a security risk.  Do you "
 			  "wish to continue?"),
 			0, data, 2,
-			_("_Connect"), G_CALLBACK(oscar_ask_directim_yes_cb),
-			_("Cancel"), G_CALLBACK(oscar_ask_directim_no_cb));
+			_("C_onnect"), G_CALLBACK(oscar_ask_directim_yes_cb),
+			_("_Cancel"), G_CALLBACK(oscar_ask_directim_no_cb));
 	g_free(buf);
 }
 
@@ -6064,8 +6064,8 @@
 	GaimConnection *gc = (GaimConnection *) action->context;
 	gaim_request_input(gc, NULL, _("New screen name formatting:"), NULL,
 					   gaim_connection_get_display_name(gc), FALSE, FALSE, NULL,
-					   _("OK"), G_CALLBACK(oscar_format_screenname),
-					   _("Cancel"), NULL,
+					   _("_OK"), G_CALLBACK(oscar_format_screenname),
+					   _("_Cancel"), NULL,
 					   gc);
 }
 
@@ -6120,8 +6120,8 @@
 	GaimConnection *gc = (GaimConnection *) action->context;
 	gaim_request_input(gc, NULL, _("Change Address To:"), NULL, NULL,
 					   FALSE, FALSE, NULL,
-					   _("OK"), G_CALLBACK(oscar_change_email),
-					   _("Cancel"), NULL,
+					   _("_OK"), G_CALLBACK(oscar_change_email),
+					   _("_Cancel"), NULL,
 					   gc);
 }
 
@@ -6189,8 +6189,8 @@
 					   _("Type the e-mail address of the buddy you are "
 						 "searching for."),
 					   NULL, FALSE, FALSE, NULL,
-					   _("Search"), G_CALLBACK(search_by_email_cb),
-					   _("Cancel"), NULL, gc);
+					   _("_Search"), G_CALLBACK(search_by_email_cb),
+					   _("_Cancel"), NULL, gc);
 }
 
 static void oscar_show_set_info(GaimPluginAction *action)
--- a/libgaim/request.h	Mon Jan 08 00:08:10 2007 +0000
+++ b/libgaim/request.h	Mon Jan 08 04:04:16 2007 +0000
@@ -1252,7 +1252,13 @@
  * @param default_action The default value.
  * @param user_data      The data to pass to the callback.
  * @param action_count   The number of actions.
- * @param ...            A list of actions.
+ * @param ...            A list of actions.  These are pairs of
+ *                       arguments.  The first of each pair is the
+ *                       string that appears on the button.  It should
+ *                       have an underscore before the letter you want
+ *                       to use as the accelerator key for the button.
+ *                       The second of each pair is the callback
+ *                       function to use when the button is clicked.
  *
  * @return A UI-specific handle.
  */
@@ -1332,7 +1338,7 @@
 							default_action, user_data, yes_cb, no_cb) \
 	gaim_request_action((handle), (title), (primary), (secondary), \
 						(default_action), (user_data), 2, \
-						_("Yes"), (yes_cb), _("No"), (no_cb))
+						_("_Yes"), (yes_cb), _("_No"), (no_cb))
 
 /**
  * A wrapper for gaim_request_action() that uses @c OK and @c Cancel buttons.
@@ -1341,7 +1347,7 @@
 							default_action, user_data, ok_cb, cancel_cb) \
 	gaim_request_action((handle), (title), (primary), (secondary), \
 						(default_action), (user_data), 2, \
-						_("OK"), (ok_cb), _("Cancel"), (cancel_cb))
+						_("_OK"), (ok_cb), _("_Cancel"), (cancel_cb))
 
 /**
  * A wrapper for gaim_request_action() that uses Accept and Cancel buttons.
@@ -1351,7 +1357,7 @@
 								   cancel_cb) \
 	gaim_request_action((handle), (title), (primary), (secondary), \
 						(default_action), (user_data), 2, \
-						_("_Accept"), (accept_cb), _("Cancel"), (cancel_cb))
+						_("_Accept"), (accept_cb), _("_Cancel"), (cancel_cb))
 
 /**
  * Displays a file selector request dialog.  Returns the selected filename to