aboutsummaryrefslogtreecommitdiffstats
path: root/tests/empetit.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2009-03-17 02:38:35 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-03-17 02:38:35 +0800
commit89c57232e6091d86ed79f7a5c2010011f0e2bb11 (patch)
tree4b825dc642cb6eb9a060e54bf8d69288fbee4904 /tests/empetit.c
parent2baaa7ae3c3ac983a8019cd93a73426c7e081735 (diff)
downloadgsoc2013-empathy-EMPATHY_2_26_0_svn2702.tar
gsoc2013-empathy-EMPATHY_2_26_0_svn2702.tar.gz
gsoc2013-empathy-EMPATHY_2_26_0_svn2702.tar.bz2
gsoc2013-empathy-EMPATHY_2_26_0_svn2702.tar.lz
gsoc2013-empathy-EMPATHY_2_26_0_svn2702.tar.xz
gsoc2013-empathy-EMPATHY_2_26_0_svn2702.tar.zst
gsoc2013-empathy-EMPATHY_2_26_0_svn2702.zip
Wrongly createdEMPATHY_2_26_0_svn2702
svn path=/tags/EMPATHY_2_26_0; revision=2701
Diffstat (limited to 'tests/empetit.c')
-rw-r--r--tests/empetit.c85
1 files changed, 0 insertions, 85 deletions
diff --git a/tests/empetit.c b/tests/empetit.c
deleted file mode 100644
index 2c69d101d..000000000
--- a/tests/empetit.c
+++ /dev/null
@@ -1,85 +0,0 @@
-#include "config.h"
-
-#include <gtk/gtk.h>
-
-#include <libempathy/empathy-contact-manager.h>
-#include <libempathy/empathy-dispatcher.h>
-
-#include <libempathy-gtk/empathy-ui-utils.h>
-#include <libempathy-gtk/empathy-contact-list-store.h>
-#include <libempathy-gtk/empathy-contact-selector.h>
-
-static GtkWidget *window = NULL;
-
-static void
-chat_cb (EmpathyDispatchOperation *dispatch,
- const GError *error,
- gpointer user_data)
-{
- GtkWidget *dialog;
-
- if (error != NULL)
- {
- dialog = gtk_message_dialog_new (GTK_WINDOW (window), GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s",
- error->message ? error->message : "No error message");
-
- gtk_dialog_run (GTK_DIALOG (dialog));
- }
-
- gtk_widget_destroy (window);
-}
-
-static void
-clicked_cb (GtkButton *button,
- gpointer data)
-{
- EmpathyContactSelector *selector = EMPATHY_CONTACT_SELECTOR (data);
- EmpathyContact *contact;
-
- contact = empathy_contact_selector_dup_selected (selector);
-
- if (!contact)
- return;
-
- empathy_dispatcher_chat_with_contact (contact, chat_cb, NULL);
-
- g_object_unref (contact);
-}
-
-int main (int argc,
- char *argv[])
-{
- EmpathyContactManager *manager;
- GtkWidget *vbox, *button, *selector;
-
- gtk_init (&argc, &argv);
-
- empathy_gtk_init ();
-
- manager = empathy_contact_manager_dup_singleton ();
- selector = empathy_contact_selector_new (EMPATHY_CONTACT_LIST (manager));
-
- vbox = gtk_vbox_new (FALSE, 2);
-
- gtk_box_pack_start (GTK_BOX (vbox), selector, FALSE, FALSE, 5);
-
- button = gtk_button_new_with_label ("Chat");
- g_signal_connect (G_OBJECT (button), "clicked",
- G_CALLBACK (clicked_cb), (gpointer) selector);
- gtk_box_pack_start(GTK_BOX (vbox), button, FALSE, FALSE, 5);
-
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- g_signal_connect (G_OBJECT (window), "destroy",
- gtk_main_quit, NULL);
- gtk_window_set_title (GTK_WINDOW (window),"Empetit");
- gtk_container_set_border_width (GTK_CONTAINER (window), 5);
- gtk_container_add (GTK_CONTAINER (window), vbox);
- gtk_widget_show_all (window);
-
- gtk_main ();
-
- g_object_unref (manager);
-
- return 0;
-}