summaryrefslogtreecommitdiff
path: root/src/webview.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2008-12-16 02:00:24 +0100
committerAndrea Diamantini <adjam7@gmail.com>2008-12-16 02:00:24 +0100
commit16432de65c59318d4b4c8cadb6d4a366d851d973 (patch)
tree061948a1ca762a12cf028449d5860961cd832610 /src/webview.cpp
parentUpdated TODO (diff)
downloadrekonq-16432de65c59318d4b4c8cadb6d4a366d851d973.tar.xz
Some other steps on the road to the KDE browser..
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;
}