Add 'cancel_action' parameter to purple_request_action

Mark Doliner mark at kingant.net
Thu Jan 24 15:03:16 EST 2008


Top o' the day to ya,

I talked with Ka-Hing about this in #pidgin a few nights ago.  I think we
should add a 'cancel_action' parameter to purple_request_action in
libpurple/request.c.

This function takes in a variable list of callback functions which get mapped
to buttons in the dialog window that is displayed.  We currently have a
'default_action' parameter.  This parameter is used to indicate which action
should be triggered if the user presses the "enter" key when the dialog pops up.

But what should happen if the dialog is closed using the window manager's "x"
button?  Currently no callback is triggered, the dialog is closed, and the
user_data associated with that dialog is leaked.

Take the "are you sure you want to delete this log?" dialog, for example.  The
default action is "yes" (because the user probably DOES want to delete the
log).  Obviously if the user closes the dialog then the "no" action should be
triggered, but currently NOTHING happens and some data is leaked.

We would also want to change purple_request_yes_no, purple_request_ok_cancel
and purple_request_accept_cancel.

Thoughts?

-Mark




More information about the Devel mailing list