# HG changeset patch # User Richard Laager # Date 1242504479 0 # Node ID 1788bc69ba7ba5a35ad63cb29578863a23817ddc # Parent 8290e36a5a737c5cdccbfc1ec0f71be263e4c218 A patch from nops to add a "Select Buddy Icon" (my term, the original patch used "Choose") option to the right-click menu of the buddy list's buddy icon selector. This is nice from an intuitiveness and HIG-compliance stance. Fixes #8775 diff -r 8290e36a5a73 -r 1788bc69ba7b pidgin/gtkstatusbox.c --- a/pidgin/gtkstatusbox.c Sat May 16 19:58:40 2009 +0000 +++ b/pidgin/gtkstatusbox.c Sat May 16 20:07:59 2009 +0000 @@ -93,6 +93,7 @@ static void do_colorshift (GdkPixbuf *dest, GdkPixbuf *src, int shift); static void icon_choose_cb(const char *filename, gpointer data); static void remove_buddy_icon_cb(GtkWidget *w, PidginStatusBox *box); +static void choose_buddy_icon_cb(GtkWidget *w, PidginStatusBox *box); enum { /** A PidginStatusBoxItemType */ @@ -317,6 +318,10 @@ box->icon_box_menu = gtk_menu_new(); + menu_item = pidgin_new_item_from_stock(box->icon_box_menu, _("Select Buddy Icon"), NULL, + G_CALLBACK(choose_buddy_icon_cb), + box, 0, 0, NULL); + menu_item = pidgin_new_item_from_stock(box->icon_box_menu, _("Remove"), GTK_STOCK_REMOVE, G_CALLBACK(remove_buddy_icon_cb), box, 0, 0, NULL); @@ -327,13 +332,7 @@ event->button, event->time); } else { - if (box->buddy_icon_sel) { - gtk_window_present(GTK_WINDOW(box->buddy_icon_sel)); - return FALSE; - } - - box->buddy_icon_sel = pidgin_buddy_icon_chooser_new(GTK_WINDOW(gtk_widget_get_toplevel(widget)), icon_choose_cb, box); - gtk_widget_show_all(box->buddy_icon_sel); + choose_buddy_icon_cb(widget, box); } return FALSE; } @@ -1529,6 +1528,17 @@ } static void +choose_buddy_icon_cb(GtkWidget *w, PidginStatusBox *box) +{ + if (box->buddy_icon_sel) { + gtk_window_present(GTK_WINDOW(box->buddy_icon_sel)); + } else { + box->buddy_icon_sel = pidgin_buddy_icon_chooser_new(GTK_WINDOW(gtk_widget_get_toplevel(w)), icon_choose_cb, box); + gtk_widget_show_all(box->buddy_icon_sel); + } +} + +static void icon_choose_cb(const char *filename, gpointer data) { PidginStatusBox *box = data;