summaryrefslogtreecommitdiff
path: root/src/webview.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-07-17 15:58:50 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-07-17 16:15:49 +0200
commit678111bf5cd271f85668b02b8ac9e3bffa5eb321 (patch)
tree818b844bc2184a34b05cdf63652f4f607a4531f0 /src/webview.cpp
parentSome lines commented out (diff)
downloadrekonq-678111bf5cd271f85668b02b8ac9e3bffa5eb321.tar.xz
Cleaning a bit WebPage implementation to load faster rekonq
Diffstat (limited to 'src/webview.cpp')
-rw-r--r--src/webview.cpp46
1 files changed, 36 insertions, 10 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index 417a78ba..4e308806 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -48,6 +48,7 @@
#include <QtGui/QMouseEvent>
#include <QtGui/QClipboard>
#include <QtGui/QKeyEvent>
+#include <QtGui/QAction>
#include <QtNetwork/QNetworkReply>
#include <QtNetwork/QNetworkRequest>
@@ -108,13 +109,15 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
MainWindow *mainwindow = Application::instance()->mainWindow();
KMenu menu(this);
-
+ QAction *a;
+
// link actions
bool linkIsEmpty = result.linkUrl().isEmpty();
if (!linkIsEmpty)
{
- QAction *a = pageAction(QWebPage::OpenLinkInNewWindow);
+ a = pageAction(QWebPage::OpenLinkInNewWindow);
a->setText(i18n("Open Link in New &Tab"));
+ a->setIcon(KIcon("window-new"));
menu.addAction(a);
}
else
@@ -127,7 +130,9 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
// Developer Extras actions
if (page()->settings()->testAttribute(QWebSettings::DeveloperExtrasEnabled))
{
- menu.addAction(pageAction(QWebPage::InspectElement));
+ a = pageAction(QWebPage::InspectElement);
+ a->setIcon(KIcon("view-process-all"));
+ menu.addAction(a);
menu.addSeparator();
}
@@ -136,19 +141,28 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
if (result.isContentSelected() && result.isContentEditable())
{
- menu.addAction(pageAction(QWebPage::Cut));
+ a = pageAction(QWebPage::Cut);
+ a->setIcon(KIcon("edit-cut"));
+ a->setShortcut(KStandardShortcut::cut().primary());
+ menu.addAction(a);
b = true;
}
if (result.isContentSelected())
{
- menu.addAction(pageAction(QWebPage::Copy));
+ a = pageAction(QWebPage::Copy);
+ a->setIcon(KIcon("edit-copy"));
+ a->setShortcut(KStandardShortcut::copy().primary());
+ menu.addAction(a);
b = true;
}
if (result.isContentEditable())
{
- menu.addAction(pageAction(QWebPage::Paste));
+ a = pageAction(QWebPage::Paste);
+ a->setIcon(KIcon("edit-paste"));
+ a->setShortcut(KStandardShortcut::paste().primary());
+ menu.addAction(a);
b = true;
}
@@ -160,15 +174,27 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
// save/copy link actions
if (!linkIsEmpty)
{
- menu.addAction(pageAction(QWebPage::DownloadLinkToDisk));
- menu.addAction(pageAction(QWebPage::CopyLinkToClipboard));
+ a = pageAction(QWebPage::DownloadLinkToDisk);
+ a->setIcon(KIcon("document-save"));
+ menu.addAction(a);
+
+ a = pageAction(QWebPage::CopyLinkToClipboard);
+ a->setIcon(KIcon("edit-copy"));
+ menu.addAction(a);
+
menu.addSeparator();
if (!result.pixmap().isNull())
{
// TODO Add "View Image" && remove copy_this_image action
- menu.addAction(pageAction(QWebPage::DownloadImageToDisk));
- menu.addAction(pageAction(QWebPage::CopyImageToClipboard));
+ a = pageAction(QWebPage::DownloadImageToDisk);
+ a->setIcon(KIcon("document-save"));
+ menu.addAction(a);
+
+ a = pageAction(QWebPage::CopyImageToClipboard);
+ a->setIcon(KIcon("edit-copy"));
+ menu.addAction(a);
+
menu.addSeparator();
}
}