]> git.0d.be Git - empathy.git/blob - tests/interactive/empathy-logs.c
96f590a69df407e620628c099b400dd000a35d3d
[empathy.git] / tests / interactive / empathy-logs.c
1 /*
2  * Copyright (C) 2008 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 General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17  * Boston, MA  02110-1301  USA
18  *
19  * Authors: Xavier Claessens <xclaesse@gmail.com>
20  */
21
22 #include <config.h>
23 #include <stdlib.h>
24 #include <glib.h>
25 #include <gtk/gtk.h>
26
27 #include "libempathy/empathy-debug.h"
28 #include "libempathy/empathy-utils.h"
29 #include "libempathy-gtk/empathy-log-window.h"
30 #include "libempathy-gtk/empathy-ui-utils.h"
31
32 static void
33 destroy_cb (GtkWidget *dialog,
34     gpointer user_data)
35 {
36   gtk_main_quit ();
37 }
38
39 static void
40 account_manager_prepare_cb (GObject *source,
41     GAsyncResult *result,
42     gpointer user_data)
43 {
44   GError *error = NULL;
45   GtkWidget *window;
46
47   tp_proxy_prepare_finish (source, result, &error);
48   g_assert_no_error (error);
49
50   window = empathy_log_window_show (NULL, NULL, FALSE, NULL);
51
52   g_signal_connect (window, "destroy", G_CALLBACK (destroy_cb), NULL);
53 }
54
55 int
56 main (int argc,
57     char *argv[])
58 {
59   TpAccountManager *mgr;
60
61   gtk_init (&argc, &argv);
62   empathy_gtk_init ();
63   g_set_application_name (PACKAGE_NAME);
64   gtk_window_set_default_icon_name ("empathy");
65
66   mgr = tp_account_manager_dup ();
67
68   tp_proxy_prepare_async (mgr, NULL, account_manager_prepare_cb, NULL);
69
70   gtk_main ();
71
72   g_object_unref (mgr);
73
74   return EXIT_SUCCESS;
75 }