From: <ev...@us...> - 2006-12-10 02:54:26
|
Revision: 17931 http://svn.sourceforge.net/gaim/?rev=17931&view=rev Author: evands Date: 2006-12-09 18:54:26 -0800 (Sat, 09 Dec 2006) Log Message: ----------- gntgaim changes for GaimNotifyUserInfo introduced in [17929] Modified Paths: -------------- trunk/console/gntblist.c trunk/console/gntnotify.c Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-12-10 02:53:54 UTC (rev 17930) +++ trunk/console/gntblist.c 2006-12-10 02:54:26 UTC (rev 17931) @@ -1148,29 +1148,27 @@ GaimPlugin *prpl; GaimPluginProtocolInfo *prpl_info; GaimAccount *account; + GaimNotifyUserInfo *user_info; const char *alias = gaim_buddy_get_alias(buddy); + char *tmp, *strip; + user_info = gaim_notify_user_info_new(); + account = gaim_buddy_get_account(buddy); if (g_utf8_collate(gaim_buddy_get_name(buddy), alias)) - g_string_append_printf(str, _("Nickname: %s\n"), alias); - g_string_append_printf(str, _("Account: %s (%s)"), + gaim_notify_user_info_add_pair(user_info, _("Nickname"), alias); + + tmp = g_strdup_printf("%s (%s)", gaim_account_get_username(account), gaim_account_get_protocol_name(account)); + gaim_notify_user_info_add_pair(user_info, _("Account"), tmp); + g_free(tmp); prpl = gaim_find_prpl(gaim_account_get_protocol_id(account)); prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); if (prpl_info && prpl_info->tooltip_text) { - GString *tip = g_string_new(""); - char *strip, *br; - prpl_info->tooltip_text(buddy, tip, TRUE); - - br = gaim_strreplace(tip->str, "\n", "<br>"); - strip = gaim_markup_strip_html(br); - g_string_append(str, strip); - g_string_free(tip, TRUE); - g_free(strip); - g_free(br); + prpl_info->tooltip_text(buddy, user_info, TRUE); } if (gaim_prefs_get_bool("/gaim/gnt/blist/idletime")) { @@ -1179,11 +1177,19 @@ time_t idle = gaim_presence_get_idle_time(pre); if (idle > 0) { char *st = gaim_str_seconds_to_string(time(NULL) - idle); - g_string_append_printf(str, _("\nIdle: %s"), st); + gaim_notify_user_info_add_pair(user_info, _("Idle"), st); g_free(st); } } } + + tmp = gaim_notify_user_info_get_text_with_newline(user_info, "\n"); + gaim_notify_user_info_destroy(user_info); + + strip = gaim_markup_strip_html(tmp); + g_string_append(str, strip); + g_free(strip); + g_free(tmp); } static GString* Modified: trunk/console/gntnotify.c =================================================================== --- trunk/console/gntnotify.c 2006-12-10 02:53:54 UTC (rev 17930) +++ trunk/console/gntnotify.c 2006-12-10 02:54:26 UTC (rev 17931) @@ -220,14 +220,17 @@ } static void * -gg_notify_userinfo(GaimConnection *gc, const char *who, const char *text) +gg_notify_userinfo(GaimConnection *gc, const char *who, GaimNotifyUserInfo *user_info) { /* Xeroxed from gtknotify.c */ char *primary; + char *info; void *ui_handle; - + primary = g_strdup_printf(_("Info for %s"), who); - ui_handle = gg_notify_formatted(_("Buddy Information"), primary, NULL, text); + info = gaim_notify_user_info_get_text_with_newline(user_info, "\n"); + ui_handle = gg_notify_formatted(_("Buddy Information"), primary, NULL, info); + g_free(info); g_free(primary); return ui_handle; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |