]> git.0d.be Git - empathy.git/blob - tests/interactive/empathy-logs.c
Reorder header inclusions accordingly to the Telepathy coding style
[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
24 #include <stdlib.h>
25 #include <glib.h>
26 #include <gtk/gtk.h>
27
28 #include "empathy-debug.h"
29 #include "empathy-log-window.h"
30 #include "empathy-ui-utils.h"
31 #include "empathy-utils.h"
32
33 static void
34 destroy_cb (GtkWidget *dialog,
35     gpointer user_data)
36 {
37   gtk_main_quit ();
38 }
39
40 static void
41 account_manager_prepare_cb (GObject *source,
42     GAsyncResult *result,
43     gpointer user_data)
44 {
45   GError *error = NULL;
46   GtkWidget *window;
47
48   tp_proxy_prepare_finish (source, result, &error);
49   g_assert_no_error (error);
50
51   window = empathy_log_window_show (NULL, NULL, FALSE, NULL);
52
53   g_signal_connect (window, "destroy", G_CALLBACK (destroy_cb), NULL);
54 }
55
56 int
57 main (int argc,
58     char *argv[])
59 {
60   TpAccountManager *mgr;
61
62   gtk_init (&argc, &argv);
63   empathy_gtk_init ();
64   g_set_application_name (PACKAGE_NAME);
65   gtk_window_set_default_icon_name ("empathy");
66
67   mgr = tp_account_manager_dup ();
68
69   tp_proxy_prepare_async (mgr, NULL, account_manager_prepare_cb, NULL);
70
71   gtk_main ();
72
73   g_object_unref (mgr);
74
75   return EXIT_SUCCESS;
76 }