]> git.0d.be Git - empathy.git/commitdiff
Separate the debug window into its own process.
authorMike Ruprecht <mike.ruprecht@collabora.co.uk>
Wed, 24 Feb 2010 20:52:38 +0000 (14:52 -0600)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 15 Mar 2010 08:14:04 +0000 (09:14 +0100)
po/POTFILES.in
src/.gitignore
src/Makefile.am
src/empathy-debugger.c [new file with mode: 0644]
src/empathy-main-window.c

index 65bb2b9324632321f483836694ea2ace8bfac105..7b231f35a7d833f01c0d716f4f68b802494c8027 100644 (file)
@@ -93,3 +93,4 @@ src/empathy-invite-participant-dialog.c
 src/cc-empathy-accounts-page.c
 src/cc-empathy-accounts-panel.c
 src/empathy-accounts.c
+src/empathy-debugger.c
index 082f7cdd43b5848420632a35383695e49afc5a69..cf52a9c68b2de3eef6157b3f0e00dd31f9d35315 100644 (file)
@@ -2,3 +2,4 @@ empathy
 empathy-accounts
 empathy-chat-chandler
 empathy-call-chandler
+empathy-debugger
index f63f7d65cc071230a50fd79ab34e8c34950d6017..a01b759a1948e233a4952a9a95146f81f9d1c750 100644 (file)
@@ -81,6 +81,7 @@ endif
 bin_PROGRAMS =                 \
        empathy                 \
        empathy-accounts        \
+       empathy-debugger        \
        $(NULL)
 
 BUILT_SOURCES=
@@ -94,13 +95,17 @@ empathy_accounts_LDADD =                                            \
        libempathy-accounts-common.la                                   \
        $(NULL)
 
+empathy_debugger_SOURCES =                                             \
+       empathy-debug-window.c empathy-debug-window.h                   \
+       empathy-debugger.c                                              \
+       $(NULL)
+
 empathy_handwritten_source = \
        empathy-about-dialog.c empathy-about-dialog.h                   \
        empathy-call-window-fullscreen.c empathy-call-window-fullscreen.h \
        empathy-call-window.c empathy-call-window.h                     \
        empathy-chat-window.c empathy-chat-window.h                     \
        empathy-chatrooms-window.c empathy-chatrooms-window.h           \
-       empathy-debug-window.c empathy-debug-window.h                   \
        empathy-event-manager.c empathy-event-manager.h                 \
        empathy-ft-manager.c empathy-ft-manager.h                       \
        empathy-invite-participant-dialog.c empathy-invite-participant-dialog.h \
diff --git a/src/empathy-debugger.c b/src/empathy-debugger.c
new file mode 100644 (file)
index 0000000..ef6f503
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2005-2007 Imendio AB
+ * Copyright (C) 2007-2010 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <config.h>
+
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+
+#include <libempathy/empathy-utils.h>
+#include <libempathy-gtk/empathy-ui-utils.h>
+
+#include "empathy-debug-window.h"
+
+int
+main (int argc,
+    char **argv)
+{
+  GtkWidget *window;
+
+  g_thread_init (NULL);
+  gtk_init (&argc, &argv);
+  empathy_gtk_init ();
+
+  g_set_application_name (_(PACKAGE_NAME " Debugger"));
+
+  gtk_window_set_default_icon_name ("empathy");
+
+  window = empathy_debug_window_new (NULL);
+  g_signal_connect (window, "destroy", gtk_main_quit, NULL);
+
+  gtk_main ();
+
+  return EXIT_SUCCESS;
+}
index 84331e7bd92f37e22d89f0423df0982290e905cf..c40b0df65a90e04aebc83e43d608afbfa54ce006 100644 (file)
@@ -1,7 +1,7 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * Copyright (C) 2002-2007 Imendio AB
- * Copyright (C) 2007-2008 Collabora Ltd.
+ * Copyright (C) 2007-2010 Collabora Ltd.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -1095,7 +1095,35 @@ static void
 main_window_help_debug_cb (GtkAction         *action,
                           EmpathyMainWindow *window)
 {
-       empathy_debug_window_new (NULL);
+       GdkScreen *screen = gdk_screen_get_default ();
+       GError *error = NULL;
+       gchar *argv[2] = { NULL, };
+       gint i = 0;
+       gchar *path;
+
+       g_return_if_fail (GDK_IS_SCREEN (screen));
+
+       /* Try to run from source directory if possible */
+       path = g_build_filename (g_getenv ("EMPATHY_SRCDIR"), "src",
+                       "empathy-debugger", NULL);
+
+       if (!g_file_test (path, G_FILE_TEST_EXISTS)) {
+               g_free (path);
+               path = g_build_filename (BIN_DIR, "empathy-debugger", NULL);
+       }
+
+       argv[i++] = path;
+
+       gdk_spawn_on_screen (screen, NULL, argv, NULL,
+                       G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD,
+                       NULL, NULL, NULL, &error);
+
+       if (error) {
+               g_warning ("Failed to open debug window: %s", error->message);
+               g_error_free (error);
+       }
+
+       g_free (path);
 }
 
 static void