From: <sa...@us...> - 2006-09-27 02:29:38
|
Revision: 17382 http://svn.sourceforge.net/gaim/?rev=17382&view=rev Author: sadrul Date: 2006-09-26 19:29:03 -0700 (Tue, 26 Sep 2006) Log Message: ----------- Update the statusbox when a plugin changes the global buddyicon. Make sure the iconboxes show up correctly if a plugin toggles them on/off. Modified Paths: -------------- trunk/gtk/gtkstatusbox.c Modified: trunk/gtk/gtkstatusbox.c =================================================================== --- trunk/gtk/gtkstatusbox.c 2006-09-27 02:07:06 UTC (rev 17381) +++ trunk/gtk/gtkstatusbox.c 2006-09-27 02:29:03 UTC (rev 17382) @@ -298,6 +298,8 @@ if (status_box->icon_box != NULL) return; + status_box->icon = gtk_image_new(); + status_box->icon_box = gtk_event_box_new(); if (status_box->account && !gaim_account_get_ui_bool(status_box->account, GAIM_GTK_UI, "use-global-buddyicon", TRUE)) { @@ -309,8 +311,6 @@ { gtk_gaim_status_box_set_buddy_icon(status_box, gaim_prefs_get_string("/gaim/gtk/accounts/buddyicon")); } - status_box->icon = gtk_image_new(); - status_box->icon_box = gtk_event_box_new(); status_box->hand_cursor = gdk_cursor_new (GDK_HAND2); status_box->arrow_cursor = gdk_cursor_new (GDK_LEFT_PTR); @@ -352,6 +352,7 @@ g_free(statusbox->buddy_icon_path); + statusbox->icon = NULL; statusbox->icon_box = NULL; statusbox->buddy_icon_path = NULL; statusbox->buddy_icon = NULL; @@ -1087,7 +1088,7 @@ } static void -icon_choose_cb(const char *filename, gpointer data) +buddy_icon_set_cb(const char *filename, gpointer data) { GtkGaimStatusBox *box; @@ -1125,14 +1126,30 @@ } } gtk_gaim_status_box_set_buddy_icon(box, filename); - if (box->account == NULL) - gaim_prefs_set_string("/gaim/gtk/accounts/buddyicon", filename); } box->buddy_icon_sel = NULL; } static void +icon_choose_cb(const char *filename, gpointer data) +{ + GtkGaimStatusBox *box = data; + if (box->account == NULL) + /* The pref-connect callback does the actual work */ + gaim_prefs_set_string("/gaim/gtk/accounts/buddyicon", filename); + else + buddy_icon_set_cb(filename, data); +} + +static void +update_buddyicon_cb(const char *name, GaimPrefType type, + gconstpointer value, gpointer data) +{ + buddy_icon_set_cb(value, data); +} + +static void gtk_gaim_status_box_init (GtkGaimStatusBox *status_box) { GtkCellRenderer *text_rend; @@ -1234,6 +1251,8 @@ buddy_list_details_pref_changed_cb, status_box); gaim_prefs_connect_callback(status_box, "/gaim/gtk/conversations/spellcheck", spellcheck_prefs_cb, status_box); + gaim_prefs_connect_callback(status_box, "/gaim/gtk/accounts/buddyicon", + update_buddyicon_cb, status_box); } static void This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |