5 #include <libempathy/empathy-contact-manager.h>
6 #include <libempathy/empathy-dispatcher.h>
8 #include <libempathy-gtk/empathy-contact-list-store.h>
9 #include <libempathy-gtk/empathy-contact-selector.h>
13 destroy_cb (GtkWidget *widget,
21 clicked_cb (GtkButton *button,
24 EmpathyContactSelector *selector = EMPATHY_CONTACT_SELECTOR (data);
25 EmpathyContact *contact;
27 contact = empathy_contact_selector_get_selected (selector);
32 empathy_dispatcher_chat_with_contact (contact);
39 EmpathyContactManager *manager;
40 EmpathyContactListStore *store;
41 EmpathyContactSelector *selector;
42 GtkWidget *window, *vbox, *button;
45 gtk_init (&argc, &argv);
47 icon_path = g_build_path (G_DIR_SEPARATOR_S, PKGDATADIR, "icons", NULL);
48 gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (), icon_path);
51 manager = empathy_contact_manager_new ();
52 store = empathy_contact_list_store_new (EMPATHY_CONTACT_LIST (manager));
54 vbox = gtk_vbox_new (FALSE, 2);
56 selector = empathy_contact_selector_new (store);
57 gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (selector), FALSE, FALSE, 5);
59 button = gtk_button_new_with_label ("Chat");
60 g_signal_connect (G_OBJECT (button), "clicked",
61 G_CALLBACK (clicked_cb), (gpointer) selector);
62 gtk_box_pack_start(GTK_BOX (vbox), button, FALSE, FALSE, 5);
64 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
65 g_signal_connect (G_OBJECT (window), "destroy",
66 G_CALLBACK (destroy_cb), NULL);
67 gtk_window_set_title (GTK_WINDOW (window),"Empetit");
68 gtk_container_set_border_width (GTK_CONTAINER (window), 5);
69 gtk_container_add (GTK_CONTAINER (window), vbox);
70 gtk_widget_show_all (window);
74 g_object_unref (store);
75 g_object_unref (manager);