summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/webtab/webview.cpp22
-rw-r--r--src/webtab/webview.h1
2 files changed, 22 insertions, 1 deletions
diff --git a/src/webtab/webview.cpp b/src/webtab/webview.cpp
index db87a993..862355e9 100644
--- a/src/webtab/webview.cpp
+++ b/src/webtab/webview.cpp
@@ -38,6 +38,7 @@
// Local Includes
#include "adblockmanager.h"
#include "bookmarkmanager.h"
+#include "downloadmanager.h"
#include "iconmanager.h"
#include "searchengine.h"
@@ -411,7 +412,10 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
this, SLOT(viewImage(Qt::MouseButtons, Qt::KeyboardModifiers)));
menu.addAction(a);
- menu.addAction(pageAction(KWebPage::DownloadImageToDisk));
+ a = new KAction(KIcon("document-save"), i18n("Save image as..."), this);
+ a->setData(m_contextMenuHitResult.imageUrl());
+ connect(a, SIGNAL(triggered(Qt::MouseButtons, Qt::KeyboardModifiers)), this, SLOT(saveImage()));
+ menu.addAction(a);
a = new KAction(KIcon("view-media-visualization"), i18n("&Copy Image Location"), this);
a->setData(m_contextMenuHitResult.imageUrl());
@@ -767,6 +771,7 @@ void WebView::openLinkInNewTab()
emit loadUrl(url, Rekonq::NewFocusedTab);
}
+
void WebView::openLinkInPrivateWindow()
{
KAction *a = qobject_cast<KAction*>(sender());
@@ -775,6 +780,7 @@ void WebView::openLinkInPrivateWindow()
emit loadUrl(url, Rekonq::NewPrivateWindow);
}
+
void WebView::bookmarkLink()
{
KAction *a = qobject_cast<KAction*>(sender());
@@ -1478,3 +1484,17 @@ WebTab *WebView::parentTab()
{
return m_parentTab;
}
+
+
+void WebView::saveImage()
+{
+ KAction *a = qobject_cast<KAction*>(sender());
+ KUrl imageUrl(a->data().toUrl());
+
+ DownloadManager::self()->downloadResource( imageUrl,
+ KIO::MetaData(),
+ this,
+ true,
+ QString(),
+ !settings()->testAttribute(QWebSettings::PrivateBrowsingEnabled));
+}
diff --git a/src/webtab/webview.h b/src/webtab/webview.h
index b33f3d87..161d8c65 100644
--- a/src/webtab/webview.h
+++ b/src/webtab/webview.h
@@ -109,6 +109,7 @@ private Q_SLOTS:
void slotSpellCheckDone(const QString&);
void sendByMail();
+ void saveImage();
void viewImage(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
void slotCopyImageLocation();