summaryrefslogtreecommitdiff
path: root/src/webview.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-09-04 00:48:41 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-09-04 00:48:41 +0200
commit1e32755e0c8caa5be6c12dd6675a477e5dae9155 (patch)
tree561740ef6654371d458d8a6140e6975b11d521c6 /src/webview.cpp
parentImproving Multi Windows implementation (diff)
downloadrekonq-1e32755e0c8caa5be6c12dd6675a477e5dae9155.tar.xz
Open in new Window Action
Diffstat (limited to 'src/webview.cpp')
-rw-r--r--src/webview.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index 85e0e996..19c5e421 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -116,7 +116,12 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
// link actions
a = pageAction(QWebPage::OpenLinkInNewWindow);
a->setText(i18n("Open Link in New &Tab"));
- a->setIcon(KIcon("window-new"));
+ a->setIcon(KIcon("tab-new"));
+ menu.addAction(a);
+
+ a = new KAction(KIcon("window-new"), i18n("Open Link in New &Window"), this);
+ a->setData( result.linkUrl() );
+ connect(a, SIGNAL( triggered(bool) ), this, SLOT( openLinkInNewWindow() ) );
menu.addAction(a);
a = pageAction(QWebPage::DownloadLinkToDisk);
@@ -211,6 +216,7 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
{
// page action
menu.addAction(mainwindow->actionByName("new_tab"));
+ menu.addAction(mainwindow->actionByName("new_window"));
menu.addSeparator();
}
@@ -349,3 +355,11 @@ void WebView::printFrame()
{
Application::instance()->mainWindow()->printRequested(page()->currentFrame());
}
+
+
+void WebView::openLinkInNewWindow()
+{
+ KAction *a = qobject_cast<KAction*>(sender());
+ KUrl url(a->data().toUrl());
+ Application::instance()->loadUrl(url, Rekonq::NewWindow);
+}