pidgin: 7c81031b: A patch from nops to add a "Select Buddy...
rlaager at pidgin.im
rlaager at pidgin.im
Sat May 16 16:15:22 EDT 2009
-----------------------------------------------------------------
Revision: 7c81031b004dcc2db48d2113ddeb7e00aeab977a
Ancestor: 72ecc6ff2f4db2cc5a95a52ac62c84cd3351b282
Author: rlaager at pidgin.im
Date: 2009-05-16T20:07:59
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/7c81031b004dcc2db48d2113ddeb7e00aeab977a
Modified files:
pidgin/gtkstatusbox.c
ChangeLog:
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
-------------- next part --------------
============================================================
--- pidgin/gtkstatusbox.c 7702e70e321f0a70698dae229696e17457629f8c
+++ pidgin/gtkstatusbox.c 35b70f6a689a7e953cd99525c750e096d94de0a7
@@ -93,6 +93,7 @@ static void remove_buddy_icon_cb(GtkWidg
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 @@ icon_box_press_cb(GtkWidget *widget, Gdk
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 @@ icon_box_press_cb(GtkWidget *widget, Gdk
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
}
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;
More information about the Commits
mailing list