im.pidgin.pidgin: 267fe0d0318481d2acaf3ba09d03fedb672d5315

markdoliner at pidgin.im markdoliner at pidgin.im
Thu Jan 17 02:25:37 EST 2008


-----------------------------------------------------------------
Revision: 267fe0d0318481d2acaf3ba09d03fedb672d5315
Ancestor: 521bdccbaa081e1d700cbd4c603f84fe947aa2b3
Author: markdoliner at pidgin.im
Date: 2008-01-17T07:21:04
Branch: im.pidgin.pidgin

Modified files:
        libpurple/request.h pidgin/gtkrequest.c

ChangeLog: 

* 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.

-------------- next part --------------
============================================================
--- libpurple/request.h	acc633bd74a90bb5dde1a118aca51944f90682c1
+++ libpurple/request.h	73f00aa4fb0818056baffe76bd2236e3ad52266e
@@ -1318,6 +1318,8 @@ void *purple_request_choice_varg(void *h
  * @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 <tt>2</tt>.
+ *                       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 @@ void *purple_request_action(void *handle
  * @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 <tt>2</tt>.
+ *                       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,
============================================================
--- pidgin/gtkrequest.c	ebcb63de3e8001376ad6dccfea219ad78269319f
+++ pidgin/gtkrequest.c	ef21b39ea8d991bf484bc2227f9ea61401fcc8c1
@@ -663,7 +663,11 @@ pidgin_request_action(const char *title,
 		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);


More information about the Commits mailing list