aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-08-03 16:12:15 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-08-04 17:10:20 +0800
commitf27e9f59c9b21d4097a805abe24a769446c2351f (patch)
tree45e8c899955b12d5da0f13f9f487a4a8945a6fe0
parent1cffe8f59e31c60f69369f7a636757c3d7fabeca (diff)
downloadgsoc2013-empathy-f27e9f59c9b21d4097a805abe24a769446c2351f.tar
gsoc2013-empathy-f27e9f59c9b21d4097a805abe24a769446c2351f.tar.gz
gsoc2013-empathy-f27e9f59c9b21d4097a805abe24a769446c2351f.tar.bz2
gsoc2013-empathy-f27e9f59c9b21d4097a805abe24a769446c2351f.tar.lz
gsoc2013-empathy-f27e9f59c9b21d4097a805abe24a769446c2351f.tar.xz
gsoc2013-empathy-f27e9f59c9b21d4097a805abe24a769446c2351f.tar.zst
gsoc2013-empathy-f27e9f59c9b21d4097a805abe24a769446c2351f.zip
CallWindow: add a Settings menu item
https://bugzilla.gnome.org/show_bug.cgi?id=655884
-rw-r--r--src/empathy-call-window.c49
-rw-r--r--src/empathy-call-window.ui8
2 files changed, 57 insertions, 0 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 2d7d53efd..b3272bdcc 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -731,6 +731,54 @@ create_pipeline (EmpathyCallWindow *self)
}
static void
+empathy_call_window_settings_cb (GtkAction *action,
+ EmpathyCallWindow *self)
+{
+ GdkDisplay *display;
+ GError *error = NULL;
+ gchar *path, *cmd;
+ GAppInfo *app_info;
+ GdkAppLaunchContext *context = NULL;
+
+ /* Try to run from source directory if possible */
+ path = g_build_filename (g_getenv ("EMPATHY_SRCDIR"), "src",
+ "empathy", NULL);
+
+ if (!g_file_test (path, G_FILE_TEST_EXISTS))
+ {
+ g_free (path);
+ path = g_build_filename (BIN_DIR, "empathy", NULL);
+ }
+
+ cmd = g_strconcat (path, " -p", NULL);
+
+ app_info = g_app_info_create_from_commandline (cmd, NULL, 0, &error);
+ if (app_info == NULL)
+ {
+ DEBUG ("Failed to create app info: %s", error->message);
+ g_error_free (error);
+ goto out;
+ }
+
+ display = gdk_display_get_default ();
+ context = gdk_display_get_app_launch_context (display);
+
+ if (!g_app_info_launch (app_info, NULL, (GAppLaunchContext *) context,
+ &error))
+ {
+ g_warning ("Failed to open debug window: %s", error->message);
+ g_error_free (error);
+ goto out;
+ }
+
+out:
+ tp_clear_object (&app_info);
+ tp_clear_object (&context);
+ g_free (path);
+ g_free (cmd);
+}
+
+static void
empathy_call_window_contents_cb (GtkAction *action,
EmpathyCallWindow *self)
{
@@ -883,6 +931,7 @@ empathy_call_window_init (EmpathyCallWindow *self)
"camera", "toggled", empathy_call_window_camera_toggled_cb,
"dialpad", "toggled", empathy_call_window_dialpad_cb,
"menufullscreen", "activate", empathy_call_window_fullscreen_cb,
+ "menusettings", "activate", empathy_call_window_settings_cb,
"menucontents", "activate", empathy_call_window_contents_cb,
"menudebug", "activate", empathy_call_window_debug_cb,
"menuabout", "activate", empathy_call_window_about_cb,
diff --git a/src/empathy-call-window.ui b/src/empathy-call-window.ui
index 17ab4754d..b376323e0 100644
--- a/src/empathy-call-window.ui
+++ b/src/empathy-call-window.ui
@@ -31,6 +31,13 @@
</object>
</child>
<child>
+ <object class="GtkAction" id="menusettings">
+ <property name="stock_id">gtk-preferences</property>
+ <property name="name">menusettings</property>
+ <property name="label" translatable="yes">_Settings</property>
+ </object>
+ </child>
+ <child>
<object class="GtkAction" id="help">
<property name="name">help</property>
<property name="label" translatable="yes">_Help</property>
@@ -83,6 +90,7 @@
</menu>
<menu action="edit">
<menu action="menumicrophone"/>
+ <menuitem name="menusettings" action="menusettings"/>
</menu>
<menu action="help">
<menuitem name="menucontents" action="menucontents"/>