From: <dat...@us...> - 2006-11-21 15:15:33
|
Revision: 17802 http://svn.sourceforge.net/gaim/?rev=17802&view=rev Author: datallah Date: 2006-11-21 07:15:20 -0800 (Tue, 21 Nov 2006) Log Message: ----------- Fix clearing buddy icon for per-account statusboxes. Modified Paths: -------------- trunk/gtk/gtkstatusbox.c Modified: trunk/gtk/gtkstatusbox.c =================================================================== --- trunk/gtk/gtkstatusbox.c 2006-11-21 05:34:42 UTC (rev 17801) +++ trunk/gtk/gtkstatusbox.c 2006-11-21 15:15:20 UTC (rev 17802) @@ -82,6 +82,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, GtkGaimStatusBox *box); static void (*combo_box_size_request)(GtkWidget *widget, GtkRequisition *requisition); static void (*combo_box_size_allocate)(GtkWidget *widget, GtkAllocation *allocation); @@ -230,16 +231,6 @@ status_menu_refresh_iter(status_box); } -static void -remove_buddy_icon_cb(GtkWidget *w, GtkGaimStatusBox *box) -{ - /* The pref-connect callback does the actual work */ - gaim_prefs_set_string("/gaim/gtk/accounts/buddyicon", NULL); - - gtk_widget_destroy(box->icon_box_menu); - box->icon_box_menu = NULL; -} - static gboolean icon_box_press_cb(GtkWidget *widget, GdkEventButton *event, GtkGaimStatusBox *box) { @@ -1225,12 +1216,9 @@ } static void -buddy_icon_set_cb(const char *filename, gpointer data) +buddy_icon_set_cb(const char *filename, GtkGaimStatusBox *box) { - GtkGaimStatusBox *box; - box = data; - if (box->account) { GaimPlugin *plug = gaim_find_prpl(gaim_account_get_protocol_id(box->account)); if (plug) { @@ -1268,6 +1256,19 @@ } static void +remove_buddy_icon_cb(GtkWidget *w, GtkGaimStatusBox *box) +{ + if (box->account == NULL) + /* The pref-connect callback does the actual work */ + gaim_prefs_set_string("/gaim/gtk/accounts/buddyicon", NULL); + else + buddy_icon_set_cb(NULL, box); + + gtk_widget_destroy(box->icon_box_menu); + box->icon_box_menu = NULL; +} + +static void icon_choose_cb(const char *filename, gpointer data) { GtkGaimStatusBox *box = data; @@ -1276,7 +1277,7 @@ /* The pref-connect callback does the actual work */ gaim_prefs_set_string("/gaim/gtk/accounts/buddyicon", filename); else - buddy_icon_set_cb(filename, data); + buddy_icon_set_cb(filename, box); } box->buddy_icon_sel = NULL; @@ -1286,7 +1287,7 @@ update_buddyicon_cb(const char *name, GaimPrefType type, gconstpointer value, gpointer data) { - buddy_icon_set_cb(value, data); + buddy_icon_set_cb(value, (GtkGaimStatusBox*) data); } static void This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |