# HG changeset patch # User Mark Doliner # Date 1200554464 0 # Node ID 9df0a8c7c9b714843823ccf3ae18be4170917917 # Parent 3550c5d7c493250c837b2346e720af0cac96c2a7 * Clarify the documentation for purple_request_action's 'default_ation' It should be the action that users are most likely to choose * Fix Pidgin's request_action dialog to correctly set the default action based on the input value. We were counting from the button on the left and moving right but we should have started counting from the button on the right and moved left, because that's the order the actions are specified in when passed to purple_request_action. diff -r 3550c5d7c493 -r 9df0a8c7c9b7 libpurple/request.h --- a/libpurple/request.h Thu Jan 17 06:17:02 2008 +0000 +++ b/libpurple/request.h Thu Jan 17 07:21:04 2008 +0000 @@ -1318,6 +1318,8 @@ * @param secondary Secondary information, or @c NULL if there is none. * @param default_action The default action, zero-indexed; if the third action * supplied should be the default, supply 2. + * The should be the action that users are most likely + * to select. * @param account The #PurpleAccount associated with this request, or @c * NULL if none is. * @param who The username of the buddy associated with this request, @@ -1356,6 +1358,8 @@ * @param secondary Secondary information, or @c NULL if there is none. * @param default_action The default action, zero-indexed; if the third action * supplied should be the default, supply 2. + * The should be the action that users are most likely + * to select. * @param account The #PurpleAccount associated with this request, or @c * NULL if none is. * @param who The username of the buddy associated with this request, diff -r 3550c5d7c493 -r 9df0a8c7c9b7 pidgin/gtkrequest.c --- a/pidgin/gtkrequest.c Thu Jan 17 06:17:02 2008 +0000 +++ b/pidgin/gtkrequest.c Thu Jan 17 07:21:04 2008 +0000 @@ -663,7 +663,11 @@ gtk_widget_grab_focus(img); gtk_widget_grab_default(img); } else - gtk_dialog_set_default_response(GTK_DIALOG(dialog), default_action); + /* + * Need to invert the default_action number because the + * buttons are added to the dialog in reverse order. + */ + gtk_dialog_set_default_response(GTK_DIALOG(dialog), action_count - 1 - default_action); /* Show everything. */ pidgin_auto_parent_window(dialog);