summaryrefslogtreecommitdiff
path: root/src/webview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webview.cpp')
-rw-r--r--src/webview.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index dd28124a..f836b5ea 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -180,21 +180,25 @@ WebView::WebView(QWidget* parent)
}
+// TODO : improve and KDE-ize this menu
void WebView::contextMenuEvent(QContextMenuEvent *event)
{
QWebHitTestResult r = page()->mainFrame()->hitTestContent(event->pos());
if (!r.linkUrl().isEmpty())
{
- QMenu menu(this);
- menu.addAction(pageAction(QWebPage::OpenLinkInNewWindow));
- menu.addAction(i18n("Open in New Tab"), this, SLOT(openLinkInNewTab()));
+ KMenu menu(this);
+ KAction *a = new KAction( KIcon("tab-new"), i18n("Open in New Tab"), this);
+ connect( a, SIGNAL( triggered() ), this , SLOT( openLinkInNewTab() ) );
+ menu.addAction( a );
menu.addSeparator();
menu.addAction(pageAction(QWebPage::DownloadLinkToDisk));
// Add link to bookmarks...
menu.addSeparator();
menu.addAction(pageAction(QWebPage::CopyLinkToClipboard));
- if (page()->settings()->testAttribute(QWebSettings::DeveloperExtrasEnabled))
+ if ( page()->settings()->testAttribute(QWebSettings::DeveloperExtrasEnabled) )
+ {
menu.addAction(pageAction(QWebPage::InspectElement));
+ }
menu.exec(mapToGlobal(event->pos()));
return;
}