]> git.0d.be Git - empathy.git/blob - tests/interactive/test-empathy-contact-blocking-dialog.c
Update FSF postal address
[empathy.git] / tests / interactive / test-empathy-contact-blocking-dialog.c
1 /*
2  * Copyright (C) 2011 Collabora Ltd.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of the
7  * License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17  *
18  * Authors: Danielle Madeley <danielle.madeley@collabora.co.uk>
19  */
20
21 #include "config.h"
22
23 #include <gtk/gtk.h>
24
25 #include "empathy-client-factory.h"
26 #include "empathy-contact-blocking-dialog.h"
27 #include "empathy-ui-utils.h"
28
29 static void
30 am_prepare_cb (GObject *source,
31     GAsyncResult *result,
32     gpointer user_data)
33 {
34     GMainLoop *loop = user_data;
35     GtkWidget *dialog;
36
37     dialog = empathy_contact_blocking_dialog_new (NULL);
38
39     gtk_dialog_run (GTK_DIALOG (dialog));
40
41     g_main_loop_quit (loop);
42 }
43
44 int
45 main (int argc,
46     char **argv)
47   {
48     EmpathyClientFactory *factory;
49     TpAccountManager *am;
50     GMainLoop *loop;
51
52     gtk_init (&argc, &argv);
53     empathy_gtk_init ();
54
55     /* The blocking dialog needs the contact list for the contacts completion
56      * so we prepare it first. */
57     factory = empathy_client_factory_dup ();
58
59     tp_simple_client_factory_add_connection_features_varargs (
60         TP_SIMPLE_CLIENT_FACTORY (factory),
61         TP_CONNECTION_FEATURE_CONTACT_LIST,
62         NULL);
63
64     am = tp_account_manager_dup ();
65
66     loop = g_main_loop_new (NULL, FALSE);
67
68     tp_proxy_prepare_async (am, NULL, am_prepare_cb, loop);
69
70     g_main_loop_run (loop);
71
72     g_object_unref (am);
73     return 0;
74   }