Commit 9db3e4d1 authored by Guillaume Desmottes's avatar Guillaume Desmottes

add EMPATHY_WEBKIT_MENU_INSPECT flag

https://bugzilla.gnome.org/show_bug.cgi?id=684357
parent c4d4989d
......@@ -207,6 +207,13 @@ empathy_webkit_open_address_cb (GtkMenuItem *menuitem,
g_free (uri);
}
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));
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment