From: Christian Dywan Date: Thu, 21 Jan 2010 17:31:17 +0000 (+0100) Subject: Implement 'Inspect page' menuitem with WebKitGTK+ >= 1.1.17 X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a3fa03bf4d25a58cded238148d3f112cdd7582e;p=midori Implement 'Inspect page' menuitem with WebKitGTK+ >= 1.1.17 --- diff --git a/midori/midori-browser.c b/midori/midori-browser.c index be1dd630..44e94c70 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -2955,6 +2955,9 @@ _action_tools_populate_popup (GtkAction* action, static const GtkActionEntry actions[] = { { "ManageSearchEngines" }, { "ClearPrivateData" }, + #if WEBKIT_CHECK_VERSION (1, 1, 17) + { "InspectPage" }, + #endif { "-" }, { NULL }, { "p" }, @@ -3109,6 +3112,9 @@ _action_compact_menu_populate_popup (GtkAction* action, { NULL }, { "-" }, { "ClearPrivateData" }, + #if WEBKIT_CHECK_VERSION (1, 1, 17) + { "InspectPage" }, + #endif { "Fullscreen" }, #endif { "Preferences" }, @@ -4669,6 +4675,18 @@ _action_clear_private_data_activate (GtkAction* action, gtk_window_present (GTK_WINDOW (dialog)); } +#if WEBKIT_CHECK_VERSION (1, 1, 17) +static void +_action_inspect_page_activate (GtkAction* action, + MidoriBrowser* browser) +{ + GtkWidget* view = midori_browser_get_current_tab (browser); + WebKitWebView* web_view = WEBKIT_WEB_VIEW (gtk_bin_get_child (GTK_BIN (view))); + WebKitWebInspector* inspector = webkit_web_view_get_inspector (web_view); + webkit_web_inspector_show (inspector); +} +#endif + static void _action_tab_previous_activate (GtkAction* action, MidoriBrowser* browser) @@ -5195,6 +5213,12 @@ static const GtkActionEntry entries[] = { N_("_Clear Private Data"), "Delete", N_("Clear private data..."), G_CALLBACK (_action_clear_private_data_activate) }, + #if WEBKIT_CHECK_VERSION (1, 1, 17) + { "InspectPage", NULL, + N_("_Inspect Page"), "i", + N_("Inspect page details and access developer tools..."), + G_CALLBACK (_action_inspect_page_activate) }, + #endif { "TabPrevious", GTK_STOCK_GO_BACK, N_("_Previous Tab"), "Page_Up",