comparison pidgin/gtkblist.c @ 21220:b1fa7765ca4b

propagate from branch 'im.pidgin.pidgin' (head d42511319051bcfa8adb3ed8e3f11a26cabc43f4) to branch 'next.minor' (head 3526bc084159c5c57e580e9e9e190b6ff502fdbe)
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Fri, 12 Oct 2007 02:18:35 +0000
parents 5f829728a1a5 58b9a33968e1
children 6bbd66f67fa8
comparison
equal deleted inserted replaced
21219:5f829728a1a5 21220:b1fa7765ca4b
3068 { N_("/Buddies/New Instant _Message..."), "<CTL>M", pidgin_dialogs_im, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW }, 3068 { N_("/Buddies/New Instant _Message..."), "<CTL>M", pidgin_dialogs_im, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW },
3069 { N_("/Buddies/Join a _Chat..."), "<CTL>C", pidgin_blist_joinchat_show, 0, "<Item>", NULL }, 3069 { N_("/Buddies/Join a _Chat..."), "<CTL>C", pidgin_blist_joinchat_show, 0, "<Item>", NULL },
3070 { N_("/Buddies/Get User _Info..."), "<CTL>I", pidgin_dialogs_info, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_USER_INFO }, 3070 { N_("/Buddies/Get User _Info..."), "<CTL>I", pidgin_dialogs_info, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_USER_INFO },
3071 { N_("/Buddies/View User _Log..."), "<CTL>L", pidgin_dialogs_log, 0, "<Item>", NULL }, 3071 { N_("/Buddies/View User _Log..."), "<CTL>L", pidgin_dialogs_log, 0, "<Item>", NULL },
3072 { "/Buddies/sep1", NULL, NULL, 0, "<Separator>", NULL }, 3072 { "/Buddies/sep1", NULL, NULL, 0, "<Separator>", NULL },
3073 { N_("/Buddies/Show"), NULL, NULL, 0, "<Branch>", NULL}, 3073 { N_("/Buddies/Sh_ow"), NULL, NULL, 0, "<Branch>", NULL},
3074 { N_("/Buddies/Show/_Offline Buddies"), NULL, pidgin_blist_edit_mode_cb, 1, "<CheckItem>", NULL }, 3074 { N_("/Buddies/Show/_Offline Buddies"), NULL, pidgin_blist_edit_mode_cb, 1, "<CheckItem>", NULL },
3075 { N_("/Buddies/Show/_Empty Groups"), NULL, pidgin_blist_show_empty_groups_cb, 1, "<CheckItem>", NULL }, 3075 { N_("/Buddies/Show/_Empty Groups"), NULL, pidgin_blist_show_empty_groups_cb, 1, "<CheckItem>", NULL },
3076 { N_("/Buddies/Show/Buddy _Details"), NULL, pidgin_blist_buddy_details_cb, 1, "<CheckItem>", NULL }, 3076 { N_("/Buddies/Show/Buddy _Details"), NULL, pidgin_blist_buddy_details_cb, 1, "<CheckItem>", NULL },
3077 { N_("/Buddies/Show/Idle _Times"), NULL, pidgin_blist_show_idle_time_cb, 1, "<CheckItem>", NULL }, 3077 { N_("/Buddies/Show/Idle _Times"), NULL, pidgin_blist_show_idle_time_cb, 1, "<CheckItem>", NULL },
3078 { N_("/Buddies/Show/_Protocol Icons"), NULL, pidgin_blist_show_protocol_icons_cb, 1, "<CheckItem>", NULL }, 3078 { N_("/Buddies/Show/_Protocol Icons"), NULL, pidgin_blist_show_protocol_icons_cb, 1, "<CheckItem>", NULL },
3661 idletime = g_strdup_printf(_("Idle %dm"), imin); 3661 idletime = g_strdup_printf(_("Idle %dm"), imin);
3662 } 3662 }
3663 else 3663 else
3664 idletime = g_strdup(_("Idle")); 3664 idletime = g_strdup(_("Idle"));
3665 3665
3666 if (!selected) 3666 if (!selected) {
3667 g_free(text);
3667 text = g_strdup_printf("<span color='%s'>%s</span>\n" 3668 text = g_strdup_printf("<span color='%s'>%s</span>\n"
3668 "<span color='%s' size='smaller'>%s%s%s</span>", 3669 "<span color='%s' size='smaller'>%s%s%s</span>",
3669 dim_grey(), esc, dim_grey(), 3670 dim_grey(), esc, dim_grey(),
3670 idletime != NULL ? idletime : "", 3671 idletime != NULL ? idletime : "",
3671 (idletime != NULL && statustext != NULL) ? " - " : "", 3672 (idletime != NULL && statustext != NULL) ? " - " : "",
3672 statustext != NULL ? statustext : ""); 3673 statustext != NULL ? statustext : "");
3673 } 3674 }
3674 else if (!selected && !statustext) /* We handle selected text later */ 3675 }
3676 else if (!selected && !statustext) {/* We handle selected text later */
3677 g_free(text);
3675 text = g_strdup_printf("<span color='%s'>%s</span>", dim_grey(), esc); 3678 text = g_strdup_printf("<span color='%s'>%s</span>", dim_grey(), esc);
3676 else if (!selected && !text) 3679 } else if (!selected && !text) {
3680 g_free(text);
3677 text = g_strdup_printf("<span color='%s'>%s</span>\n" 3681 text = g_strdup_printf("<span color='%s'>%s</span>\n"
3678 "<span color='%s' size='smaller'>%s</span>", 3682 "<span color='%s' size='smaller'>%s</span>",
3679 dim_grey(), esc, dim_grey(), 3683 dim_grey(), esc, dim_grey(),
3680 statustext != NULL ? statustext : ""); 3684 statustext != NULL ? statustext : "");
3685 }
3681 } else if (!PURPLE_BUDDY_IS_ONLINE(b)) { 3686 } else if (!PURPLE_BUDDY_IS_ONLINE(b)) {
3682 if (!selected && !statustext) /* We handle selected text later */ 3687 if (!selected && !statustext) {/* We handle selected text later */
3688 g_free(text);
3683 text = g_strdup_printf("<span color='%s'>%s</span>", dim_grey(), esc); 3689 text = g_strdup_printf("<span color='%s'>%s</span>", dim_grey(), esc);
3684 else if (!selected && !text) 3690 } else if (!selected && !text)
3685 text = g_strdup_printf("<span color='%s'>%s</span>\n" 3691 text = g_strdup_printf("<span color='%s'>%s</span>\n"
3686 "<span color='%s' size='smaller'>%s</span>", 3692 "<span color='%s' size='smaller'>%s</span>",
3687 dim_grey(), esc, dim_grey(), 3693 dim_grey(), esc, dim_grey(),
3688 statustext != NULL ? statustext : ""); 3694 statustext != NULL ? statustext : "");
3689 3695
3696 esc, dim_grey(), 3702 esc, dim_grey(),
3697 statustext != NULL ? statustext : ""); 3703 statustext != NULL ? statustext : "");
3698 } 3704 }
3699 3705
3700 /* It is selected. */ 3706 /* It is selected. */
3701 if ((selected && !text) || (selected && idletime)) 3707 if ((selected && !text) || (selected && idletime)) {
3708 g_free(text);
3702 text = g_strdup_printf("%s\n" 3709 text = g_strdup_printf("%s\n"
3703 "<span size='smaller'>%s%s%s</span>", 3710 "<span size='smaller'>%s%s%s</span>",
3704 esc, 3711 esc,
3705 idletime != NULL ? idletime : "", 3712 idletime != NULL ? idletime : "",
3706 (idletime != NULL && statustext != NULL) ? " - " : "", 3713 (idletime != NULL && statustext != NULL) ? " - " : "",
3707 statustext != NULL ? statustext : ""); 3714 statustext != NULL ? statustext : "");
3715 }
3708 3716
3709 g_free(idletime); 3717 g_free(idletime);
3710 g_free(statustext); 3718 g_free(statustext);
3711 g_free(esc); 3719 g_free(esc);
3712 3720
4337 static void 4345 static void
4338 create_connection_error_buttons(gpointer key, gpointer value, 4346 create_connection_error_buttons(gpointer key, gpointer value,
4339 gpointer user_data) 4347 gpointer user_data)
4340 { 4348 {
4341 PurpleAccount *account; 4349 PurpleAccount *account;
4342 PurpleStatusType *status_type;
4343 gchar *escaped, *text; 4350 gchar *escaped, *text;
4344 GtkWidget *button, *label, *image, *hbox; 4351 GtkWidget *button, *label, *image, *hbox;
4345 GdkPixbuf *pixbuf; 4352 GdkPixbuf *pixbuf;
4346 4353
4347 account = key; 4354 account = key;
4352 g_free(escaped); 4359 g_free(escaped);
4353 4360
4354 hbox = gtk_hbox_new(FALSE, 6); 4361 hbox = gtk_hbox_new(FALSE, 6);
4355 4362
4356 /* Create the icon */ 4363 /* Create the icon */
4357 if ((status_type = purple_account_get_status_type_with_primitive(account, 4364 if (purple_account_get_status_type_with_primitive(account,
4358 PURPLE_STATUS_OFFLINE))) { 4365 PURPLE_STATUS_OFFLINE) != NULL) {
4359 pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL); 4366 pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL);
4360 if (pixbuf != NULL) { 4367 if (pixbuf != NULL) {
4361 image = gtk_image_new_from_pixbuf(pixbuf); 4368 image = gtk_image_new_from_pixbuf(pixbuf);
4362 g_object_unref(pixbuf); 4369 g_object_unref(pixbuf);
4363 4370
5357 IDLE_COLUMN, idle, 5364 IDLE_COLUMN, idle,
5358 IDLE_VISIBLE_COLUMN, !biglist && idle, 5365 IDLE_VISIBLE_COLUMN, !biglist && idle,
5359 BUDDY_ICON_COLUMN, avatar, 5366 BUDDY_ICON_COLUMN, avatar,
5360 BUDDY_ICON_VISIBLE_COLUMN, biglist, 5367 BUDDY_ICON_VISIBLE_COLUMN, biglist,
5361 EMBLEM_COLUMN, emblem, 5368 EMBLEM_COLUMN, emblem,
5362 EMBLEM_VISIBLE_COLUMN, emblem, 5369 EMBLEM_VISIBLE_COLUMN, (emblem != NULL),
5363 PROTOCOL_ICON_COLUMN, pidgin_create_prpl_icon(buddy->account, PIDGIN_PRPL_ICON_SMALL), 5370 PROTOCOL_ICON_COLUMN, pidgin_create_prpl_icon(buddy->account, PIDGIN_PRPL_ICON_SMALL),
5364 PROTOCOL_ICON_VISIBLE_COLUMN, purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons"), 5371 PROTOCOL_ICON_VISIBLE_COLUMN, purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons"),
5365 BGCOLOR_COLUMN, NULL, 5372 BGCOLOR_COLUMN, NULL,
5366 CONTACT_EXPANDER_COLUMN, NULL, 5373 CONTACT_EXPANDER_COLUMN, NULL,
5367 CONTACT_EXPANDER_VISIBLE_COLUMN, expanded, 5374 CONTACT_EXPANDER_VISIBLE_COLUMN, expanded,
5368 GROUP_EXPANDER_VISIBLE_COLUMN, FALSE, 5375 GROUP_EXPANDER_VISIBLE_COLUMN, FALSE,
5369 -1); 5376 -1);
5370 5377
5371 g_free(mark); 5378 g_free(mark);
5372 g_free(idle); 5379 g_free(idle);
5380 if(emblem)
5381 g_object_unref(emblem);
5373 if(status) 5382 if(status)
5374 g_object_unref(status); 5383 g_object_unref(status);
5375 if(avatar) 5384 if(avatar)
5376 g_object_unref(avatar); 5385 g_object_unref(avatar);
5377 } 5386 }
5539 NAME_COLUMN, mark, 5548 NAME_COLUMN, mark,
5540 GROUP_EXPANDER_VISIBLE_COLUMN, FALSE, 5549 GROUP_EXPANDER_VISIBLE_COLUMN, FALSE,
5541 -1); 5550 -1);
5542 5551
5543 g_free(mark); 5552 g_free(mark);
5553 if(emblem)
5554 g_object_unref(emblem);
5544 if(status) 5555 if(status)
5545 g_object_unref(status); 5556 g_object_unref(status);
5546 if(avatar) 5557 if(avatar)
5547 g_object_unref(avatar); 5558 g_object_unref(avatar);
5548 } else { 5559 } else {