aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-09-19 19:41:47 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-12-26 16:48:52 +0800
commit9db3e4d18cc032bf1246caf80115af291d672bf5 (patch)
tree88dd671519ea5f4d4d96c1118e0945fc5effe4dd /libempathy-gtk
parentc4d4989d12cf0854167e8881e8077bece0c91161 (diff)
downloadgsoc2013-empathy-9db3e4d18cc032bf1246caf80115af291d672bf5.tar
gsoc2013-empathy-9db3e4d18cc032bf1246caf80115af291d672bf5.tar.gz
gsoc2013-empathy-9db3e4d18cc032bf1246caf80115af291d672bf5.tar.bz2
gsoc2013-empathy-9db3e4d18cc032bf1246caf80115af291d672bf5.tar.lz
gsoc2013-empathy-9db3e4d18cc032bf1246caf80115af291d672bf5.tar.xz
gsoc2013-empathy-9db3e4d18cc032bf1246caf80115af291d672bf5.tar.zst
gsoc2013-empathy-9db3e4d18cc032bf1246caf80115af291d672bf5.zip
add EMPATHY_WEBKIT_MENU_INSPECT flag
https://bugzilla.gnome.org/show_bug.cgi?id=684357
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-webkit-utils.c20
-rw-r--r--libempathy-gtk/empathy-webkit-utils.h1
2 files changed, 21 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-webkit-utils.c b/libempathy-gtk/empathy-webkit-utils.c
index f4194083b..d221e5f98 100644
--- a/libempathy-gtk/empathy-webkit-utils.c
+++ b/libempathy-gtk/empathy-webkit-utils.c
@@ -208,6 +208,13 @@ empathy_webkit_open_address_cb (GtkMenuItem *menuitem,
}
static void
+empathy_webkit_inspect_cb (GtkMenuItem *menuitem,
+ WebKitWebView *view)
+{
+ empathy_webkit_show_inspector (view);
+}
+
+static void
empathy_webkit_context_menu_selection_done_cb (GtkMenuShell *menu,
gpointer user_data)
{
@@ -288,6 +295,19 @@ empathy_webkit_create_context_menu (WebKitWebView *view,
gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), item);
}
+ if ((flags & EMPATHY_WEBKIT_MENU_INSPECT) != 0)
+ {
+ /* Separator */
+ item = gtk_separator_menu_item_new ();
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+
+ /* Inspector */
+ item = gtk_menu_item_new_with_mnemonic (_("Inspect HTML"));
+ g_signal_connect (item, "activate",
+ G_CALLBACK (empathy_webkit_inspect_cb), view);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+ }
+
g_signal_connect (GTK_MENU_SHELL (menu), "selection-done",
G_CALLBACK (empathy_webkit_context_menu_selection_done_cb),
g_object_ref (hit_test_result));
diff --git a/libempathy-gtk/empathy-webkit-utils.h b/libempathy-gtk/empathy-webkit-utils.h
index 9ab02eedd..034e3bf55 100644
--- a/libempathy-gtk/empathy-webkit-utils.h
+++ b/libempathy-gtk/empathy-webkit-utils.h
@@ -29,6 +29,7 @@ G_BEGIN_DECLS
typedef enum {
EMPATHY_WEBKIT_MENU_CLEAR = 1 << 0,
+ EMPATHY_WEBKIT_MENU_INSPECT = 1 << 1,
} EmpathyWebKitMenuFlags;
EmpathyStringParser * empathy_webkit_get_string_parser (gboolean smileys);