]> git.0d.be Git - empathy.git/blob - src/empathy-debugger.c
Update Simplified Chinese help translation.
[empathy.git] / src / empathy-debugger.c
1 /*
2  * Copyright (C) 2005-2007 Imendio AB
3  * Copyright (C) 2007-2010 Collabora Ltd.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18  */
19
20 #include <config.h>
21
22 #include <gtk/gtk.h>
23 #include <glib/gi18n.h>
24
25 #include <libempathy/empathy-utils.h>
26 #include <libempathy-gtk/empathy-ui-utils.h>
27
28 #include "empathy-debug-window.h"
29
30 #define EMPATHY_DEBUGGER_DBUS_NAME "org.gnome.Empathy.Debugger"
31
32 static GtkWidget *window = NULL;
33
34 static void
35 activate_cb (GApplication *app)
36 {
37   if (window == NULL)
38     {
39       window = empathy_debug_window_new (NULL);
40       g_signal_connect (window, "destroy", gtk_main_quit, NULL);
41
42       /* don't let this application exit automatically */
43       g_application_hold (G_APPLICATION (app));
44     }
45   else
46     {
47       gtk_window_present (GTK_WINDOW (window));
48     }
49 }
50
51 int
52 main (int argc,
53     char **argv)
54 {
55   GtkApplication *app;
56   gint retval;
57
58   g_thread_init (NULL);
59   gtk_init (&argc, &argv);
60   empathy_gtk_init ();
61
62   app = gtk_application_new (EMPATHY_DEBUGGER_DBUS_NAME,
63       G_APPLICATION_FLAGS_NONE);
64   g_signal_connect (app, "activate", G_CALLBACK (activate_cb), NULL);
65
66   g_set_application_name (_("Empathy Debugger"));
67
68   /* Make empathy and empathy-debugger appear as the same app in gnome-shell */
69   gdk_set_program_class ("Empathy");
70   gtk_window_set_default_icon_name ("empathy");
71   textdomain (GETTEXT_PACKAGE);
72
73   retval = g_application_run (G_APPLICATION (app), argc, argv);
74
75   g_object_unref (app);
76
77   return retval;
78 }