Tagged for release 2.26.0.
[empathy-mirror.git] / gnome-2-26 / tests / contact-manager.c
blob7793b44d9832430abdb74ede6584766a3aa93336
1 #include <stdlib.h>
3 #include <glib.h>
4 #include <gtk/gtk.h>
5 #include <libempathy/empathy-contact-manager.h>
6 #include <libempathy/empathy-debug.h>
8 #include <libempathy-gtk/empathy-contact-list-store.h>
9 #include <libempathy-gtk/empathy-ui-utils.h>
11 int
12 main (int argc, char **argv)
14 EmpathyContactManager *manager;
15 GMainLoop *main_loop;
16 EmpathyContactListStore *store;
17 GtkWidget *combo;
18 GtkWidget *window;
19 GtkCellRenderer *renderer;
21 gtk_init (&argc, &argv);
22 empathy_gtk_init ();
24 empathy_debug_set_flags (g_getenv ("EMPATHY_DEBUG"));
25 main_loop = g_main_loop_new (NULL, FALSE);
26 manager = empathy_contact_manager_dup_singleton ();
27 store = empathy_contact_list_store_new (EMPATHY_CONTACT_LIST (manager));
28 empathy_contact_list_store_set_is_compact (store, TRUE);
29 empathy_contact_list_store_set_show_groups (store, FALSE);
30 combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store));
31 renderer = gtk_cell_renderer_text_new ();
32 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, TRUE);
33 gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (combo), renderer, "text", EMPATHY_CONTACT_LIST_STORE_COL_NAME);
34 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
35 gtk_container_add (GTK_CONTAINER (window), combo);
36 gtk_widget_show (combo);
37 gtk_widget_show (window);
38 g_object_unref (manager);
40 gtk_main ();
42 return EXIT_SUCCESS;