Mercurial > pidgin.yaz
comparison pidgin/gtkblist.c @ 19477:b1e7dfd662fb
merge of '04b3e8958ef3758cefdb2c6a32a676b131aee0cc'
and '94992c974e7a4eec0ac0f35b8db1ac816590cb56'
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Mon, 27 Aug 2007 22:20:13 +0000 |
parents | 74befdcd0454 |
children | 47a2d00ab060 |
comparison
equal
deleted
inserted
replaced
19476:a0654397cf9b | 19477:b1e7dfd662fb |
---|---|
1534 | 1534 |
1535 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time", | 1535 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time", |
1536 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item))); | 1536 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item))); |
1537 | 1537 |
1538 pidgin_clear_cursor(gtkblist->window); | 1538 pidgin_clear_cursor(gtkblist->window); |
1539 } | |
1540 | |
1541 static void pidgin_blist_show_protocol_icons_cb(gpointer data, guint action, GtkWidget *item) | |
1542 { | |
1543 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons", | |
1544 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item))); | |
1539 } | 1545 } |
1540 | 1546 |
1541 static void pidgin_blist_show_empty_groups_cb(gpointer data, guint action, GtkWidget *item) | 1547 static void pidgin_blist_show_empty_groups_cb(gpointer data, guint action, GtkWidget *item) |
1542 { | 1548 { |
1543 pidgin_set_cursor(gtkblist->window, GDK_WATCH); | 1549 pidgin_set_cursor(gtkblist->window, GDK_WATCH); |
2853 { N_("/Buddies/New Instant _Message..."), "<CTL>M", pidgin_dialogs_im, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW }, | 2859 { N_("/Buddies/New Instant _Message..."), "<CTL>M", pidgin_dialogs_im, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW }, |
2854 { N_("/Buddies/Join a _Chat..."), "<CTL>C", pidgin_blist_joinchat_show, 0, "<Item>", NULL }, | 2860 { N_("/Buddies/Join a _Chat..."), "<CTL>C", pidgin_blist_joinchat_show, 0, "<Item>", NULL }, |
2855 { N_("/Buddies/Get User _Info..."), "<CTL>I", pidgin_dialogs_info, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_USER_INFO }, | 2861 { N_("/Buddies/Get User _Info..."), "<CTL>I", pidgin_dialogs_info, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_USER_INFO }, |
2856 { N_("/Buddies/View User _Log..."), "<CTL>L", pidgin_dialogs_log, 0, "<Item>", NULL }, | 2862 { N_("/Buddies/View User _Log..."), "<CTL>L", pidgin_dialogs_log, 0, "<Item>", NULL }, |
2857 { "/Buddies/sep1", NULL, NULL, 0, "<Separator>", NULL }, | 2863 { "/Buddies/sep1", NULL, NULL, 0, "<Separator>", NULL }, |
2858 { N_("/Buddies/Show _Offline Buddies"), NULL, pidgin_blist_edit_mode_cb, 1, "<CheckItem>", NULL }, | 2864 { N_("/Buddies/Show"), NULL, NULL, 0, "<Branch>", NULL}, |
2859 { N_("/Buddies/Show _Empty Groups"), NULL, pidgin_blist_show_empty_groups_cb, 1, "<CheckItem>", NULL }, | 2865 { N_("/Buddies/Show/Show _Offline Buddies"), NULL, pidgin_blist_edit_mode_cb, 1, "<CheckItem>", NULL }, |
2860 { N_("/Buddies/Show Buddy _Details"), NULL, pidgin_blist_buddy_details_cb, 1, "<CheckItem>", NULL }, | 2866 { N_("/Buddies/Show/Show _Empty Groups"), NULL, pidgin_blist_show_empty_groups_cb, 1, "<CheckItem>", NULL }, |
2861 { N_("/Buddies/Show Idle _Times"), NULL, pidgin_blist_show_idle_time_cb, 1, "<CheckItem>", NULL }, | 2867 { N_("/Buddies/Show/Show Buddy _Details"), NULL, pidgin_blist_buddy_details_cb, 1, "<CheckItem>", NULL }, |
2868 { N_("/Buddies/Show/Show Idle _Times"), NULL, pidgin_blist_show_idle_time_cb, 1, "<CheckItem>", NULL }, | |
2869 { N_("/Buddies/Show/Show _Protocol Icons"), NULL, pidgin_blist_show_protocol_icons_cb, 1, "<CheckItem>", NULL }, | |
2862 { N_("/Buddies/_Sort Buddies"), NULL, NULL, 0, "<Branch>", NULL }, | 2870 { N_("/Buddies/_Sort Buddies"), NULL, NULL, 0, "<Branch>", NULL }, |
2863 { "/Buddies/sep2", NULL, NULL, 0, "<Separator>", NULL }, | 2871 { "/Buddies/sep2", NULL, NULL, 0, "<Separator>", NULL }, |
2864 { N_("/Buddies/_Add Buddy..."), "<CTL>B", pidgin_blist_add_buddy_cb, 0, "<StockItem>", GTK_STOCK_ADD }, | 2872 { N_("/Buddies/_Add Buddy..."), "<CTL>B", pidgin_blist_add_buddy_cb, 0, "<StockItem>", GTK_STOCK_ADD }, |
2865 { N_("/Buddies/Add C_hat..."), NULL, pidgin_blist_add_chat_cb, 0, "<StockItem>", GTK_STOCK_ADD }, | 2873 { N_("/Buddies/Add C_hat..."), NULL, pidgin_blist_add_chat_cb, 0, "<StockItem>", GTK_STOCK_ADD }, |
2866 { N_("/Buddies/Add _Group..."), NULL, purple_blist_request_add_group, 0, "<StockItem>", GTK_STOCK_ADD }, | 2874 { N_("/Buddies/Add _Group..."), NULL, purple_blist_request_add_group, 0, "<StockItem>", GTK_STOCK_ADD }, |
3141 ret = gdk_pixbuf_new_from_file(path, NULL); | 3149 ret = gdk_pixbuf_new_from_file(path, NULL); |
3142 g_free(path); | 3150 g_free(path); |
3143 return ret; | 3151 return ret; |
3144 } | 3152 } |
3145 | 3153 |
3146 if (((struct _pidgin_blist_node*)(node->parent->ui_data))->contact_expanded) | 3154 if (((struct _pidgin_blist_node*)(node->parent->ui_data))->contact_expanded) { |
3155 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons")) | |
3156 return NULL; | |
3147 return pidgin_create_prpl_icon(((PurpleBuddy*)node)->account, PIDGIN_PRPL_ICON_SMALL); | 3157 return pidgin_create_prpl_icon(((PurpleBuddy*)node)->account, PIDGIN_PRPL_ICON_SMALL); |
3148 } else if(PURPLE_BLIST_NODE_IS_CHAT(node)) { | 3158 } |
3149 return pidgin_create_prpl_icon(((PurpleChat*)node)->account, PIDGIN_PRPL_ICON_SMALL); | |
3150 } else { | 3159 } else { |
3151 return NULL; | 3160 return NULL; |
3152 } | 3161 } |
3153 | 3162 |
3154 if (!purple_privacy_check(buddy->account, purple_buddy_get_name(buddy))) { | 3163 if (!purple_privacy_check(buddy->account, purple_buddy_get_name(buddy))) { |
4403 G_TYPE_BOOLEAN, /* Group expander */ | 4412 G_TYPE_BOOLEAN, /* Group expander */ |
4404 G_TYPE_BOOLEAN, /* Group expander visible */ | 4413 G_TYPE_BOOLEAN, /* Group expander visible */ |
4405 G_TYPE_BOOLEAN, /* Contact expander */ | 4414 G_TYPE_BOOLEAN, /* Contact expander */ |
4406 G_TYPE_BOOLEAN, /* Contact expander visible */ | 4415 G_TYPE_BOOLEAN, /* Contact expander visible */ |
4407 GDK_TYPE_PIXBUF, /* Emblem */ | 4416 GDK_TYPE_PIXBUF, /* Emblem */ |
4408 G_TYPE_BOOLEAN); /* Emblem visible */ | 4417 G_TYPE_BOOLEAN, /* Emblem visible */ |
4418 GDK_TYPE_PIXBUF, /* Protocol icon */ | |
4419 G_TYPE_BOOLEAN /* Protocol visible */ | |
4420 ); | |
4409 | 4421 |
4410 gtkblist->treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(gtkblist->treemodel)); | 4422 gtkblist->treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(gtkblist->treemodel)); |
4411 | 4423 |
4412 gtk_widget_show(gtkblist->treeview); | 4424 gtk_widget_show(gtkblist->treeview); |
4413 gtk_widget_set_name(gtkblist->treeview, "pidgin_blist_treeview"); | 4425 gtk_widget_set_name(gtkblist->treeview, "pidgin_blist_treeview"); |
4518 "cell-background-gdk", BGCOLOR_COLUMN, | 4530 "cell-background-gdk", BGCOLOR_COLUMN, |
4519 #endif | 4531 #endif |
4520 "visible", EMBLEM_VISIBLE_COLUMN, NULL); | 4532 "visible", EMBLEM_VISIBLE_COLUMN, NULL); |
4521 | 4533 |
4522 rend = gtk_cell_renderer_pixbuf_new(); | 4534 rend = gtk_cell_renderer_pixbuf_new(); |
4535 gtk_tree_view_column_pack_start(column, rend, FALSE); | |
4536 gtk_tree_view_column_set_attributes(column, rend, | |
4537 "pixbuf", PROTOCOL_ICON_COLUMN, | |
4538 "visible", PROTOCOL_ICON_VISIBLE_COLUMN, | |
4539 #if GTK_CHECK_VERSION(2,6,0) | |
4540 "cell-background-gdk", BGCOLOR_COLUMN, | |
4541 #endif | |
4542 NULL); | |
4543 g_object_set(rend, "xalign", 0.0, "xpad", 3, "ypad", 0, NULL); | |
4544 | |
4545 rend = gtk_cell_renderer_pixbuf_new(); | |
4523 g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL); | 4546 g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL); |
4524 gtk_tree_view_column_pack_start(column, rend, FALSE); | 4547 gtk_tree_view_column_pack_start(column, rend, FALSE); |
4525 gtk_tree_view_column_set_attributes(column, rend, "pixbuf", BUDDY_ICON_COLUMN, | 4548 gtk_tree_view_column_set_attributes(column, rend, "pixbuf", BUDDY_ICON_COLUMN, |
4526 #if GTK_CHECK_VERSION(2,6,0) | 4549 #if GTK_CHECK_VERSION(2,6,0) |
4527 "cell-background-gdk", BGCOLOR_COLUMN, | 4550 "cell-background-gdk", BGCOLOR_COLUMN, |
4563 gtk_widget_show(gtkblist->statusbox); | 4586 gtk_widget_show(gtkblist->statusbox); |
4564 | 4587 |
4565 /* set the Show Offline Buddies option. must be done | 4588 /* set the Show Offline Buddies option. must be done |
4566 * after the treeview or faceprint gets mad. -Robot101 | 4589 * after the treeview or faceprint gets mad. -Robot101 |
4567 */ | 4590 */ |
4568 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Buddies/Show Offline Buddies"))), | 4591 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Buddies/Show/Show Offline Buddies"))), |
4569 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies")); | 4592 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies")); |
4570 | 4593 |
4571 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Buddies/Show Empty Groups"))), | 4594 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Buddies/Show/Show Empty Groups"))), |
4572 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups")); | 4595 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups")); |
4573 | 4596 |
4574 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Tools/Mute Sounds"))), | 4597 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Tools/Mute Sounds"))), |
4575 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/sound/mute")); | 4598 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/sound/mute")); |
4576 | 4599 |
4577 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Buddies/Show Buddy Details"))), | 4600 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Buddies/Show/Show Buddy Details"))), |
4578 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons")); | 4601 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons")); |
4579 | 4602 |
4580 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Buddies/Show Idle Times"))), | 4603 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Buddies/Show/Show Idle Times"))), |
4581 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time")); | 4604 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time")); |
4605 | |
4606 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Buddies/Show/Show Protocol Icons"))), | |
4607 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons")); | |
4582 | 4608 |
4583 if(!strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), "none")) | 4609 if(!strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), "none")) |
4584 gtk_widget_set_sensitive(gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Mute Sounds")), FALSE); | 4610 gtk_widget_set_sensitive(gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Mute Sounds")), FALSE); |
4585 | 4611 |
4586 /* Update some dynamic things */ | 4612 /* Update some dynamic things */ |
4606 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_idle_time", | 4632 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_idle_time", |
4607 _prefs_change_redo_list, NULL); | 4633 _prefs_change_redo_list, NULL); |
4608 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_empty_groups", | 4634 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_empty_groups", |
4609 _prefs_change_redo_list, NULL); | 4635 _prefs_change_redo_list, NULL); |
4610 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_offline_buddies", | 4636 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_offline_buddies", |
4637 _prefs_change_redo_list, NULL); | |
4638 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_protocol_icons", | |
4611 _prefs_change_redo_list, NULL); | 4639 _prefs_change_redo_list, NULL); |
4612 | 4640 |
4613 /* sorting */ | 4641 /* sorting */ |
4614 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/sort_type", | 4642 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/sort_type", |
4615 _prefs_change_sort_method, NULL); | 4643 _prefs_change_sort_method, NULL); |
5038 IDLE_VISIBLE_COLUMN, !biglist && idle, | 5066 IDLE_VISIBLE_COLUMN, !biglist && idle, |
5039 BUDDY_ICON_COLUMN, avatar, | 5067 BUDDY_ICON_COLUMN, avatar, |
5040 BUDDY_ICON_VISIBLE_COLUMN, biglist, | 5068 BUDDY_ICON_VISIBLE_COLUMN, biglist, |
5041 EMBLEM_COLUMN, emblem, | 5069 EMBLEM_COLUMN, emblem, |
5042 EMBLEM_VISIBLE_COLUMN, emblem, | 5070 EMBLEM_VISIBLE_COLUMN, emblem, |
5071 PROTOCOL_ICON_COLUMN, pidgin_create_prpl_icon(buddy->account, PIDGIN_PRPL_ICON_SMALL), | |
5072 PROTOCOL_ICON_VISIBLE_COLUMN, purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons"), | |
5043 BGCOLOR_COLUMN, NULL, | 5073 BGCOLOR_COLUMN, NULL, |
5044 CONTACT_EXPANDER_COLUMN, NULL, | 5074 CONTACT_EXPANDER_COLUMN, NULL, |
5045 CONTACT_EXPANDER_VISIBLE_COLUMN, expanded, | 5075 CONTACT_EXPANDER_VISIBLE_COLUMN, expanded, |
5046 GROUP_EXPANDER_VISIBLE_COLUMN, FALSE, | 5076 GROUP_EXPANDER_VISIBLE_COLUMN, FALSE, |
5047 -1); | 5077 -1); |
5198 STATUS_ICON_VISIBLE_COLUMN, TRUE, | 5228 STATUS_ICON_VISIBLE_COLUMN, TRUE, |
5199 BUDDY_ICON_COLUMN, avatar ? avatar : gtkblist->empty_avatar, | 5229 BUDDY_ICON_COLUMN, avatar ? avatar : gtkblist->empty_avatar, |
5200 BUDDY_ICON_VISIBLE_COLUMN, purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons"), | 5230 BUDDY_ICON_VISIBLE_COLUMN, purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons"), |
5201 EMBLEM_COLUMN, emblem, | 5231 EMBLEM_COLUMN, emblem, |
5202 EMBLEM_VISIBLE_COLUMN, emblem != NULL, | 5232 EMBLEM_VISIBLE_COLUMN, emblem != NULL, |
5233 PROTOCOL_ICON_COLUMN, pidgin_create_prpl_icon(chat->account, PIDGIN_PRPL_ICON_SMALL), | |
5234 PROTOCOL_ICON_VISIBLE_COLUMN, purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons"), | |
5203 NAME_COLUMN, mark, | 5235 NAME_COLUMN, mark, |
5204 GROUP_EXPANDER_VISIBLE_COLUMN, FALSE, | 5236 GROUP_EXPANDER_VISIBLE_COLUMN, FALSE, |
5205 -1); | 5237 -1); |
5206 | 5238 |
5207 g_free(mark); | 5239 g_free(mark); |
6091 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/blist"); | 6123 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/blist"); |
6092 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons", TRUE); | 6124 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons", TRUE); |
6093 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups", FALSE); | 6125 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups", FALSE); |
6094 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time", TRUE); | 6126 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time", TRUE); |
6095 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies", FALSE); | 6127 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies", FALSE); |
6128 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons", FALSE); | |
6096 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/list_visible", FALSE); | 6129 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/list_visible", FALSE); |
6097 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/list_maximized", FALSE); | 6130 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/list_maximized", FALSE); |
6098 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/blist/sort_type", "alphabetical"); | 6131 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/blist/sort_type", "alphabetical"); |
6099 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/x", 0); | 6132 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/x", 0); |
6100 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/y", 0); | 6133 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/y", 0); |