Mercurial > pidgin.yaz
changeset 15140:63d554c2675d
[gaim-migrate @ 17925]
This seems like a reasonable way to tell the prpl if we're using a local or global buddy icon.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Huetsch <markhuetsch> |
---|---|
date | Sat, 09 Dec 2006 07:20:46 +0000 |
parents | e952a5fc97b3 |
children | 05c55c2b6c25 |
files | gtk/gtkaccount.c gtk/gtkstatusbox.c libgaim/protocols/qq/buddy_info.c |
diffstat | 3 files changed, 16 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/gtk/gtkaccount.c Sat Dec 09 06:34:48 2006 +0000 +++ b/gtk/gtkaccount.c Sat Dec 09 07:20:46 2006 +0000 @@ -622,7 +622,7 @@ gaim_account_get_check_mail(dialog->account)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->icon_check), - !gaim_account_get_ui_bool(dialog->account, GAIM_GTK_UI, "use-global-buddyicon", + !gaim_account_get_bool(dialog->account, "use-global-buddyicon", TRUE)); set_dialog_icon(dialog, g_strdup(gaim_account_get_ui_string(dialog->account, @@ -1142,12 +1142,12 @@ prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(dialog->plugin); if (prpl_info != NULL && prpl_info->icon_spec.format != NULL) { - if (new || gaim_account_get_ui_bool(account, GAIM_GTK_UI, "use-global-buddyicon", TRUE) == + if (new || gaim_account_get_bool(account, "use-global-buddyicon", TRUE) == gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))) { icon_change = TRUE; } - gaim_account_set_ui_bool(account, GAIM_GTK_UI, "use-global-buddyicon", !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))); + gaim_account_set_bool(account, "use-global-buddyicon", !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))); gaim_account_set_ui_string(account, GAIM_GTK_UI, "non-global-buddyicon-cached-path", dialog->cached_icon_path); gaim_account_set_ui_string(account, GAIM_GTK_UI, "non-global-buddyicon-path", dialog->icon_path); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check)))
--- a/gtk/gtkstatusbox.c Sat Dec 09 06:34:48 2006 +0000 +++ b/gtk/gtkstatusbox.c Sat Dec 09 07:20:46 2006 +0000 @@ -331,7 +331,7 @@ gtk_widget_show(status_box->icon_box); if (status_box->account && - !gaim_account_get_ui_bool(status_box->account, GAIM_GTK_UI, "use-global-buddyicon", TRUE)) + !gaim_account_get_bool(status_box->account, "use-global-buddyicon", TRUE)) { char *string = gaim_buddy_icons_get_full_path(gaim_account_get_buddy_icon(status_box->account)); gtk_gaim_status_box_set_buddy_icon(status_box, string); @@ -1340,7 +1340,7 @@ char *icon = NULL; if (filename) icon = gaim_gtk_convert_buddy_icon(plug, filename); - gaim_account_set_ui_bool(box->account, GAIM_GTK_UI, "use-global-buddyicon", (filename != NULL)); + gaim_account_set_bool(box->account, "use-global-buddyicon", (filename != NULL)); gaim_account_set_ui_string(box->account, GAIM_GTK_UI, "non-global-buddyicon-cached-path", icon); gaim_account_set_buddy_icon_path(box->account, filename); gaim_account_set_buddy_icon(box->account, icon); @@ -1355,7 +1355,7 @@ if (plug) { GaimPluginProtocolInfo *prplinfo = GAIM_PLUGIN_PROTOCOL_INFO(plug); if (prplinfo != NULL && - gaim_account_get_ui_bool(account, GAIM_GTK_UI, "use-global-buddyicon", TRUE) && + gaim_account_get_bool(account, "use-global-buddyicon", TRUE) && prplinfo->icon_spec.format) { char *icon = NULL; if (filename)
--- a/libgaim/protocols/qq/buddy_info.c Sat Dec 09 06:34:48 2006 +0000 +++ b/libgaim/protocols/qq/buddy_info.c Sat Dec 09 07:20:46 2006 +0000 @@ -548,7 +548,7 @@ } } -/* TODO: custom faces */ +/* TODO: custom faces for QQ members and users with level >= 16 */ void qq_set_my_buddy_icon(GaimConnection *gc, const gchar *iconfile) { gchar *icon; @@ -561,6 +561,7 @@ gint dir_len = strlen(buddy_icon_dir); gint icon_len = strlen(icon_path) - dir_len - 1 - prefix_len - suffix_len; gchar *errmsg = g_strconcat(_("You are attempting to set a custom face. Gaim currently only allows the standard faces. Please choose an image from "), buddy_icon_dir, ".", NULL); + gboolean icon_global = gaim_account_get_bool(gc->account, "use-global-buddyicon", TRUE); /* make sure we're using an appropriate icon */ if (!(g_ascii_strncasecmp(icon_path, buddy_icon_dir, dir_len) == 0 @@ -568,7 +569,10 @@ && g_ascii_strncasecmp(icon_path + dir_len + 1, QQ_ICON_PREFIX, prefix_len) == 0 && g_ascii_strncasecmp(icon_path + dir_len + 1 + prefix_len + icon_len, QQ_ICON_SUFFIX, suffix_len) == 0 && icon_len <= 3)) { - gaim_notify_error(gc, _("Invalid QQ Face"), errmsg, NULL); + if (icon_global) + gaim_debug(GAIM_DEBUG_ERROR, "QQ", "%s\n", errmsg); + else + gaim_notify_error(gc, _("Invalid QQ Face"), errmsg, NULL); g_free(errmsg); return; } @@ -578,7 +582,10 @@ g_free(icon); /* ensure face number in proper range */ if (icon_num > QQ_FACES) { - gaim_notify_error(gc, _("Invalid QQ Face"), errmsg, NULL); + if (icon_global) + gaim_debug(GAIM_DEBUG_ERROR, "QQ", "%s\n", errmsg); + else + gaim_notify_error(gc, _("Invalid QQ Face"), errmsg, NULL); g_free(errmsg); return; }