| 404 |
404 |
| 405 path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter); |
405 path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter); |
| 406 g_object_set(G_OBJECT(gtkblist->text_rend), "editable", TRUE, NULL); |
406 g_object_set(G_OBJECT(gtkblist->text_rend), "editable", TRUE, NULL); |
| 407 gtk_tree_view_set_enable_search (GTK_TREE_VIEW(gtkblist->treeview), FALSE); |
407 gtk_tree_view_set_enable_search (GTK_TREE_VIEW(gtkblist->treeview), FALSE); |
| 408 gtk_widget_grab_focus(gtkblist->treeview); |
408 gtk_widget_grab_focus(gtkblist->treeview); |
| |
409 #if GTK_CHECK_VERSION(2,2,0) |
| |
410 gtk_tree_view_set_cursor_on_cell(GTK_TREE_VIEW(gtkblist->treeview), path, |
| |
411 gtkblist->text_column, gtkblist->text_rend, TRUE); |
| |
412 #else |
| 409 gtk_tree_view_set_cursor(GTK_TREE_VIEW(gtkblist->treeview), path, gtkblist->text_column, TRUE); |
413 gtk_tree_view_set_cursor(GTK_TREE_VIEW(gtkblist->treeview), path, gtkblist->text_column, TRUE); |
| |
414 #endif |
| 410 gtk_tree_path_free(path); |
415 gtk_tree_path_free(path); |
| 411 } |
416 } |
| 412 |
417 |
| 413 static void gtk_blist_menu_bp_cb(GtkWidget *w, GaimBuddy *b) |
418 static void gtk_blist_menu_bp_cb(GtkWidget *w, GaimBuddy *b) |
| 414 { |
419 { |
| 3982 gtkblist->text_column = column = gtk_tree_view_column_new (); |
3987 gtkblist->text_column = column = gtk_tree_view_column_new (); |
| 3983 rend = gaim_gtk_cell_renderer_expander_new(); |
3988 rend = gaim_gtk_cell_renderer_expander_new(); |
| 3984 gtk_tree_view_column_pack_start(column, rend, FALSE); |
3989 gtk_tree_view_column_pack_start(column, rend, FALSE); |
| 3985 gtk_tree_view_column_set_attributes(column, rend, |
3990 gtk_tree_view_column_set_attributes(column, rend, |
| 3986 "expander-visible", GROUP_EXPANDER_COLUMN, |
3991 "expander-visible", GROUP_EXPANDER_COLUMN, |
| |
3992 #if GTK_CHECK_VERSION(2,6,0) |
| 3987 "sensitive", GROUP_EXPANDER_COLUMN, |
3993 "sensitive", GROUP_EXPANDER_COLUMN, |
| 3988 "cell-background-gdk", BGCOLOR_COLUMN, |
3994 "cell-background-gdk", BGCOLOR_COLUMN, |
| |
3995 #endif |
| 3989 NULL); |
3996 NULL); |
| 3990 |
3997 |
| 3991 rend = gaim_gtk_cell_renderer_expander_new(); |
3998 rend = gaim_gtk_cell_renderer_expander_new(); |
| 3992 gtk_tree_view_column_pack_start(column, rend, FALSE); |
3999 gtk_tree_view_column_pack_start(column, rend, FALSE); |
| 3993 gtk_tree_view_column_set_attributes(column, rend, |
4000 gtk_tree_view_column_set_attributes(column, rend, |
| 3994 "expander-visible", CONTACT_EXPANDER_COLUMN, |
4001 "expander-visible", CONTACT_EXPANDER_COLUMN, |
| |
4002 #if GTK_CHECK_VERSION(2,6,0) |
| 3995 "sensitive", CONTACT_EXPANDER_COLUMN, |
4003 "sensitive", CONTACT_EXPANDER_COLUMN, |
| |
4004 "cell-background-gdk", BGCOLOR_COLUMN, |
| |
4005 #endif |
| 3996 "visible", CONTACT_EXPANDER_VISIBLE_COLUMN, |
4006 "visible", CONTACT_EXPANDER_VISIBLE_COLUMN, |
| 3997 "cell-background-gdk", BGCOLOR_COLUMN, |
|
| 3998 NULL); |
4007 NULL); |
| 3999 |
4008 |
| 4000 rend = gtk_cell_renderer_pixbuf_new(); |
4009 rend = gtk_cell_renderer_pixbuf_new(); |
| 4001 gtk_tree_view_column_pack_start(column, rend, FALSE); |
4010 gtk_tree_view_column_pack_start(column, rend, FALSE); |
| 4002 gtk_tree_view_column_set_attributes(column, rend, |
4011 gtk_tree_view_column_set_attributes(column, rend, |
| 4003 "pixbuf", STATUS_ICON_COLUMN, |
4012 "pixbuf", STATUS_ICON_COLUMN, |
| 4004 "visible", STATUS_ICON_VISIBLE_COLUMN, |
4013 "visible", STATUS_ICON_VISIBLE_COLUMN, |
| |
4014 #if GTK_CHECK_VERSION(2,6,0) |
| 4005 "cell-background-gdk", BGCOLOR_COLUMN, |
4015 "cell-background-gdk", BGCOLOR_COLUMN, |
| |
4016 #endif |
| 4006 NULL); |
4017 NULL); |
| 4007 g_object_set(rend, "xalign", 0.0, "ypad", 0, NULL); |
4018 g_object_set(rend, "xalign", 0.0, "ypad", 0, NULL); |
| 4008 |
4019 |
| 4009 gtkblist->text_rend = rend = gtk_cell_renderer_text_new(); |
4020 gtkblist->text_rend = rend = gtk_cell_renderer_text_new(); |
| 4010 gtk_tree_view_column_pack_start (column, rend, TRUE); |
4021 gtk_tree_view_column_pack_start (column, rend, TRUE); |
| 4011 gtk_tree_view_column_set_attributes(column, rend, |
4022 gtk_tree_view_column_set_attributes(column, rend, |
| |
4023 #if GTK_CHECK_VERSION(2,6,0) |
| 4012 "cell-background-gdk", BGCOLOR_COLUMN, |
4024 "cell-background-gdk", BGCOLOR_COLUMN, |
| |
4025 #endif |
| 4013 "markup", NAME_COLUMN, |
4026 "markup", NAME_COLUMN, |
| 4014 NULL); |
4027 NULL); |
| 4015 g_signal_connect(G_OBJECT(rend), "edited", G_CALLBACK(gtk_blist_renderer_edited_cb), NULL); |
4028 g_signal_connect(G_OBJECT(rend), "edited", G_CALLBACK(gtk_blist_renderer_edited_cb), NULL); |
| 4016 g_object_set(rend, "ypad", 0, "yalign", 0.5, NULL); |
4029 g_object_set(rend, "ypad", 0, "yalign", 0.5, NULL); |
| 4017 #if GTK_CHECK_VERSION(2,6,0) |
4030 #if GTK_CHECK_VERSION(2,6,0) |
| 4023 g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL); |
4036 g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL); |
| 4024 gtk_tree_view_column_pack_start(column, rend, FALSE); |
4037 gtk_tree_view_column_pack_start(column, rend, FALSE); |
| 4025 gtk_tree_view_column_set_attributes(column, rend, |
4038 gtk_tree_view_column_set_attributes(column, rend, |
| 4026 "markup", IDLE_COLUMN, |
4039 "markup", IDLE_COLUMN, |
| 4027 "visible", IDLE_VISIBLE_COLUMN, |
4040 "visible", IDLE_VISIBLE_COLUMN, |
| |
4041 #if GTK_CHECK_VERSION(2,6,0) |
| 4028 "cell-background-gdk", BGCOLOR_COLUMN, |
4042 "cell-background-gdk", BGCOLOR_COLUMN, |
| |
4043 #endif |
| 4029 NULL); |
4044 NULL); |
| 4030 |
4045 |
| 4031 rend = gtk_cell_renderer_pixbuf_new(); |
4046 rend = gtk_cell_renderer_pixbuf_new(); |
| 4032 g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL); |
4047 g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL); |
| 4033 gtk_tree_view_column_pack_start(column, rend, FALSE); |
4048 gtk_tree_view_column_pack_start(column, rend, FALSE); |
| 4034 gtk_tree_view_column_set_attributes(column, rend, "pixbuf", BUDDY_ICON_COLUMN, |
4049 gtk_tree_view_column_set_attributes(column, rend, "pixbuf", BUDDY_ICON_COLUMN, |
| |
4050 #if GTK_CHECK_VERSION(2,6,0) |
| 4035 "cell-background-gdk", BGCOLOR_COLUMN, |
4051 "cell-background-gdk", BGCOLOR_COLUMN, |
| |
4052 #endif |
| 4036 "visible", BUDDY_ICON_VISIBLE_COLUMN, |
4053 "visible", BUDDY_ICON_VISIBLE_COLUMN, |
| 4037 NULL); |
4054 NULL); |
| 4038 |
4055 |
| 4039 |
4056 |
| 4040 g_signal_connect(G_OBJECT(gtkblist->treeview), "row-activated", G_CALLBACK(gtk_blist_row_activated_cb), NULL); |
4057 g_signal_connect(G_OBJECT(gtkblist->treeview), "row-activated", G_CALLBACK(gtk_blist_row_activated_cb), NULL); |