# HG changeset patch # User Richard Laager # Date 1126555477 0 # Node ID c9b815aeddc125add0819bfcbbd6c1079c82454e # Parent 57439a383f4f2d34d8e6972e09fd9ed6e875f7dc [gaim-migrate @ 13782] Pushing more of the userinfo stuff to the UI. Also, fixed a notify API warning in the perl plugin. committer: Tailor Script diff -r 57439a383f4f -r c9b815aeddc1 plugins/ChangeLog.API --- a/plugins/ChangeLog.API Mon Sep 12 18:52:53 2005 +0000 +++ b/plugins/ChangeLog.API Mon Sep 12 20:04:37 2005 +0000 @@ -99,6 +99,9 @@ * Added: CHAT_USERS_ALIAS_COLUMN, CHAT_USERS_COLOR_COLUMN, CHAT_USERS_BUDDY_COLUMN to the list of columns for the chat user list + * Changed: gaim_notify_userinfo, removed primary and secondary args + * Changed: GaimNotifyUiOps::notify_userinfo, removed title, primary, + and secondary args Signals: * Changed: "received-im-msg" and "received-chat-msg" to match, both diff -r 57439a383f4f -r c9b815aeddc1 plugins/perl/common/Notify.xs --- a/plugins/perl/common/Notify.xs Mon Sep 12 18:52:53 2005 +0000 +++ b/plugins/perl/common/Notify.xs Mon Sep 12 20:04:37 2005 +0000 @@ -68,7 +68,7 @@ const char *title const char *primary const char *secondary - const char **results + Gaim::NotifySearchResults results GCallback cb void * user_data @@ -82,12 +82,9 @@ const char *uri void * -gaim_notify_userinfo(gc, who, title, primary, secondary, text, cb, user_data) +gaim_notify_userinfo(gc, who, text, cb, user_data) Gaim::Connection gc const char *who - const char *title - const char *primary - const char *secondary const char *text GCallback cb void * user_data diff -r 57439a383f4f -r c9b815aeddc1 plugins/perl/common/module.h --- a/plugins/perl/common/module.h Mon Sep 12 18:52:53 2005 +0000 +++ b/plugins/perl/common/module.h Mon Sep 12 20:04:37 2005 +0000 @@ -161,7 +161,11 @@ /* notify.h */ typedef GaimNotifyType Gaim__NotifyType; -typedef GaimNotifyMsgType Gaim__NotifyMsgType; +typedef GaimNotifyMsgType Gaim__NotifyMsgType; +typedef GaimNotifySearchButtonType Gaim__NotifySearchButtonType; +typedef GaimNotifySearchResults * Gaim__NotifySearchResults; +typedef GaimNotifySearchColumn * Gaim__NotifySearchColumn; +typedef GaimNotifySearchButton * Gaim__NotifySearchButton; typedef GaimNotifyUiOps * Gaim__NotifyUiOps; /* plugin.h */ diff -r 57439a383f4f -r c9b815aeddc1 plugins/perl/common/typemap --- a/plugins/perl/common/typemap Mon Sep 12 18:52:53 2005 +0000 +++ b/plugins/perl/common/typemap Mon Sep 12 20:04:37 2005 +0000 @@ -100,6 +100,10 @@ Gaim::NotifyType T_IV Gaim::NotifyMsgType T_IV +Gaim::NotifySearchButtonType T_IV +Gaim::NotifySearchResults T_GaimObj +Gaim::NotifySearchColumn T_GaimObj +Gaim::NotifySearchButton T_GaimObj Gaim::NotifyUiOps T_GaimObj Gaim::Plugin T_GaimObj diff -r 57439a383f4f -r c9b815aeddc1 src/gtknotify.c --- a/src/gtknotify.c Mon Sep 12 18:52:53 2005 +0000 +++ b/src/gtknotify.c Mon Sep 12 20:04:37 2005 +0000 @@ -632,12 +632,17 @@ static void * gaim_gtk_notify_userinfo(GaimConnection *gc, const char *who, - const char *title, const char *primary, - const char *secondary, const char *text, + const char *text, GCallback cb, void *user_data) { - return gaim_gtk_notify_formatted(title, primary, secondary, + char *primary; + void *ui_handle; + + primary = g_strdup_printf(_("Info for %s"), who); + ui_handle = gaim_gtk_notify_formatted(_("Buddy Information"), primary, NULL, text, cb, user_data); + g_free(primary); + return ui_handle; } static void diff -r 57439a383f4f -r c9b815aeddc1 src/notify.c --- a/src/notify.c Mon Sep 12 18:52:53 2005 +0000 +++ b/src/notify.c Mon Sep 12 20:04:37 2005 +0000 @@ -22,7 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "internal.h" #include "notify.h" static GaimNotifyUiOps *notify_ui_ops = NULL; @@ -330,15 +329,11 @@ void * gaim_notify_userinfo(GaimConnection *gc, const char *who, - const char *primary, const char *secondary, const char *text, GCallback cb, void *user_data) { GaimNotifyUiOps *ops; - char title[256]; - g_snprintf(title, sizeof(title), _("Info for %s"), who); - - g_return_val_if_fail(primary != NULL, NULL); + g_return_val_if_fail(who != NULL, NULL); ops = gaim_notify_get_ui_ops(); @@ -348,8 +343,8 @@ info = g_new0(GaimNotifyInfo, 1); info->type = GAIM_NOTIFY_USERINFO; info->handle = gc; - info->ui_handle = ops->notify_userinfo(gc, who, title, primary, - secondary, text, cb, user_data); + info->ui_handle = ops->notify_userinfo(gc, who, + text, cb, user_data); handles = g_list_append(handles, info); diff -r 57439a383f4f -r c9b815aeddc1 src/notify.h --- a/src/notify.h Mon Sep 12 18:52:53 2005 +0000 +++ b/src/notify.h Mon Sep 12 20:04:37 2005 +0000 @@ -126,8 +126,7 @@ GaimNotifySearchResults *results, void *data, void *user_data); void *(*notify_userinfo)(GaimConnection *gc, const char *who, - const char *title, const char *primary, - const char *secondary, const char *text, + const char *text, GCallback cb, void *user_data); void *(*notify_uri)(const char *uri); @@ -360,10 +359,8 @@ * The text is essentially a stripped-down format of HTML, the same that * IMs may send. * - * @param gc The GaimConnection handle associated with the information. - * @param who The username associated with the information. - * @param primary The main point of the message. - * @param secondary The secondary information. + * @param gc The GaimConnection handle associated with the information. + * @param who The username associated with the information. * @param text The formatted text. * @param cb The callback to call when the user closes * the notification. @@ -372,7 +369,6 @@ * @return A UI-specific handle. */ void *gaim_notify_userinfo(GaimConnection *gc, const char *who, - const char *primary, const char *secondary, const char *text, GCallback cb, void *user_data); diff -r 57439a383f4f -r c9b815aeddc1 src/protocols/irc/msgs.c --- a/src/protocols/irc/msgs.c Mon Sep 12 18:52:53 2005 +0000 +++ b/src/protocols/irc/msgs.c Mon Sep 12 20:04:37 2005 +0000 @@ -252,7 +252,7 @@ gc = gaim_account_get_connection(irc->account); str = g_string_free(info, FALSE); - gaim_notify_userinfo(gc, irc->whois.nick, _("Buddy Information"), NULL, str, NULL, NULL); + gaim_notify_userinfo(gc, irc->whois.nick, str, NULL, NULL); g_free(irc->whois.nick); g_free(str); diff -r 57439a383f4f -r c9b815aeddc1 src/protocols/jabber/buddy.c --- a/src/protocols/jabber/buddy.c Mon Sep 12 18:52:53 2005 +0000 +++ b/src/protocols/jabber/buddy.c Mon Sep 12 20:04:37 2005 +0000 @@ -851,8 +851,7 @@ text = gaim_strdup_withhtml(info_text->str); - gaim_notify_userinfo(js->gc, from, _("Jabber Profile"), - NULL, text, NULL, NULL); + gaim_notify_userinfo(js->gc, from, text, NULL, NULL); while(imgids) { gaim_imgstore_unref(GPOINTER_TO_INT(imgids->data)); diff -r 57439a383f4f -r c9b815aeddc1 src/protocols/msn/msn.c --- a/src/protocols/msn/msn.c Mon Sep 12 18:52:53 2005 +0000 +++ b/src/protocols/msn/msn.c Mon Sep 12 20:04:37 2005 +0000 @@ -1483,7 +1483,7 @@ g_snprintf(buf, 1024, "%s%s", tooltip_text, _("Error retrieving profile")); - gaim_notify_userinfo(info_data->gc, info_data->name, title, NULL, buf, NULL, NULL); + gaim_notify_userinfo(info_data->gc, info_data->name, buf, NULL, NULL); g_free(tooltip_text); return; @@ -1792,7 +1792,6 @@ GString *s = info2_data->s; char *photo_url_text = info2_data->photo_url_text; char *tooltip_text = info2_data->tooltip_text; - const char *title = info2_data->title; /* Try to put the photo in there too, if there's one and is readable */ if (data && url_text && len != 0) @@ -1819,7 +1818,7 @@ #endif g_string_prepend(s, tooltip_text); - gaim_notify_userinfo(info_data->gc, info_data->name, title, NULL, s->str, NULL, NULL); + gaim_notify_userinfo(info_data->gc, info_data->name, s->str, NULL, NULL); g_free(stripped); g_free(url_buffer); diff -r 57439a383f4f -r c9b815aeddc1 src/protocols/napster/napster.c --- a/src/protocols/napster/napster.c Mon Sep 12 18:52:53 2005 +0000 +++ b/src/protocols/napster/napster.c Mon Sep 12 20:04:37 2005 +0000 @@ -420,7 +420,7 @@ /* XXX - Format is: "Elite" 37 " " "Active" 0 0 0 0 "gaim 0.63cvs" 0 0 192.168.1.41 32798 0 unknown flounder */ res = g_strsplit(buf, " ", 2); /* res[0] == username */ - gaim_notify_userinfo(gc, res[0], NULL, _("Buddy Information"), res[1], NULL, NULL); + gaim_notify_userinfo(gc, res[0], res[1], NULL, NULL); g_strfreev(res); break; diff -r 57439a383f4f -r c9b815aeddc1 src/protocols/novell/novell.c --- a/src/protocols/novell/novell.c Mon Sep 12 18:52:53 2005 +0000 +++ b/src/protocols/novell/novell.c Mon Sep 12 20:04:37 2005 +0000 @@ -1512,8 +1512,7 @@ } gaim_notify_userinfo(gc, nm_user_record_get_userid(user_record), - _("User Properties"), NULL, info_text->str, - NULL, NULL); + info_text->str, NULL, NULL); g_string_free(info_text, TRUE); } diff -r 57439a383f4f -r c9b815aeddc1 src/protocols/oscar/oscar.c --- a/src/protocols/oscar/oscar.c Mon Sep 12 18:52:53 2005 +0000 +++ b/src/protocols/oscar/oscar.c Mon Sep 12 20:04:37 2005 +0000 @@ -4874,7 +4874,7 @@ g_free(statusmsg); g_strfreev(splitmsg); - gaim_notify_userinfo(gc, who, _("Buddy Information"), NULL, dialogmsg, NULL, NULL); + gaim_notify_userinfo(gc, who, dialogmsg, NULL, NULL); g_free(title); g_free(dialogmsg); @@ -5099,7 +5099,7 @@ tmp = gaim_str_sub_away_formatters(str->str, gaim_account_get_username(account)); g_string_free(str, TRUE); - gaim_notify_userinfo(gc, userinfo->sn, _("Buddy Information"), NULL, tmp, NULL, NULL); + gaim_notify_userinfo(gc, userinfo->sn, tmp, NULL, NULL); g_free(tmp); return 1; @@ -5925,7 +5925,7 @@ struct buddyinfo *bi = NULL; gchar who[16]; GString *str; - gchar *primary, *utf8; + gchar *utf8; const gchar *alias; va_list ap; struct aim_icq_info *info; @@ -6027,9 +6027,7 @@ alias = gaim_buddy_get_alias(buddy); else alias = who; - primary = g_strdup_printf(_("ICQ Info for %s"), alias); - gaim_notify_userinfo(gc, who, primary, NULL, str->str, NULL, NULL); - g_free(primary); + gaim_notify_userinfo(gc, who, str->str, NULL, NULL); g_string_free(str, TRUE); return 1; diff -r 57439a383f4f -r c9b815aeddc1 src/protocols/sametime/sametime.c --- a/src/protocols/sametime/sametime.c Mon Sep 12 18:52:53 2005 +0000 +++ b/src/protocols/sametime/sametime.c Mon Sep 12 20:04:37 2005 +0000 @@ -3454,7 +3454,7 @@ /* @todo emit a signal to allow a plugin to override the display of this notification, so that it can create its own */ - gaim_notify_userinfo(gc, who, "Meanwhile User Status", NULL, str->str, NULL, NULL); + gaim_notify_userinfo(gc, who, str->str, NULL, NULL); g_string_free(str, TRUE); } diff -r 57439a383f4f -r c9b815aeddc1 src/protocols/silc/ops.c --- a/src/protocols/silc/ops.c Mon Sep 12 18:52:53 2005 +0000 +++ b/src/protocols/silc/ops.c Mon Sep 12 20:04:37 2005 +0000 @@ -1084,7 +1084,7 @@ _("More..."), G_CALLBACK(silcgaim_whois_more)); else #endif - gaim_notify_userinfo(gc, client_entry->nickname, _("Buddy Information"), NULL, buf, NULL, NULL); + gaim_notify_userinfo(gc, client_entry->nickname, buf, NULL, NULL); g_free(buf); } break; @@ -1145,7 +1145,7 @@ } buf = g_string_free(s, FALSE); - gaim_notify_userinfo(gc, client_entry->nickname, _("Buddy Information"), NULL, buf, NULL, NULL); + gaim_notify_userinfo(gc, client_entry->nickname, buf, NULL, NULL); g_free(buf); } break; diff -r 57439a383f4f -r c9b815aeddc1 src/protocols/yahoo/yahoo_profile.c --- a/src/protocols/yahoo/yahoo_profile.c Mon Sep 12 18:52:53 2005 +0000 +++ b/src/protocols/yahoo/yahoo_profile.c Mon Sep 12 20:04:37 2005 +0000 @@ -764,8 +764,8 @@ g_snprintf(buf, 1024, "%s%s", tooltip_text, _("Error retrieving profile")); - gaim_notify_userinfo(info_data->gc, info_data->name, title, - NULL, buf, NULL, NULL); + gaim_notify_userinfo(info_data->gc, info_data->name, + buf, NULL, NULL); g_free(profile_url_text); g_free(tooltip_text); @@ -801,8 +801,8 @@ "you will need to visit this link in your web browser"), profile_url_text, profile_url_text); - gaim_notify_userinfo(info_data->gc, info_data->name, title, - NULL, buf, NULL, NULL); + gaim_notify_userinfo(info_data->gc, info_data->name, + buf, NULL, NULL); g_free(profile_url_text); g_free(tooltip_text); @@ -917,7 +917,6 @@ char *tooltip_text = info2_data->tooltip_text; const profile_strings_node_t *strings = info2_data->strings; const char *last_updated_string = info2_data->last_updated_string; - const char *title = info2_data->title; profile_state_t profile_state = info2_data->profile_state; /* We continue here from yahoo_got_info, as if nothing has happened */ @@ -1188,8 +1187,8 @@ g_string_prepend(s, "\n"); /* show it to the user */ - gaim_notify_userinfo(info_data->gc, info_data->name,title, - NULL, s->str, NULL, NULL); + gaim_notify_userinfo(info_data->gc, info_data->name, + s->str, NULL, NULL); g_free(last_updated_utf8_string); g_free(url_buffer); diff -r 57439a383f4f -r c9b815aeddc1 src/protocols/zephyr/zephyr.c --- a/src/protocols/zephyr/zephyr.c Mon Sep 12 18:52:53 2005 +0000 +++ b/src/protocols/zephyr/zephyr.c Mon Sep 12 20:04:37 2005 +0000 @@ -727,7 +727,7 @@ ZGetLocations(&locs, &one); g_string_append_printf(str, _("
At %s since %s"), locs.host, locs.time); } - gaim_notify_userinfo(gc, b ? b->name : user, _("Buddy Information"), NULL, + gaim_notify_userinfo(gc, b ? b->name : user, str->str, NULL, NULL); g_string_free(str, TRUE); } else { @@ -1142,7 +1142,7 @@ tree_child(tree_child(tree_child(tree_child(locations,2),0),2),2)->contents); } - gaim_notify_userinfo(gc, b ? b->name : user, _("Buddy Information"), NULL, + gaim_notify_userinfo(gc, b ? b->name : user, str->str, NULL, NULL); g_string_free(str, TRUE); } else {