summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-11-18 11:27:03 +0100
committerAndrea Diamantini <adjam7@gmail.com>2009-11-18 11:27:03 +0100
commita8eb882b2bdeb39f810b2d9e5dff3be5a3c330c7 (patch)
tree0a0b35dc4661e4dc2c35e629b4f15f76e4e8b6bc /src
parentMerge commit 'refs/merge-requests/2106' of git://gitorious.org/rekonq/mainlin... (diff)
parentKIO download system (diff)
downloadrekonq-a8eb882b2bdeb39f810b2d9e5dff3be5a3c330c7.tar.xz
FIxing conflicts
Merge branch 'rekonq04' into dev04try Conflicts: src/CMakeLists.txt
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt56
-rw-r--r--src/application.cpp21
-rw-r--r--src/application.h5
-rw-r--r--src/cookiejar.cpp110
-rw-r--r--src/cookiejar.h56
-rw-r--r--src/data/CMakeLists.txt19
-rw-r--r--src/data/bg.pngbin0 -> 15218 bytes
-rw-r--r--src/data/bg2.pngbin0 -> 1898 bytes
-rw-r--r--src/data/bot.gifbin0 -> 644 bytes
-rw-r--r--src/data/busywidget.gifbin0 -> 11611 bytes
-rw-r--r--src/data/button.pngbin0 -> 740 bytes
-rw-r--r--src/data/category.pngbin0 -> 334 bytes
-rw-r--r--src/data/closed.pngbin0 -> 118 bytes
-rw-r--r--src/data/defaultbookmarks.xbel22
-rw-r--r--src/data/home.html157
-rw-r--r--src/data/loading.mngbin0 -> 3332 bytes
-rw-r--r--src/data/notfound.html65
-rw-r--r--src/data/open.pngbin0 -> 120 bytes
-rw-r--r--src/data/rekonq.desktop24
-rw-r--r--src/data/tile.gifbin0 -> 304 bytes
-rw-r--r--src/data/top.pngbin0 -> 786 bytes
-rw-r--r--src/data/webkit-icon.pngbin0 -> 25694 bytes
-rw-r--r--src/mainwindow.cpp12
-rw-r--r--src/mainwindow.h1
-rw-r--r--src/networkaccessmanager.cpp64
-rw-r--r--src/networkaccessmanager.h47
-rw-r--r--src/rekonqpage/newtabpage.cpp (renamed from src/newtabpage.cpp)0
-rw-r--r--src/rekonqpage/newtabpage.h (renamed from src/newtabpage.h)0
-rw-r--r--src/settings/settings_fonts.ui (renamed from src/settings_fonts.ui)0
-rw-r--r--src/settings/settings_general.ui (renamed from src/settings_general.ui)0
-rw-r--r--src/settings/settings_tabs.ui (renamed from src/settings_tabs.ui)0
-rw-r--r--src/settings/settings_webkit.ui (renamed from src/settings_webkit.ui)0
-rw-r--r--src/settings/settingsdialog.cpp (renamed from src/settings.cpp)17
-rw-r--r--src/settings/settingsdialog.h (renamed from src/settings.h)6
-rw-r--r--src/webpage.cpp85
-rw-r--r--src/webpage.h19
-rw-r--r--src/webpluginfactory.cpp9
-rw-r--r--src/webpluginfactory.h6
-rw-r--r--src/webview.cpp113
-rw-r--r--src/webview.h12
40 files changed, 434 insertions, 492 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4452df54..296e91fd 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,36 +1,34 @@
-### ------- tests sub dir -------
+### ------- sub dirs -------
+ADD_SUBDIRECTORY( data )
ADD_SUBDIRECTORY( tests )
### ------- SETTING REKONQ FILES..
SET( rekonq_KDEINIT_SRCS
- newtabpage.cpp
- previewimage.cpp
- websnap.cpp
- networkaccessmanager.cpp
- autosaver.cpp
- application.cpp
- mainwindow.cpp
- mainview.cpp
- tabbar.cpp
- cookiejar.cpp
- history.cpp
- historymodels.cpp
+ application.cpp
+ autosaver.cpp
bookmarks.cpp
- modelmenu.cpp
- urlbar.cpp
findbar.cpp
- settings.cpp
- webview.cpp
- sidepanel.cpp
- panelhistory.cpp
+ history.cpp
+ historymodels.cpp
lineedit.cpp
- webpage.cpp
+ mainview.cpp
+ mainwindow.cpp
+ modelmenu.cpp
+ panelhistory.cpp
+ previewimage.cpp
sessionmanager.cpp
+ sidepanel.cpp
+ tabbar.cpp
+ urlbar.cpp
+ webpage.cpp
webpluginfactory.cpp
-
+ websnap.cpp
+ webview.cpp
+ rekonqpage/newtabpage.cpp
+ settings/settingsdialog.cpp
bookmarkspanel/bookmarkspanel.cpp
bookmarkspanel/bookmarkstreemodel.cpp
bookmarkspanel/bookmarksproxy.cpp
@@ -38,10 +36,10 @@ SET( rekonq_KDEINIT_SRCS
KDE4_ADD_UI_FILES( rekonq_KDEINIT_SRCS
- settings_general.ui
- settings_tabs.ui
- settings_fonts.ui
- settings_webkit.ui
+ settings/settings_general.ui
+ settings/settings_tabs.ui
+ settings/settings_fonts.ui
+ settings/settings_webkit.ui
cleardata.ui
)
@@ -51,6 +49,8 @@ KDE4_ADD_KCFG_FILES( rekonq_KDEINIT_SRCS rekonq.kcfgc )
### ------------- INCLUDING DIRECTORIES...
INCLUDE_DIRECTORIES ( ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/rekonqpage
+ ${CMAKE_CURRENT_SOURCE_DIR}/settings
${CMAKE_CURRENT_BINARY_DIR}
${KDE4_INCLUDES}
${QT4_INCLUDES}
@@ -69,9 +69,9 @@ KDE4_ADD_KDEINIT_EXECUTABLE( rekonq ${rekonq_KDEINIT_SRCS} main.cpp )
### --------------- TARGETTING LINK LIBRARIES...
TARGET_LINK_LIBRARIES ( kdeinit_rekonq
- ${QT_LIBRARIES}
- ${QT_QTNETWORK_LIBRARY}
- ${QT_QTWEBKIT_LIBRARY}
+ ${QT_LIBRARIES}
+ ${QT_QTWEBKIT_LIBRARY}
+ ${KDE4_KDEWEBKIT_LIBS}
${KDE4_KUTILS_LIBS}
${KDE4_KDEUI_LIBS}
${KDE4_KIO_LIBS}
diff --git a/src/application.cpp b/src/application.cpp
index 66a7d3e5..d02e44c9 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -35,9 +35,7 @@
// Local Includes
#include "mainwindow.h"
-#include "cookiejar.h"
#include "history.h"
-#include "networkaccessmanager.h"
#include "mainview.h"
#include "webview.h"
#include "urlbar.h"
@@ -61,7 +59,6 @@
QPointer<HistoryManager> Application::s_historyManager;
-QPointer<NetworkAccessManager> Application::s_networkAccessManager;
QPointer<BookmarkProvider> Application::s_bookmarkProvider;
QPointer<SessionManager> Application::s_sessionManager;
@@ -77,7 +74,6 @@ Application::~Application()
{
qDeleteAll(m_mainWindows);
delete s_bookmarkProvider;
- delete s_networkAccessManager;
delete s_historyManager;
}
@@ -209,23 +205,6 @@ MainWindow *Application::mainWindow()
}
-CookieJar *Application::cookieJar()
-{
- return (CookieJar *)networkAccessManager()->cookieJar();
-}
-
-
-NetworkAccessManager *Application::networkAccessManager()
-{
- if (!s_networkAccessManager)
- {
- s_networkAccessManager = new NetworkAccessManager();
- s_networkAccessManager->setCookieJar(new CookieJar);
- }
- return s_networkAccessManager;
-}
-
-
HistoryManager *Application::historyManager()
{
if (!s_historyManager)
diff --git a/src/application.h b/src/application.h
index 0f256a45..786e5173 100644
--- a/src/application.h
+++ b/src/application.h
@@ -45,10 +45,8 @@
class KIcon;
class KUrl;
class BookmarkProvider;
-class CookieJar;
class HistoryManager;
class MainWindow;
-class NetworkAccessManager;
class SessionManager;
@@ -105,8 +103,6 @@ public:
static KIcon icon(const KUrl &url);
static HistoryManager *historyManager();
- static CookieJar *cookieJar();
- static NetworkAccessManager *networkAccessManager();
static BookmarkProvider *bookmarkProvider();
static SessionManager *sessionManager();
@@ -141,7 +137,6 @@ private:
KUrl guessUrlFromString(const QString &url);
static QPointer<HistoryManager> s_historyManager;
- static QPointer<NetworkAccessManager> s_networkAccessManager;
static QPointer<BookmarkProvider> s_bookmarkProvider;
static QPointer<SessionManager> s_sessionManager;
diff --git a/src/cookiejar.cpp b/src/cookiejar.cpp
deleted file mode 100644
index 05ffb987..00000000
--- a/src/cookiejar.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/* ============================================================
-*
-* This file is a part of the rekonq project
-*
-* Copyright (C) 2009 by Andrea Diamantini <adjam7 at gmail dot com>
-* Copyright (C) 2009 by Lionel Chauvin <megabigbug@yahoo.fr>
-*
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License as
-* published by the Free Software Foundation; either version 2 of
-* the License or (at your option) version 3 or any later version
-* accepted by the membership of KDE e.V. (or its successor approved
-* by the membership of KDE e.V.), which shall act as a proxy
-* defined in Section 14 of version 3 of the license.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program. If not, see <http://www.gnu.org/licenses/>.
-*
-* ============================================================ */
-
-
-// Self Includes
-#include "cookiejar.h"
-#include "cookiejar.moc"
-
-// Auto Includes
-#include "rekonq.h"
-
-// Local Includes
-#include "application.h"
-#include "mainwindow.h"
-
-// KDE Includes
-#include <KConfig>
-#include <KStandardDirs>
-#include <KDebug>
-
-// Qt Includes
-#include <QtCore/QDataStream>
-#include <QtCore/QDateTime>
-#include <QtCore/QString>
-
-#include <QtDBus/QDBusInterface>
-#include <QtDBus/QDBusReply>
-
-
-CookieJar::CookieJar(QObject* parent)
- : QNetworkCookieJar(parent)
- , m_windowId(-1)
-{
-}
-
-
-CookieJar::~CookieJar()
-{
-}
-
-
-QList<QNetworkCookie> CookieJar::cookiesForUrl(const QUrl & url) const
-{
-
- QDBusInterface kcookiejar("org.kde.kded", "/modules/kcookiejar", "org.kde.KCookieServer");
- QList<QNetworkCookie> cookieList;
- QDBusReply<QString> reply = kcookiejar.call("findDOMCookies", url.toString() );
-
- if (reply.isValid())
- {
- cookieList << reply.value().toUtf8();
- }
- else
- {
- kWarning() << "Unable to communicate with the cookiejar!";
- }
-
- return cookieList;
-}
-
-
-bool CookieJar::setCookiesFromUrl(const QList<QNetworkCookie> & cookieList, const QUrl & url)
-{
- QDBusInterface kcookiejar("org.kde.kded", "/modules/kcookiejar", "org.kde.KCookieServer");
- QByteArray cookieHeader;
- Q_FOREACH(const QNetworkCookie& cookie, cookieList)
- {
- cookieHeader = "Set-Cookie: ";
- cookieHeader += cookie.toRawForm();
- kcookiejar.call("addCookies", url.toString(), cookieHeader, m_windowId );
- }
-
- return !kcookiejar.lastError().isValid();
-}
-
-
-void CookieJar::clear()
-{
- QDBusInterface kcookiejar("org.kde.kded", "/modules/kcookiejar", "org.kde.KCookieServer");
-
- QDBusReply<void> reply = kcookiejar.call( "deleteAllCookies" );
- if (!reply.isValid())
- {
- kWarning() << "Unable to delete all the cookies as requested.";
- }
- return;
-}
diff --git a/src/cookiejar.h b/src/cookiejar.h
deleted file mode 100644
index 9ae24409..00000000
--- a/src/cookiejar.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* ============================================================
-*
-* This file is a part of the rekonq project
-*
-* Copyright (C) 2009 by Andrea Diamantini <adjam7 at gmail dot com>
-* Copyright (C) 2009 by Lionel Chauvin <megabigbug@yahoo.fr>
-*
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License as
-* published by the Free Software Foundation; either version 2 of
-* the License or (at your option) version 3 or any later version
-* accepted by the membership of KDE e.V. (or its successor approved
-* by the membership of KDE e.V.), which shall act as a proxy
-* defined in Section 14 of version 3 of the license.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program. If not, see <http://www.gnu.org/licenses/>.
-*
-* ============================================================ */
-
-
-#ifndef RECOOKIEJAR_H
-#define RECOOKIEJAR_H
-
-
-// Qt Includes
-#include <QtNetwork/QNetworkCookieJar>
-
-// Forward Declarations
-class QUrl;
-
-
-class CookieJar : public QNetworkCookieJar
-{
- Q_OBJECT
-
-public:
- CookieJar(QObject* parent = 0);
- virtual ~CookieJar();
-
- virtual QList<QNetworkCookie> cookiesForUrl(const QUrl & url) const;
- virtual bool setCookiesFromUrl(const QList<QNetworkCookie> & cookieList, const QUrl & url);
-
- void clear();
-
-private:
- qlonglong m_windowId;
-};
-
-#endif // RECOOKIEJAR_H
diff --git a/src/data/CMakeLists.txt b/src/data/CMakeLists.txt
new file mode 100644
index 00000000..bf01a44d
--- /dev/null
+++ b/src/data/CMakeLists.txt
@@ -0,0 +1,19 @@
+INSTALL(
+ FILES bg2.png bg.png bot.gif busywidget.gif closed.png loading.mng open.png tile.gif top.png webkit-icon.png category.png button.png
+ DESTINATION ${DATA_INSTALL_DIR}/rekonq/pics
+)
+
+INSTALL(
+ FILES defaultbookmarks.xbel
+ DESTINATION ${DATA_INSTALL_DIR}/rekonq
+)
+
+INSTALL(
+ FILES rekonq.desktop
+ DESTINATION ${XDG_APPS_INSTALL_DIR}
+)
+
+INSTALL(
+ FILES notfound.html home.html
+ DESTINATION ${DATA_INSTALL_DIR}/rekonq/htmls
+)
diff --git a/src/data/bg.png b/src/data/bg.png
new file mode 100644
index 00000000..5ec669ac
--- /dev/null
+++ b/src/data/bg.png
Binary files differ
diff --git a/src/data/bg2.png b/src/data/bg2.png
new file mode 100644
index 00000000..1ded2690
--- /dev/null
+++ b/src/data/bg2.png
Binary files differ
diff --git a/src/data/bot.gif b/src/data/bot.gif
new file mode 100644
index 00000000..2f9abde4
--- /dev/null
+++ b/src/data/bot.gif
Binary files differ
diff --git a/src/data/busywidget.gif b/src/data/busywidget.gif
new file mode 100644
index 00000000..600b9d44
--- /dev/null
+++ b/src/data/busywidget.gif
Binary files differ
diff --git a/src/data/button.png b/src/data/button.png
new file mode 100644
index 00000000..22ef7643
--- /dev/null
+++ b/src/data/button.png
Binary files differ
diff --git a/src/data/category.png b/src/data/category.png
new file mode 100644
index 00000000..796875d4
--- /dev/null
+++ b/src/data/category.png
Binary files differ
diff --git a/src/data/closed.png b/src/data/closed.png
new file mode 100644
index 00000000..2b1bf01e
--- /dev/null
+++ b/src/data/closed.png
Binary files differ
diff --git a/src/data/defaultbookmarks.xbel b/src/data/defaultbookmarks.xbel
new file mode 100644
index 00000000..b4919c5c
--- /dev/null
+++ b/src/data/defaultbookmarks.xbel
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE xbel>
+<xbel version="1.0">
+ <bookmark href="http://qtsoftware.com/">
+ <title>QtSoftware</title>
+ </bookmark>
+ <bookmark href="http://webkit.org/">
+ <title>WebKit.org</title>
+ </bookmark>
+ <bookmark href="http://rekonq.sourceforge.net/">
+ <title>rekonq site</title>
+ </bookmark>
+ <bookmark href="http://labs.trolltech.com/">
+ <title>Trolltech Labs</title>
+ </bookmark>
+ <bookmark href="http://kde-apps.org/">
+ <title>KDE-Apps.org</title>
+ </bookmark>
+ <bookmark href="http://www.kde.org/">
+ <title>KDE site</title>
+ </bookmark>
+</xbel>
diff --git a/src/data/home.html b/src/data/home.html
new file mode 100644
index 00000000..f99d0df1
--- /dev/null
+++ b/src/data/home.html
@@ -0,0 +1,157 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+
+<head>
+<title>%1</title>
+
+<style type="text/css">
+
+/* ------------------------------------------------------- */
+/* generic styles */
+
+html, body, div, h1, h2, h3, h4, a, p{
+margin:0;
+padding:0;
+border:0;
+}
+
+body{
+background: url(%2/tile.gif) repeat-x #fff;
+font-family: sans-serif;
+font-size: 0.8em;
+text-align: center;
+}
+
+h1{
+font: normal bold 2em sans-serif;
+text-align:right;
+color: #3F7AB7;
+margin-right:3%;
+margin-top: 0.5%;
+float:right;
+}
+
+h2{
+font: normal bold 1.2em sans-serif;
+color: #3F7AB7;
+margin-top: 2em;
+}
+
+h3{
+border-bottom-width: 1px;
+-webkit-border-image: url(%2/category.png) 1 1 1 1 stretch stretch;
+padding: 0.2em;
+margin-top: 0.5em;
+margin-bottom: 0.5em;
+font: normal bold 1em sans-serif;
+}
+
+h4{
+font-size: 1em;
+margin-top: 0.5em;
+}
+
+a{
+color: #3F7AB7;
+text-decoration: none;
+}
+a:hover{
+color: black;
+}
+
+/* ------------------------------------------------------- */
+/* page sections */
+
+#container {
+width: 100%;
+}
+
+#navigation {
+display: inline-block;
+margin-top: 2%;
+margin-bottom: 2%;
+text-align: center;
+border-width: 5px;
+-webkit-border-image: url(%2/bg2.png) 12 12 12 12 stretch stretch;
+}
+
+#content {
+text-align: left;
+margin: 2%;
+}
+
+/* -------------------------------------------------------- */
+/* div navigations styles */
+
+.link{
+display: inline-block;
+}
+
+.link img{
+vertical-align: middle;
+margin-right: 5px;
+}
+
+.link a{
+color: black;
+text-decoration:none;
+font: normal 1em sans-serif;
+}
+
+.current{
+border-width: 6px;
+-webkit-border-image: url(%2/button.png) 6 stretch stretch;
+}
+
+#navigation .link:not(.current){
+margin-right: 10px;
+margin-left: 10px;
+}
+
+
+.favorites{
+text-align: center;
+margin-top: -5%;
+}
+
+/* -------------------------------------------------------- */
+/* Thumbnail class */
+
+.thumbnail {
+text-align: center;
+display: inline-block;
+width:25%;
+margin-top: 7%;
+min-width:250px;
+min-height:192px;
+}
+
+.thumbnail object{
+text-align: center;
+width:228px;
+height:192px;
+}
+
+/* -------------------------------------------------------- */
+/* Bookmarks page*/
+
+.bookfolder{
+margin-left: 2em;
+margin-bottom: 0.5em;
+}
+
+/* -------------------------------------------------------- */
+</style>
+</head>
+
+<body>
+
+<div id="container">
+<div id="navigation">
+%3
+</div>
+<div id="content">%4</div>
+</div>
+
+</body>
+</html>
diff --git a/src/data/loading.mng b/src/data/loading.mng
new file mode 100644
index 00000000..0e490c4b
--- /dev/null
+++ b/src/data/loading.mng
Binary files differ
diff --git a/src/data/notfound.html b/src/data/notfound.html
new file mode 100644
index 00000000..e34bfc6d
--- /dev/null
+++ b/src/data/notfound.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+<title>%1</title>
+
+<style type="text/css">
+
+html{
+margin:0;
+padding:0;
+}
+
+body{
+background: url(%2/tile.gif) repeat-x #fff;
+margin:0;
+padding:0;
+font-family: sans-serif;
+font-size: 100%;
+}
+
+#block {
+/* background: url(%2/bot.gif) bottom center #f3f3f3; */
+border: 2px solid #d9d9d9;
+padding: 10px;
+width: 600px;
+margin: 150px auto;
+color: #444;
+
+/*font-weight: bold;
+clear: right;*/
+}
+
+h1{
+font-size: 130%;
+font-weight: bold;
+border-bottom: 1px solid lightgray;
+margin-left: 48px;
+}
+
+h2{
+font-size: 100%;
+font-weight: normal;
+border-bottom: 1px solid lightgray;
+margin-left: 48px;
+}
+
+ul {
+padding: 12px 48px;
+margin: 0;
+}
+
+#reloadButton {
+margin-left: 48px;
+margin-bottom: 12px;
+}
+
+</style>
+
+</head>
+
+<body>
+<div id="block">%3</div>
+</body>
+
+</html>
diff --git a/src/data/open.png b/src/data/open.png
new file mode 100644
index 00000000..fee6f3fb
--- /dev/null
+++ b/src/data/open.png
Binary files differ
diff --git a/src/data/rekonq.desktop b/src/data/rekonq.desktop
new file mode 100644
index 00000000..62998336
--- /dev/null
+++ b/src/data/rekonq.desktop
@@ -0,0 +1,24 @@
+[Desktop Entry]
+Name=rekonq
+Name[sv]=Rekonq
+Name[tr]=Rekonq
+Name[x-test]=xxrekonqxx
+GenericName=Webkit KDE Browser
+GenericName[de]=Webkit-Browser für KDE
+GenericName[et]=KDE Webkiti veebibrauser
+GenericName[km]=កម្មវិធី​រុករក​ Webkit KDE
+GenericName[pt]=Navegador Web com WebKit
+GenericName[pt_BR]=Navegador Webkit do KDE
+GenericName[sv]=Webkit webbläsare för KDE
+GenericName[tr]=Webkit KDE Tarayıcı
+GenericName[uk]=Переглядач мережі на WebKit для KDE
+GenericName[x-test]=xxWebkit KDE Browserxx
+Icon=rekonq
+Type=Application
+Exec=rekonq %u
+X-DocPath=rekonq/index.html
+Categories=Qt;KDE;Network;WebBrowser;
+Terminal=false
+MimeType=text/html;application/xhtml+xml;application/xml;
+X-DBUS-StartupType=Unique
+X-DBUS-ServiceName=net.sourceforge.rekonq
diff --git a/src/data/tile.gif b/src/data/tile.gif
new file mode 100644
index 00000000..32e06fff
--- /dev/null
+++ b/src/data/tile.gif
Binary files differ
diff --git a/src/data/top.png b/src/data/top.png
new file mode 100644
index 00000000..9ebf0234
--- /dev/null
+++ b/src/data/top.png
Binary files differ
diff --git a/src/data/webkit-icon.png b/src/data/webkit-icon.png
new file mode 100644
index 00000000..b3ec677a
--- /dev/null
+++ b/src/data/webkit-icon.png
Binary files differ
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 52ea6068..9b95f052 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -35,10 +35,8 @@
// Local Includes
#include "application.h"
-#include "settings.h"
+#include "settingsdialog.h"
#include "history.h"
-#include "cookiejar.h"
-#include "networkaccessmanager.h"
#include "bookmarks.h"
#include "webview.h"
#include "mainview.h"
@@ -90,6 +88,9 @@
#include <QtGui/QPrintPreviewDialog>
#include <QtGui/QFontMetrics>
+#include <QtDBus/QDBusInterface>
+#include <QtDBus/QDBusReply>
+
#include <QtWebKit/QWebHistory>
@@ -1067,12 +1068,13 @@ void MainWindow::clearPrivateData()
if(clearWidget.clearCookies->isChecked())
{
- Application::cookieJar()->clear();
+ QDBusInterface kcookiejar("org.kde.kded", "/modules/kcookiejar", "org.kde.KCookieServer");
+ QDBusReply<void> reply = kcookiejar.call( "deleteAllCookies" );
}
if(clearWidget.clearCachedPages->isChecked())
{
- Application::networkAccessManager()->resetDiskCache();
+ // TODO implement me!
}
if(clearWidget.clearWebIcons->isChecked())
diff --git a/src/mainwindow.h b/src/mainwindow.h
index af052c1b..64ce6967 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -32,7 +32,6 @@
// Local Includes
#include "bookmarks.h"
-// #include "mainview.h"
#include "webview.h"
// KDE Includes
diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp
deleted file mode 100644
index 38f4c8c4..00000000
--- a/src/networkaccessmanager.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/* ============================================================
-*
-* This file is a part of the rekonq project
-*
-* Copyright (C) 2007-2008 Trolltech ASA. All rights reserved
-* Copyright (C) 2008-2009 by Andrea Diamantini <adjam7 at gmail dot com>*
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License as
-* published by the Free Software Foundation; either version 2 of
-* the License or (at your option) version 3 or any later version
-* accepted by the membership of KDE e.V. (or its successor approved
-* by the membership of KDE e.V.), which shall act as a proxy
-* defined in Section 14 of version 3 of the license.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program. If not, see <http://www.gnu.org/licenses/>.
-*
-* ============================================================ */
-
-
-// Self Includes
-#include "networkaccessmanager.h"
-#include "networkaccessmanager.moc"
-
-// Local Includes
-#include "application.h"
-#include "mainwindow.h"
-
-// Auto Includes
-#include "rekonq.h"
-
-// KDE Includes
-#include <KStandardDirs>
-
-// Qt Includes
-#include <QtNetwork/QNetworkDiskCache>
-
-
-NetworkAccessManager::NetworkAccessManager(QObject *parent)
- : AccessManager(parent)
-{
- // resetting disk cache
- resetDiskCache();
-}
-
-
-void NetworkAccessManager::resetDiskCache()
-{
- if(!cache())
- {
- QNetworkDiskCache *diskCache = new QNetworkDiskCache(this);
- setCache(diskCache);
- }
- else
- {
- cache()->clear();
- }
-}
diff --git a/src/networkaccessmanager.h b/src/networkaccessmanager.h
deleted file mode 100644
index 6cade7fe..00000000
--- a/src/networkaccessmanager.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* ============================================================
-*
-* This file is a part of the rekonq project
-*
-* Copyright (C) 2007-2008 Trolltech ASA. All rights reserved
-* Copyright (C) 2008-2009 by Andrea Diamantini <adjam7 at gmail dot com>*
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License as
-* published by the Free Software Foundation; either version 2 of
-* the License or (at your option) version 3 or any later version
-* accepted by the membership of KDE e.V. (or its successor approved
-* by the membership of KDE e.V.), which shall act as a proxy
-* defined in Section 14 of version 3 of the license.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program. If not, see <http://www.gnu.org/licenses/>.
-*
-* ============================================================ */
-
-
-#ifndef NETWORKACCESSMANAGER_H
-#define NETWORKACCESSMANAGER_H
-
-
-// KDE Includes
-#include <kio/accessmanager.h>
-
-
-using namespace KIO;
-
-
-class NetworkAccessManager : public AccessManager
-{
- Q_OBJECT
-
-public:
- NetworkAccessManager(QObject *parent = 0);
- void resetDiskCache();
-};
-
-#endif // NETWORKACCESSMANAGER_H
diff --git a/src/newtabpage.cpp b/src/rekonqpage/newtabpage.cpp
index b34990fc..b34990fc 100644
--- a/src/newtabpage.cpp
+++ b/src/rekonqpage/newtabpage.cpp
diff --git a/src/newtabpage.h b/src/rekonqpage/newtabpage.h
index 2d8d50bd..2d8d50bd 100644
--- a/src/newtabpage.h
+++ b/src/rekonqpage/newtabpage.h
diff --git a/src/settings_fonts.ui b/src/settings/settings_fonts.ui
index 98efce16..98efce16 100644
--- a/src/settings_fonts.ui
+++ b/src/settings/settings_fonts.ui
diff --git a/src/settings_general.ui b/src/settings/settings_general.ui
index 57d293e6..57d293e6 100644
--- a/src/settings_general.ui
+++ b/src/settings/settings_general.ui
diff --git a/src/settings_tabs.ui b/src/settings/settings_tabs.ui
index ba903ff4..ba903ff4 100644
--- a/src/settings_tabs.ui
+++ b/src/settings/settings_tabs.ui
diff --git a/src/settings_webkit.ui b/src/settings/settings_webkit.ui
index 129bcf03..129bcf03 100644
--- a/src/settings_webkit.ui
+++ b/src/settings/settings_webkit.ui
diff --git a/src/settings.cpp b/src/settings/settingsdialog.cpp
index 5696995c..1db38b96 100644
--- a/src/settings.cpp
+++ b/src/settings/settingsdialog.cpp
@@ -27,8 +27,8 @@
// Self Includes
-#include "settings.h"
-#include "settings.moc"
+#include "settingsdialog.h"
+#include "settingsdialog.moc"
// Auto Includes
#include "rekonq.h"
@@ -36,7 +36,6 @@
// Local Includes
#include "application.h"
#include "mainwindow.h"
-#include "networkaccessmanager.h"
#include "webview.h"
//Ui Includes
@@ -70,6 +69,7 @@ private:
KCModuleProxy *proxyModule;
KCModuleProxy *ebrowsingModule;
KCModuleProxy *cookiesModule;
+ KCModuleProxy *cacheModule;
KShortcutsEditor *shortcutsEditor;
Private(SettingsDialog *parent);
@@ -110,7 +110,12 @@ Private::Private(SettingsDialog *parent)
proxyModule = new KCModuleProxy(proxyInfo,parent);
pageItem = parent->addPage(proxyModule, i18n(proxyInfo.moduleName().toLocal8Bit()));
pageItem->setIcon(KIcon(proxyInfo.icon()));
-
+
+ KCModuleInfo cacheInfo("cache.desktop");
+ cacheModule = new KCModuleProxy(cacheInfo,parent);
+ pageItem = parent->addPage(cacheModule, i18n(cacheInfo.moduleName().toLocal8Bit()));
+ pageItem->setIcon(KIcon(cacheInfo.icon()));
+
widget = new QWidget;
webkitUi.setupUi(widget);
widget->layout()->setMargin(0);
@@ -153,6 +158,8 @@ SettingsDialog::SettingsDialog(QWidget *parent)
connect(d->ebrowsingModule, SIGNAL(changed(bool)), this, SLOT(updateButtons()));
connect(d->cookiesModule, SIGNAL(changed(bool)), this, SLOT(updateButtons()));
connect(d->proxyModule, SIGNAL(changed(bool)), this, SLOT(updateButtons()));
+ connect(d->cacheModule, SIGNAL(changed(bool)), this, SLOT(updateButtons()));
+
connect(d->shortcutsEditor, SIGNAL(keyChange()), this, SLOT(updateButtons()));
connect(this, SIGNAL(applyClicked()), this, SLOT(saveSettings()));
@@ -200,6 +207,7 @@ void SettingsDialog::saveSettings()
d->ebrowsingModule->save();
d->cookiesModule->save();
d->proxyModule->save();
+ d->cacheModule->save();
d->shortcutsEditor->save();
}
@@ -210,6 +218,7 @@ bool SettingsDialog::hasChanged()
|| d->ebrowsingModule->changed()
|| d->cookiesModule->changed()
|| d->proxyModule->changed()
+ || d->cacheModule->changed()
|| d->shortcutsEditor->isModified();
;
}
diff --git a/src/settings.h b/src/settings/settingsdialog.h
index 3aa943c7..360fe246 100644
--- a/src/settings.h
+++ b/src/settings/settingsdialog.h
@@ -26,8 +26,8 @@
* ============================================================ */
-#ifndef SETTINGS_H
-#define SETTINGS_H
+#ifndef SETTINGS_DIALOG_H
+#define SETTINGS_DIALOG_H
// KDE Includes
@@ -59,4 +59,4 @@ private slots:
void setHomeToCurrentPage();
};
-#endif // SETTINGS_H
+#endif // SETTINGS_DIALOG_H
diff --git a/src/webpage.cpp b/src/webpage.cpp
index 56865eb7..94ecbe09 100644
--- a/src/webpage.cpp
+++ b/src/webpage.cpp
@@ -39,8 +39,6 @@
#include "application.h"
#include "mainwindow.h"
#include "mainview.h"
-#include "cookiejar.h"
-#include "networkaccessmanager.h"
#include "webview.h"
#include "webpluginfactory.h"
@@ -51,7 +49,8 @@
#include <KToolInvocation>
#include <KProtocolManager>
-#include <KDE/KParts/BrowserRun>
+#include <kparts/browseropenorsavequestion.h>
+
#include <KDE/KMimeTypeTrader>
#include <KDE/KRun>
#include <KDE/KFileDialog>
@@ -66,8 +65,8 @@
#include <QtGui/QKeyEvent>
-WebPage::WebPage(QObject *parent)
- : QWebPage(parent)
+WebPage::WebPage(QObject *parent, qlonglong windowId)
+ : KWebPage(parent, windowId)
, m_keyboardModifiers(Qt::NoModifier)
, m_pressedButtons(Qt::NoButton)
{
@@ -75,10 +74,8 @@ WebPage::WebPage(QObject *parent)
setForwardUnsupportedContent(true);
- setNetworkAccessManager(Application::networkAccessManager());
connect(networkAccessManager(), SIGNAL(finished(QNetworkReply*)), this, SLOT(manageNetworkErrors(QNetworkReply*)));
- connect(this, SIGNAL(downloadRequested(const QNetworkRequest &)), this, SLOT(downloadRequested(const QNetworkRequest &)));
connect(this, SIGNAL(unsupportedContent(QNetworkReply *)), this, SLOT(handleUnsupportedContent(QNetworkReply *)));
}
@@ -122,19 +119,14 @@ bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &r
m_requestedUrl = request.url();
- return QWebPage::acceptNavigationRequest(frame, request, type);
+ return KWebPage::acceptNavigationRequest(frame, request, type);
}
WebPage *WebPage::createWindow(QWebPage::WebWindowType type)
{
kDebug() << "WebPage createWindow slot";
- return newWindow(type);
-}
-
-WebPage *WebPage::newWindow(WebWindowType type)
-{
// added to manage web modal dialogs
if (type == QWebPage::WebModalDialog)
kDebug() << "Modal Dialog";
@@ -157,34 +149,32 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply)
if (reply->error() == QNetworkReply::NoError)
{
const KUrl url(reply->request().url());
- QString filename = url.fileName();
- QString mimetype = reply->header(QNetworkRequest::ContentTypeHeader).toString();
- KService::Ptr offer = KMimeTypeTrader::self()->preferredService(mimetype);
+
+ QString mimeType = reply->header(QNetworkRequest::ContentTypeHeader).toString();
+ KService::Ptr offer = KMimeTypeTrader::self()->preferredService(mimeType);
if( offer.isNull() ) // no service can handle this. We can just download it..
{
- downloadRequested(reply->request());
+ downloadRequest(reply->request());
+ return;
}
- else
+
+ KParts::BrowserOpenOrSaveQuestion dlg(Application::instance()->mainWindow(), url, mimeType);
+ switch ( dlg.askEmbedOrSave() )
{
- // WARNING switch to BrowserOpenOrSaveQuestion for 4.4
- switch ( KParts::BrowserRun::askSave( url, offer, mimetype, filename ) )
- {
- case KParts::BrowserRun::Save:
- downloadRequested(reply->request());
- return;
- case KParts::BrowserRun::Cancel:
- return;
- default: // non extant case
- break;
- }
- // case KParts::BrowserRun::Open
- KUrl::List list;
- list.append(url);
- KRun::run(*offer,url,0);
+ case KParts::BrowserOpenOrSaveQuestion::Save:
+ downloadRequested(reply->request());
+ return;
+ case KParts::BrowserOpenOrSaveQuestion::Cancel:
+ return;
+ default: // non extant case
+ break;
}
+ // case KParts::BrowserRun::Embed
+ KUrl::List list;
+ list.append(url);
+ KRun::run(*offer,url,0);
}
- return;
}
@@ -260,28 +250,9 @@ QString WebPage::errorPage(QNetworkReply *reply)
}
-// TODO FIXME: sometimes url.fileName() fails to retrieve url file name
-void WebPage::downloadRequested(const QNetworkRequest &request)
-{
- const KUrl url(request.url());
-
- const QString destUrl = KFileDialog::getSaveFileName(url.fileName(), QString(), view());
- if (destUrl.isEmpty()) return;
- KIO::Job *job = KIO::file_copy(url, KUrl(destUrl), -1, KIO::Overwrite);
- //job->setMetaData(metadata); //TODO: add metadata from request
- job->addMetaData( QLatin1String("MaxCacheSize"), QLatin1String("0") ); // Don't store in http cache.
- job->addMetaData( QLatin1String("cache"), QLatin1String("cache") ); // Use entry from cache if available.
- job->uiDelegate()->setAutoErrorHandlingEnabled(true);
-}
-
-
-QString WebPage::userAgentForUrl(const QUrl& _url) const
+bool WebPage::authorizedRequest(const QUrl &url) const
{
- const KUrl url(_url);
- QString userAgent = KProtocolManager::userAgentForHost((url.isLocalFile() ? "localhost" : url.host()));
-
- if (userAgent == KProtocolManager::defaultUserAgent())
- return QWebPage::userAgentForUrl(_url);
-
- return userAgent;
+ Q_UNUSED(url)
+ // TODO implement ad-block here
+ return true;
}
diff --git a/src/webpage.h b/src/webpage.h
index 45fc0c51..eb558220 100644
--- a/src/webpage.h
+++ b/src/webpage.h
@@ -32,40 +32,39 @@
#define WEBPAGE_H
+// KDE Includes
+#include <KWebPage>
+
// Qt Includes
-#include <QWebPage>
#include <QUrl>
// Forward Declarations
class QWebFrame;
class QNetworkReply;
-class QUrl;
-class WebPage : public QWebPage
+class WebPage : public KWebPage
{
Q_OBJECT
public:
- explicit WebPage(QObject *parent = 0);
+ explicit WebPage(QObject *parent = 0, qlonglong windowId = 0);
~WebPage();
-
+
+ virtual bool authorizedRequest(const QUrl &url) const;
+
public slots:
- void manageNetworkErrors(QNetworkReply* reply);
+ void manageNetworkErrors(QNetworkReply *reply);
protected:
WebPage *createWindow(WebWindowType type);
- virtual WebPage *newWindow(WebWindowType type);
virtual bool acceptNavigationRequest(QWebFrame *frame,
const QNetworkRequest &request,
NavigationType type);
-
- virtual QString userAgentForUrl(const QUrl& url) const;
protected Q_SLOTS:
virtual void handleUnsupportedContent(QNetworkReply *reply);
- virtual void downloadRequested(const QNetworkRequest &request);
private:
friend class WebView;
diff --git a/src/webpluginfactory.cpp b/src/webpluginfactory.cpp
index 3daffbb6..af799905 100644
--- a/src/webpluginfactory.cpp
+++ b/src/webpluginfactory.cpp
@@ -38,7 +38,7 @@
WebPluginFactory::WebPluginFactory(QObject *parent)
- : QWebPluginFactory(parent)
+ : KWebPluginFactory(parent)
{
}
@@ -75,16 +75,13 @@ QObject *WebPluginFactory::create(const QString &mimeType,
return new PreviewImage(url, title, number, isFavorite);
}
- // this let QtWebKit using builtin plugins
- // to load in example flash contents and so on..
- kDebug() << "No plugins found for" << mimeType << ". Falling back to QtWebKit ones...";
- return 0;
+ return KWebPluginFactory::create(mimeType, url, argumentNames, argumentValues);
}
QList<QWebPluginFactory::Plugin> WebPluginFactory::plugins() const
{
- QList<QWebPluginFactory::Plugin> plugins;
+ QList<KWebPluginFactory::Plugin> plugins = KWebPluginFactory::plugins();
QWebPluginFactory::Plugin p;
p.name = "application/image-preview";
diff --git a/src/webpluginfactory.h b/src/webpluginfactory.h
index 738605db..30a366d4 100644
--- a/src/webpluginfactory.h
+++ b/src/webpluginfactory.h
@@ -28,13 +28,15 @@
#define WEB_PLUGIN_FACTORY_H
+// KDE Includes
+#include <KWebPluginFactory>
+
// Qt Includes
-#include <QtWebKit/QWebPluginFactory>
#include <QtCore/QList>
#include <QtGui/QWidget>
-class WebPluginFactory : public QWebPluginFactory
+class WebPluginFactory : public KWebPluginFactory
{
Q_OBJECT
diff --git a/src/webview.cpp b/src/webview.cpp
index 1dd5ad6a..f38d363e 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -53,7 +53,7 @@
WebView::WebView(QWidget* parent)
- : QWebView(parent)
+ : KWebView(parent, false)
, m_page(new WebPage(this))
, m_progress(0)
, m_mousePos(QPoint(0,0))
@@ -64,6 +64,11 @@ WebView::WebView(QWidget* parent)
connect(page(), SIGNAL(statusBarMessage(const QString&)), this, SLOT(setStatusBarText(const QString&)));
connect(this, SIGNAL(loadProgress(int)), this, SLOT(updateProgress(int)));
connect(this, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool)));
+
+ connect(this, SIGNAL(linkMiddleOrCtrlClicked(const KUrl &)), this, SLOT(loadInNewTab(const KUrl &)) );
+
+ connect(this, SIGNAL(linkShiftClicked(const KUrl &)), this, SLOT(downloadRequest(const KUrl &)));
+ connect(page(), SIGNAL(downloadRequested(const QNetworkRequest &)), this, SLOT(downloadRequest(const QNetworkRequest &r)));
}
@@ -76,7 +81,7 @@ WebPage *WebView::page()
{
if(!m_page)
{
- m_page = new WebPage();
+ m_page = new WebPage(this);
setPage(m_page);
}
return m_page;
@@ -129,14 +134,8 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
connect(a, SIGNAL(triggered(bool)), this, SLOT(openLinkInNewWindow()));
menu.addAction(a);
- 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.addAction(pageAction(KWebPage::DownloadLinkToDisk));
+ menu.addAction(pageAction(KWebPage::CopyLinkToClipboard));
menu.addSeparator();
}
@@ -144,33 +143,24 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
if (result.isContentEditable() && result.isContentSelected())
{
// actions for text selected in field
- a = pageAction(QWebPage::Cut);
- a->setIcon(KIcon("edit-cut"));
- a->setShortcut(KStandardShortcut::cut().primary());
- menu.addAction(a);
+ menu.addAction(pageAction(KWebPage::Cut));
}
// is content selected) Add COPY
if(result.isContentSelected())
{
- a = pageAction(QWebPage::Copy);
- a->setIcon(KIcon("edit-copy"));
- a->setShortcut(KStandardShortcut::copy().primary());
- a->setText(i18n("Copy"));
+ a = pageAction(KWebPage::Copy);
if(!result.linkUrl().isEmpty())
- a->setText(i18n("Copy Text")); //for link
+ a->setText(i18n("Copy Text")); //for link
else
- a->setText(i18n("Copy"));
+ a->setText(i18n("Copy"));
menu.addAction(a);
}
// is content editable? Add PASTE
if(result.isContentEditable())
{
- a = pageAction(QWebPage::Paste);
- a->setIcon(KIcon("edit-paste"));
- a->setShortcut(KStandardShortcut::paste().primary());
- menu.addAction(a);
+ menu.addAction(pageAction(KWebPage::Paste));
}
// is content selected? Add SEARCH actions
@@ -225,14 +215,8 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
connect(a, SIGNAL(triggered(Qt::MouseButtons, Qt::KeyboardModifiers)), this, SLOT(viewImage(Qt::MouseButtons, Qt::KeyboardModifiers)));
menu.addAction(a);
- 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.addAction(pageAction(KWebPage::DownloadImageToDisk));
+ menu.addAction(pageAction(KWebPage::CopyImageToClipboard));
menu.addSeparator();
}
@@ -278,16 +262,12 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
QWebHistory *history = page()->history();
if(history->canGoBack())
{
- a = pageAction(QWebPage::Back);
- a->setIcon(KIcon("go-previous"));
- menu.addAction(a);
+ menu.addAction(pageAction(KWebPage::Back));
}
if(history->canGoForward())
{
- a = pageAction(QWebPage::Forward);
- a->setIcon(KIcon("go-next"));
- menu.addAction(a);
+ menu.addAction(pageAction(KWebPage::Forward));
}
menu.addAction(mainwindow->actionByName("view_redisplay"));
@@ -302,10 +282,7 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
//Frame
KActionMenu *frameMenu = new KActionMenu(i18n("Current Frame"), this);
- a = pageAction(QWebPage::OpenFrameInNewWindow);
- a->setText(i18n("Open Frame in New Tab"));
- a->setIcon(KIcon("view-right-new"));
- frameMenu->addAction(a);
+ frameMenu->addAction(pageAction(KWebPage::OpenFrameInNewWindow));
a = new KAction( KIcon("document-print-frame"), i18n("Print Frame"), this);
connect(a, SIGNAL(triggered()), this, SLOT(printFrame()));
@@ -315,12 +292,8 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
menu.addSeparator();
- //Page
- a = pageAction(QWebPage::SelectAll);
- a->setIcon(KIcon("edit-select-all"));
- a->setShortcut(KStandardShortcut::selectAll().primary());
- a->setText(i18n("Select All"));
- menu.addAction(a);
+ // Page Actions
+ menu.addAction(pageAction(KWebPage::SelectAll));
menu.addAction(mainwindow->actionByName(KStandardAction::name(KStandardAction::SaveAs)));
menu.addAction(mainwindow->actionByName("page_source"));
@@ -331,9 +304,7 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
if (page()->settings()->testAttribute(QWebSettings::DeveloperExtrasEnabled))
{
// Developer Extras actions
- a = pageAction(QWebPage::InspectElement);
- a->setIcon(KIcon("view-process-all"));
- menu.addAction(a);
+ menu.addAction(pageAction(KWebPage::InspectElement));
}
if(mainwindow->isFullScreen())
@@ -354,10 +325,10 @@ void WebView::mousePressEvent(QMouseEvent *event)
switch(event->button())
{
case Qt::XButton1:
- triggerPageAction(QWebPage::Back);
+ triggerPageAction(KWebPage::Back);
break;
case Qt::XButton2:
- triggerPageAction(QWebPage::Forward);
+ triggerPageAction(KWebPage::Forward);
break;
default:
QWebView::mousePressEvent(event);
@@ -378,20 +349,6 @@ QPoint WebView::mousePos()
}
-void WebView::wheelEvent(QWheelEvent *event)
-{
- if (QApplication::keyboardModifiers() & Qt::ControlModifier)
- {
- int numDegrees = event->delta() / 8;
- int numSteps = numDegrees / 15;
- setTextSizeMultiplier(textSizeMultiplier() + numSteps * 0.1);
- event->accept();
- return;
- }
- QWebView::wheelEvent(event);
-}
-
-
void WebView::search()
{
KAction *a = qobject_cast<KAction*>(sender());
@@ -455,15 +412,33 @@ void WebView::keyPressEvent(QKeyEvent *event)
{
if ((event->modifiers() == Qt::ControlModifier) && (event->key() == Qt::Key_C))
{
- triggerPageAction(QWebPage::Copy);
+ triggerPageAction(KWebPage::Copy);
return;
}
if ((event->modifiers() == Qt::ControlModifier) && (event->key() == Qt::Key_A))
{
- triggerPageAction(QWebPage::SelectAll);
+ triggerPageAction(KWebPage::SelectAll);
return;
}
QWebView::keyPressEvent(event);
}
+
+
+void WebView::loadInNewTab(const KUrl &url)
+{
+ Application::instance()->loadUrl(url, Rekonq::NewCurrentTab);
+}
+
+
+void WebView::downloadRequest(const KUrl &url)
+{
+ m_page->downloadRequest(QNetworkRequest(url));
+}
+
+
+void WebView::downloadRequest(const QNetworkRequest &request)
+{
+ m_page->downloadRequest(request);
+}
diff --git a/src/webview.h b/src/webview.h
index e860b8c8..4fa87978 100644
--- a/src/webview.h
+++ b/src/webview.h
@@ -33,13 +33,13 @@
#include <KUrl>
// Qt Includes
-#include <QWebView>
+#include <KWebView>
// Forward Declarations
class WebPage;
-class WebView : public QWebView
+class WebView : public KWebView
{
Q_OBJECT
@@ -55,9 +55,8 @@ public:
protected:
void contextMenuEvent(QContextMenuEvent *event);
- void mousePressEvent(QMouseEvent *event);
+ void mousePressEvent(QMouseEvent *event);// need to be ported
void mouseMoveEvent(QMouseEvent *event);
- void wheelEvent(QWheelEvent *event);
void keyPressEvent(QKeyEvent *event);
private slots:
@@ -72,6 +71,11 @@ private slots:
void openLinkInNewWindow();
void openLinkInNewTab();
+ void loadInNewTab(const KUrl &url);
+
+ void downloadRequest(const KUrl &url);
+ void downloadRequest(const QNetworkRequest &request);
+
private:
WebPage *m_page;
int m_progress;