diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/webview.cpp | 24 | ||||
-rw-r--r-- | src/webview.h | 1 |
2 files changed, 16 insertions, 9 deletions
diff --git a/src/webview.cpp b/src/webview.cpp index 0bd590da..292eb364 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -274,15 +274,13 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) } menu.addAction(mainwindow->actionByName("page_source")); - - QAction *addBookmarkAction = Application::bookmarkProvider()->actionByName("rekonq_add_bookmark"); - menu.addAction(addBookmarkAction); - - if (page()->settings()->testAttribute(QWebSettings::DeveloperExtrasEnabled)) - { - // Developer Extras actions - menu.addAction(pageAction(KWebPage::InspectElement)); - } + + a = new KAction( KIcon("layer-visible-on"), i18n("Inspect Element"), this); + connect(a, SIGNAL(triggered(bool)), this, SLOT(inspect())); + menu.addAction(a); + + a = Application::bookmarkProvider()->actionByName("rekonq_add_bookmark"); + menu.addAction(a); } if(mainwindow->isFullScreen()) @@ -400,3 +398,11 @@ void WebView::keyPressEvent(QKeyEvent *event) KWebView::keyPressEvent(event); } + + +void WebView::inspect() +{ + QAction *a = Application::instance()->mainWindow()->actionByName("web_inspector"); + if(a && !a->isChecked()) + a->trigger(); +} diff --git a/src/webview.h b/src/webview.h index ef520a15..d34d108b 100644 --- a/src/webview.h +++ b/src/webview.h @@ -59,6 +59,7 @@ private slots: void openLinkInNewWindow(); void openLinkInNewTab(); void viewImage(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers); + void inspect(); private: WebPage *const m_page; |