]> git.0d.be Git - empathy.git/blob - tests/interactive/contact-manager.c
Merge remote-tracking branch 'glassrose/moving-part-functionality-to-empathy-chat...
[empathy.git] / tests / interactive / contact-manager.c
1 #include <stdlib.h>
2
3 #include <glib.h>
4 #include <gtk/gtk.h>
5 #include <libempathy/empathy-contact-manager.h>
6 #include <libempathy/empathy-debug.h>
7
8 #include <libempathy-gtk/empathy-contact-list-store.h>
9 #include <libempathy-gtk/empathy-ui-utils.h>
10
11 int
12 main (int argc, char **argv)
13 {
14         EmpathyContactManager *manager;
15         EmpathyContactListStore *store;
16         GtkWidget *combo;
17         GtkWidget *window;
18         GtkCellRenderer *renderer;
19
20         gtk_init (&argc, &argv);
21         empathy_gtk_init ();
22
23         empathy_debug_set_flags (g_getenv ("EMPATHY_DEBUG"));
24         g_main_loop_new (NULL, FALSE);
25         manager = empathy_contact_manager_dup_singleton ();
26         store = empathy_contact_list_store_new (EMPATHY_CONTACT_LIST (manager));
27         empathy_contact_list_store_set_is_compact (store, TRUE);
28         empathy_contact_list_store_set_show_groups (store, FALSE);
29         combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store));
30         renderer = gtk_cell_renderer_text_new ();
31         gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, TRUE);
32         gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (combo), renderer, "text", EMPATHY_CONTACT_LIST_STORE_COL_NAME);
33         window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
34         gtk_container_add (GTK_CONTAINER (window), combo);
35         gtk_widget_show (combo);
36         gtk_widget_show (window);
37         g_object_unref (manager);
38
39         gtk_main ();
40
41         return EXIT_SUCCESS;
42 }
43