Mercurial > pidgin
comparison gtk/gtkblist.c @ 14456:c9867016ccd7
[gaim-migrate @ 17170]
Get rid of old fields
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Wed, 06 Sep 2006 00:04:45 +0000 |
parents | 300946b0f4a2 |
children | a9f8d3964d62 |
comparison
equal
deleted
inserted
replaced
14455:c2c916d4d95c | 14456:c9867016ccd7 |
---|---|
3523 g_return_val_if_fail(GAIM_BLIST_NODE_IS_CONTACT(node), FALSE); | 3523 g_return_val_if_fail(GAIM_BLIST_NODE_IS_CONTACT(node), FALSE); |
3524 | 3524 |
3525 return ((struct _gaim_gtk_blist_node *)node->ui_data)->contact_expanded; | 3525 return ((struct _gaim_gtk_blist_node *)node->ui_data)->contact_expanded; |
3526 } | 3526 } |
3527 | 3527 |
3528 void gaim_gtk_blist_update_columns() | |
3529 { | |
3530 if(!gtkblist) | |
3531 return; | |
3532 | |
3533 if (gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons")) { | |
3534 gtk_tree_view_column_set_visible(gtkblist->buddy_icon_column, TRUE); | |
3535 gtk_tree_view_column_set_visible(gtkblist->idle_column, FALSE); | |
3536 } else { | |
3537 gtk_tree_view_column_set_visible(gtkblist->idle_column, | |
3538 gaim_prefs_get_bool("/gaim/gtk/blist/show_idle_time")); | |
3539 gtk_tree_view_column_set_visible(gtkblist->buddy_icon_column, FALSE); | |
3540 } | |
3541 } | |
3542 | |
3543 static void | |
3544 show_buddy_icons_pref_cb(const char *name, GaimPrefType type, | |
3545 gconstpointer val, gpointer data) | |
3546 { | |
3547 gaim_gtk_blist_update_columns(); | |
3548 } | |
3549 | |
3550 enum { | 3528 enum { |
3551 DRAG_BUDDY, | 3529 DRAG_BUDDY, |
3552 DRAG_ROW, | 3530 DRAG_ROW, |
3553 DRAG_VCARD, | 3531 DRAG_VCARD, |
3554 DRAG_TEXT, | 3532 DRAG_TEXT, |
3951 | 3929 |
3952 gtkblist->treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(gtkblist->treemodel)); | 3930 gtkblist->treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(gtkblist->treemodel)); |
3953 | 3931 |
3954 gtk_widget_show(gtkblist->treeview); | 3932 gtk_widget_show(gtkblist->treeview); |
3955 gtk_widget_set_name(gtkblist->treeview, "gaim_gtkblist_treeview"); | 3933 gtk_widget_set_name(gtkblist->treeview, "gaim_gtkblist_treeview"); |
3934 /* gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(gtkblist->treeview), TRUE); */ | |
3956 | 3935 |
3957 /* Set up selection stuff */ | 3936 /* Set up selection stuff */ |
3958 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(gtkblist->treeview)); | 3937 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(gtkblist->treeview)); |
3959 g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(gaim_gtk_blist_selection_changed), NULL); | 3938 g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(gaim_gtk_blist_selection_changed), NULL); |
3960 | 3939 |
4055 gtk_tree_view_set_search_column(GTK_TREE_VIEW(gtkblist->treeview), NAME_COLUMN); | 4034 gtk_tree_view_set_search_column(GTK_TREE_VIEW(gtkblist->treeview), NAME_COLUMN); |
4056 gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(gtkblist->treeview), _search_func, NULL, NULL); | 4035 gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(gtkblist->treeview), _search_func, NULL, NULL); |
4057 | 4036 |
4058 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), sw, TRUE, TRUE, 0); | 4037 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), sw, TRUE, TRUE, 0); |
4059 gtk_container_add(GTK_CONTAINER(sw), gtkblist->treeview); | 4038 gtk_container_add(GTK_CONTAINER(sw), gtkblist->treeview); |
4060 gaim_gtk_blist_update_columns(); | |
4061 | 4039 |
4062 /* Create an empty vbox used for showing connection errors */ | 4040 /* Create an empty vbox used for showing connection errors */ |
4063 gtkblist->error_buttons = gtk_vbox_new(FALSE, 0); | 4041 gtkblist->error_buttons = gtk_vbox_new(FALSE, 0); |
4064 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->error_buttons, FALSE, FALSE, 0); | 4042 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->error_buttons, FALSE, FALSE, 0); |
4065 | 4043 |
4117 _prefs_change_redo_list, NULL); | 4095 _prefs_change_redo_list, NULL); |
4118 | 4096 |
4119 /* sorting */ | 4097 /* sorting */ |
4120 gaim_prefs_connect_callback(handle, "/gaim/gtk/blist/sort_type", | 4098 gaim_prefs_connect_callback(handle, "/gaim/gtk/blist/sort_type", |
4121 _prefs_change_sort_method, NULL); | 4099 _prefs_change_sort_method, NULL); |
4122 | |
4123 /* things that affect what columns are displayed */ | |
4124 gaim_prefs_connect_callback(handle, "/gaim/gtk/blist/show_buddy_icons", | |
4125 show_buddy_icons_pref_cb, NULL); | |
4126 gaim_prefs_connect_callback(handle, "/gaim/gtk/blist/show_idle_time", | |
4127 show_buddy_icons_pref_cb, NULL); | |
4128 | 4100 |
4129 /* menus */ | 4101 /* menus */ |
4130 gaim_prefs_connect_callback(handle, "/gaim/gtk/sound/mute", | 4102 gaim_prefs_connect_callback(handle, "/gaim/gtk/sound/mute", |
4131 gaim_gtk_blist_mute_pref_cb, NULL); | 4103 gaim_gtk_blist_mute_pref_cb, NULL); |
4132 gaim_prefs_connect_callback(handle, "/gaim/gtk/sound/method", | 4104 gaim_prefs_connect_callback(handle, "/gaim/gtk/sound/method", |
4718 gtkblist->refresh_timer = 0; | 4690 gtkblist->refresh_timer = 0; |
4719 gtkblist->timeout = 0; | 4691 gtkblist->timeout = 0; |
4720 gtkblist->drag_timeout = 0; | 4692 gtkblist->drag_timeout = 0; |
4721 gtkblist->window = gtkblist->vbox = gtkblist->treeview = NULL; | 4693 gtkblist->window = gtkblist->vbox = gtkblist->treeview = NULL; |
4722 gtkblist->treemodel = NULL; | 4694 gtkblist->treemodel = NULL; |
4723 gtkblist->idle_column = NULL; | |
4724 gtkblist->buddy_icon_column = NULL; | |
4725 g_object_unref(G_OBJECT(gtkblist->ift)); | 4695 g_object_unref(G_OBJECT(gtkblist->ift)); |
4726 g_free(gtkblist); | 4696 g_free(gtkblist); |
4727 accountmenu = NULL; | 4697 accountmenu = NULL; |
4728 gtkblist = NULL; | 4698 gtkblist = NULL; |
4729 | 4699 |