summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--data/home.html12
-rw-r--r--icons/hi128-app-rekonq.pngbin0 -> 21599 bytes
-rw-r--r--icons/hi16-app-rekonq.pngbin887 -> 954 bytes
-rw-r--r--icons/hi32-app-rekonq.pngbin2269 -> 2621 bytes
-rw-r--r--icons/hi64-app-rekonq.pngbin6071 -> 7571 bytes
-rw-r--r--icons/rekonq.svgzbin0 -> 32828 bytes
-rw-r--r--src/application.cpp15
-rw-r--r--src/autosaver.h4
-rw-r--r--src/bookmarks.cpp2
-rw-r--r--src/bookmarks.h3
-rw-r--r--src/cookiejar.h2
-rw-r--r--src/history.cpp1
-rw-r--r--src/history.h2
-rw-r--r--src/historymodels.cpp2
-rw-r--r--src/historymodels.h2
-rw-r--r--src/homepage.cpp16
-rw-r--r--src/main.cpp2
-rw-r--r--src/mainview.cpp4
-rw-r--r--src/mainview.h4
-rw-r--r--src/mainwindow.cpp27
-rw-r--r--src/mainwindow.h12
-rw-r--r--src/modelmenu.h2
-rw-r--r--src/networkaccessmanager.cpp1
-rw-r--r--src/panelhistory.cpp1
-rw-r--r--src/panelhistory.h1
-rw-r--r--src/previewimage.cpp25
-rw-r--r--src/previewimage.h3
-rw-r--r--src/sessionmanager.h2
-rw-r--r--src/settings.h2
-rw-r--r--src/tabbar.h3
-rw-r--r--src/urlbar.h1
-rw-r--r--src/webpluginfactory.cpp3
-rw-r--r--src/webpluginfactory.h1
-rw-r--r--src/websnap.cpp3
-rw-r--r--src/websnap.h4
-rw-r--r--src/webview.cpp55
-rw-r--r--src/webview.h14
38 files changed, 154 insertions, 79 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b5579402..7946e1b7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,7 +9,7 @@ PROJECT( rekonq )
# rekonq info
SET(REKONQ_MAJOR_VERSION "0")
SET(REKONQ_MINOR_VERSION "2")
-SET(REKONQ_PATCH_VERSION "62")
+SET(REKONQ_PATCH_VERSION "63")
SET(REKONQ_VERSION_STR
"${REKONQ_MAJOR_VERSION}.${REKONQ_MINOR_VERSION}.${REKONQ_PATCH_VERSION}"
diff --git a/data/home.html b/data/home.html
index c2953e40..1a193b07 100644
--- a/data/home.html
+++ b/data/home.html
@@ -23,7 +23,7 @@ text-align: center;
}
h1{
-font: normal bold 2em sans-serif;
+font: normal bold 1.5em sans-serif;
text-align:right;
color: #3F7AB7;
margin-right:3%;
@@ -34,7 +34,8 @@ float:right;
h2{
font: normal bold 1.2em sans-serif;
color: #3F7AB7;
-margin-top: 2em;
+text-align: left;
+margin: 20px 20px 20px 22px;
}
h3{
@@ -118,6 +119,7 @@ padding: 14px 16px;
-webkit-background-clip: padding;
cursor: pointer;
}
+
.thumbnail a {
display: block;
text-align: center;
@@ -141,11 +143,11 @@ margin-bottom: 0.5em;
<body>
<div id="container">
-<div id="navigation">
-<h1>rekonq</h1>
%2
+<div id="navigation">
+%3
</div>
-<div id="content">%3</div>
+<div id="content">%4</div>
</div>
</body>
diff --git a/icons/hi128-app-rekonq.png b/icons/hi128-app-rekonq.png
new file mode 100644
index 00000000..c9eb8f0a
--- /dev/null
+++ b/icons/hi128-app-rekonq.png
Binary files differ
diff --git a/icons/hi16-app-rekonq.png b/icons/hi16-app-rekonq.png
index 2427ffef..f6c54bd0 100644
--- a/icons/hi16-app-rekonq.png
+++ b/icons/hi16-app-rekonq.png
Binary files differ
diff --git a/icons/hi32-app-rekonq.png b/icons/hi32-app-rekonq.png
index 110c6017..3beb22f4 100644
--- a/icons/hi32-app-rekonq.png
+++ b/icons/hi32-app-rekonq.png
Binary files differ
diff --git a/icons/hi64-app-rekonq.png b/icons/hi64-app-rekonq.png
index 74d350a5..bdd13d12 100644
--- a/icons/hi64-app-rekonq.png
+++ b/icons/hi64-app-rekonq.png
Binary files differ
diff --git a/icons/rekonq.svgz b/icons/rekonq.svgz
new file mode 100644
index 00000000..ee927542
--- /dev/null
+++ b/icons/rekonq.svgz
Binary files differ
diff --git a/src/application.cpp b/src/application.cpp
index a7ac47ce..e3c06a5b 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -52,7 +52,6 @@
#include <KToolInvocation>
#include <KUriFilter>
#include <KMessageBox>
-#include <KProtocolInfo>
#include <KWindowInfo>
// Qt Includes
@@ -95,7 +94,7 @@ int Application::newInstance()
if (isSessionRestored() && sessionManager()->restoreSession())
{
kDebug() << "session restored";
- return 0;
+ return 1;
}
// --------------------------------------------------------------------------
@@ -115,7 +114,7 @@ int Application::newInstance()
for (int i = 0; i < args->count(); ++i)
loadUrl(args->arg(i), Rekonq::NewCurrentTab);
- return 1;
+ return 2;
}
}
@@ -125,14 +124,14 @@ int Application::newInstance()
for (int i = 1; i < args->count(); ++i)
loadUrl(args->arg(i), Rekonq::SettingOpenTab);
- return 2;
+ return 3;
}
// creating new window
MainWindow *w = newMainWindow();
w->slotHome();
- return 3;
+ return 0;
}
@@ -337,12 +336,6 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type)
loadingUrl = data.uri().url();
}
- if ( !KProtocolInfo::isKnownProtocol( loadingUrl ) )
- {
- KMessageBox::error(0, i18n("Protocol not supported:\n%1", url.protocol()));
- return;
- }
-
WebView *webView = 0;
MainWindow *w = 0;
diff --git a/src/autosaver.h b/src/autosaver.h
index 221c225c..80583f9c 100644
--- a/src/autosaver.h
+++ b/src/autosaver.h
@@ -28,14 +28,14 @@
#ifndef AUTOSAVER_H
#define AUTOSAVER_H
+
// Qt Includes
#include <QtCore/QObject>
#include <QtCore/QBasicTimer>
#include <QtCore/QTime>
-
-// Forward Declarations
#include <QtCore/QTimerEvent>
+
/**
* This class will call the save() slot on the parent object when the parent changes.
* It will wait several seconds after changed() to combining multiple changes and
diff --git a/src/bookmarks.cpp b/src/bookmarks.cpp
index e7f572b2..c08784e9 100644
--- a/src/bookmarks.cpp
+++ b/src/bookmarks.cpp
@@ -66,7 +66,7 @@ void BookmarkOwner::openBookmark(const KBookmark & bookmark,
{
if (keyboardModifiers & Qt::ControlModifier || mouseButtons == Qt::MidButton)
{
- emit openUrl(bookmark.url(), Rekonq::SettingOpenTab);
+ emit openUrl(bookmark.url(), Rekonq::NewCurrentTab);
}
else
{
diff --git a/src/bookmarks.h b/src/bookmarks.h
index 5fd0ebee..0fde004f 100644
--- a/src/bookmarks.h
+++ b/src/bookmarks.h
@@ -29,6 +29,7 @@
#ifndef BOOKMARKS_H
#define BOOKMARKS_H
+
// Local Includes
#include "application.h"
@@ -124,6 +125,7 @@ signals:
// ------------------------------------------------------------------------------
+// KDE Includes
#include <KBookmarkMenu>
@@ -243,4 +245,3 @@ private:
};
#endif
-
diff --git a/src/cookiejar.h b/src/cookiejar.h
index 3f9f366c..9ae24409 100644
--- a/src/cookiejar.h
+++ b/src/cookiejar.h
@@ -28,10 +28,10 @@
#ifndef RECOOKIEJAR_H
#define RECOOKIEJAR_H
+
// Qt Includes
#include <QtNetwork/QNetworkCookieJar>
-
// Forward Declarations
class QUrl;
diff --git a/src/history.cpp b/src/history.cpp
index aac3a66d..c3ccbad2 100644
--- a/src/history.cpp
+++ b/src/history.cpp
@@ -56,7 +56,6 @@
#include <QtGui/QClipboard>
-
// generic algorithms
#include <QtAlgorithms>
diff --git a/src/history.h b/src/history.h
index bd7fd7fc..2ccf8cb4 100644
--- a/src/history.h
+++ b/src/history.h
@@ -29,6 +29,7 @@
#ifndef HISTORY_H
#define HISTORY_H
+
// Local Includes
#include "modelmenu.h"
@@ -48,7 +49,6 @@
* Elements in this class represent an history item
*
*/
-
class HistoryItem
{
public:
diff --git a/src/historymodels.cpp b/src/historymodels.cpp
index 5209670b..446791ee 100644
--- a/src/historymodels.cpp
+++ b/src/historymodels.cpp
@@ -53,12 +53,10 @@
#include <QtGui/QClipboard>
-
// generic algorithms
#include <QtAlgorithms>
-
HistoryModel::HistoryModel(HistoryManager *history, QObject *parent)
: QAbstractTableModel(parent)
, m_history(history)
diff --git a/src/historymodels.h b/src/historymodels.h
index 22a7bccd..93e72c6a 100644
--- a/src/historymodels.h
+++ b/src/historymodels.h
@@ -29,6 +29,7 @@
#ifndef HISTORYMODELS_H
#define HISTORYMODELS_H
+
// Local Includes
#include "history.h"
#include "modelmenu.h"
@@ -45,7 +46,6 @@
#include <QWebHistoryInterface>
-
class HistoryModel : public QAbstractTableModel
{
Q_OBJECT
diff --git a/src/homepage.cpp b/src/homepage.cpp
index bd0fb22b..98060bed 100644
--- a/src/homepage.cpp
+++ b/src/homepage.cpp
@@ -74,18 +74,31 @@ QString HomePage::rekonqHomePage(const KUrl &url)
QString imagesPath = QString("file://") + KGlobal::dirs()->findResourceDir("data", "rekonq/pics/bg.png") + QString("rekonq/pics");
QString menu = homePageMenu(url);
- QString speed;
+ QString title, speed;
if(url == KUrl("rekonq:lastSites"))
+ {
+ title = "<h2>" + i18n("Last Visited Sites") + "</h2>";
speed = lastVisitedSites();
+ }
if(url == KUrl("rekonq:history"))
+ {
+ title = "<h2>" + i18n("History") + "</h2>";
speed = fillHistory();
+ }
if(url == KUrl("rekonq:bookmarks"))
+ {
+ title = "<h2>" + i18n("Bookmarks") + "</h2>";
speed = fillBookmarks();
+ }
if(url == KUrl("rekonq:home") || url == KUrl("rekonq:favorites"))
+ {
+ title = "<h2>" + i18n("Favorites") + "</h2>";
speed = fillFavorites();
+ }
QString html = QString(QLatin1String(file.readAll()))
.arg(imagesPath)
+ .arg(title)
.arg(menu)
.arg(speed)
;
@@ -194,7 +207,6 @@ QString HomePage::homePageMenu(KUrl currentUrl)
menu += "<img src=\"file:///" + loader->iconPath("rating", KIconLoader::Desktop) + "\" />";
menu += "Favorites</a></div>";
-
return menu;
}
diff --git a/src/main.cpp b/src/main.cpp
index 35fdb5dd..daf8535d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -38,7 +38,7 @@ static const char description[] =
I18N_NOOP("A lightweight Web Browser for KDE based on WebKit");
-static const char version[] = "0.2.62";
+static const char version[] = "0.2.63";
int main(int argc, char **argv)
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 4fa40b6d..a7ec6734 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -67,6 +67,7 @@
#include <QtGui/QPainter>
#include <QtGui/QVBoxLayout>
+
MainView::MainView(QWidget *parent)
: KTabWidget(parent)
, m_urlBar(new UrlBar(this))
@@ -274,9 +275,6 @@ WebView *MainView::newWebView(bool focused, bool nearParent)
connect(webView, SIGNAL(titleChanged(const QString &)), this, SLOT(webViewTitleChanged(const QString &)));
connect(webView, SIGNAL(urlChanged(const QUrl &)), this, SLOT(webViewUrlChanged(const QUrl &)));
- connect(webView, SIGNAL(ctrlTabPressed()), this, SLOT(nextTab()));
- connect(webView, SIGNAL(shiftCtrlTabPressed()), this, SLOT(previousTab()));
-
// connecting webPage signals with mainview
connect(webView->page(), SIGNAL(windowCloseRequested()), this, SLOT(windowCloseRequested()));
connect(webView->page(), SIGNAL(printRequested(QWebFrame *)), this, SIGNAL(printRequested(QWebFrame *)));
diff --git a/src/mainview.h b/src/mainview.h
index 548bc0f1..f8c94032 100644
--- a/src/mainview.h
+++ b/src/mainview.h
@@ -29,6 +29,7 @@
#ifndef MAINVIEW_H
#define MAINVIEW_H
+
// Local Includes
#include "webview.h"
#include "webpage.h"
@@ -37,8 +38,6 @@
// KDE Includes
#include <KTabWidget>
-// Qt Includes
-
// Forward Declarations
class QUrl;
class QWebFrame;
@@ -50,6 +49,7 @@ class UrlBar;
class KPassivePopup;
+
/**
* This class represent rekonq Main View. It contains all WebViews and a stack widget
* of associated line edits.
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index b7996a3a..ac9b83bb 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -193,6 +193,10 @@ void MainWindow::postLaunch()
connect(m_view, SIGNAL(setCurrentTitle(const QString &)), this, SLOT(slotUpdateWindowTitle(const QString &)));
connect(m_view, SIGNAL(printRequested(QWebFrame *)), this, SLOT(printRequested(QWebFrame *)));
+ // (shift +) ctrl + tab switching
+ connect(this, SIGNAL(ctrlTabPressed()), m_view, SLOT(nextTab()));
+ connect(this, SIGNAL(shiftCtrlTabPressed()), m_view, SLOT(previousTab()));
+
// update toolbar actions signals
connect(m_view, SIGNAL(tabsChanged()), this, SLOT(slotUpdateActions()));
connect(m_view, SIGNAL(currentChanged(int)), this, SLOT(slotUpdateActions()));
@@ -459,10 +463,19 @@ void MainWindow::slotUpdateConfiguration()
defaultSettings->setAttribute(QWebSettings::LinksIncludedInFocusChain, ReKonfig::linksIncludedInFocusChain());
defaultSettings->setAttribute(QWebSettings::ZoomTextOnly, ReKonfig::zoomTextOnly());
defaultSettings->setAttribute(QWebSettings::PrintElementBackgrounds, ReKonfig::printElementBackgrounds());
+
+ // ===== HTML 5 features WebKit support ======
defaultSettings->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, ReKonfig::offlineStorageDatabaseEnabled());
defaultSettings->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, ReKonfig::offlineWebApplicationCacheEnabled());
defaultSettings->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, ReKonfig::localStorageDatabaseEnabled());
-
+ if(ReKonfig::localStorageDatabaseEnabled())
+ {
+ QString path = KStandardDirs::locateLocal("cache", QString("WebkitLocalStorage/rekonq"), true);
+ path.remove("rekonq");
+ QWebSettings::setOfflineStoragePath(path);
+ QWebSettings::setOfflineStorageDefaultQuota(50000);
+ }
+
// Applies user defined CSS to all open webpages. If there no longer is a
// user defined CSS removes it from all open webpages.
defaultSettings->setUserStyleSheetUrl(ReKonfig::userCSS());
@@ -872,6 +885,18 @@ void MainWindow::keyPressEvent(QKeyEvent *event)
return;
}
+ if ((event->modifiers() == Qt::ControlModifier) && (event->key() == Qt::Key_Tab))
+ {
+ emit ctrlTabPressed();
+ return;
+ }
+
+ if ((event->modifiers() == Qt::ControlModifier + Qt::ShiftModifier) && (event->key() == Qt::Key_Backtab))
+ {
+ emit shiftCtrlTabPressed();
+ return;
+ }
+
KMainWindow::keyPressEvent(event);
}
diff --git a/src/mainwindow.h b/src/mainwindow.h
index b8352b4c..c680cc60 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -94,8 +94,20 @@ public slots:
void printRequested(QWebFrame *frame = 0);
+
+signals:
+ // switching tabs
+ void ctrlTabPressed();
+ void shiftCtrlTabPressed();
+
protected:
bool queryClose();
+
+ /**
+ * Filters (SHIFT + ) CTRL + TAB events and emit (shift)ctrlTabPressed()
+ * to make switch tab
+ * Filters out ESC key to show/hide the search bar
+ */
void keyPressEvent(QKeyEvent *event);
private slots:
diff --git a/src/modelmenu.h b/src/modelmenu.h
index b30a9598..719319bc 100644
--- a/src/modelmenu.h
+++ b/src/modelmenu.h
@@ -45,12 +45,12 @@ class QPersistentModelIndex;
class KIcon;
+
/**
* A KMenu that is dynamically populated
* from a QAbstractItemModel
*
*/
-
class ModelMenu : public KMenu
{
Q_OBJECT
diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp
index 10a7978f..fd975062 100644
--- a/src/networkaccessmanager.cpp
+++ b/src/networkaccessmanager.cpp
@@ -54,7 +54,6 @@
#include <QtNetwork/QNetworkDiskCache>
-
NetworkAccessManager::NetworkAccessManager(QObject *parent)
: AccessManager(parent)
{
diff --git a/src/panelhistory.cpp b/src/panelhistory.cpp
index d6367669..60338ef7 100644
--- a/src/panelhistory.cpp
+++ b/src/panelhistory.cpp
@@ -38,6 +38,7 @@
#include <KLineEdit>
#include <KLocalizedString>
+
PanelHistory::PanelHistory(QWidget *parent)
: QWidget(parent)
, m_historyTreeView(new QTreeView)
diff --git a/src/panelhistory.h b/src/panelhistory.h
index 81beefb5..68421c4e 100644
--- a/src/panelhistory.h
+++ b/src/panelhistory.h
@@ -28,6 +28,7 @@
#ifndef PANELHISTORY_H
#define PANELHISTORY_H
+
// Local Includes
#include "application.h"
#include "historymodels.h"
diff --git a/src/previewimage.cpp b/src/previewimage.cpp
index 60207fb3..07eca1b0 100644
--- a/src/previewimage.cpp
+++ b/src/previewimage.cpp
@@ -23,18 +23,24 @@
*
* ============================================================ */
+
+// Self Includes
#include "previewimage.h"
#include "previewimage.moc"
+// Local Includes
#include "application.h"
-#include <QFile>
-#include <QMovie>
-
+// KDE Includes
#include <KUrl>
#include <KStandardDirs>
#include <KDebug>
+// Qt Includes
+#include <QFile>
+#include <QMovie>
+#include <QMouseEvent>
+
PreviewImage::PreviewImage(const QUrl &url)
: QLabel()
@@ -83,8 +89,17 @@ void PreviewImage::setSiteImage()
void PreviewImage::mousePressEvent(QMouseEvent *event)
{
- Q_UNUSED(event)
- Application::instance()->loadUrl(m_url);
+ switch(event->button())
+ {
+ case Qt::LeftButton:
+ Application::instance()->loadUrl(m_url);
+ break;
+ case Qt::RightButton:
+ // TODO
+ break;
+ default:
+ QLabel::mousePressEvent(event);
+ };
}
diff --git a/src/previewimage.h b/src/previewimage.h
index 96a11c20..b3f184aa 100644
--- a/src/previewimage.h
+++ b/src/previewimage.h
@@ -27,9 +27,10 @@
#ifndef PREVIEW_IMAGE_H
#define PREVIEW_IMAGE_H
-
+// Local Includes
#include "websnap.h"
+// Qt Includes
#include <QLabel>
#include <QImage>
#include <QUrl>
diff --git a/src/sessionmanager.h b/src/sessionmanager.h
index 12435702..f1b7a71f 100644
--- a/src/sessionmanager.h
+++ b/src/sessionmanager.h
@@ -36,7 +36,7 @@
/**
- *
+ * Session Management
*/
class SessionManager : public QObject
{
diff --git a/src/settings.h b/src/settings.h
index 0be89173..3aa943c7 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -29,6 +29,7 @@
#ifndef SETTINGS_H
#define SETTINGS_H
+
// KDE Includes
#include <KConfigDialog>
@@ -36,6 +37,7 @@
class QWidget;
class Private;
+
class SettingsDialog : public KConfigDialog
{
Q_OBJECT
diff --git a/src/tabbar.h b/src/tabbar.h
index a86ba4d6..5f43980f 100644
--- a/src/tabbar.h
+++ b/src/tabbar.h
@@ -30,6 +30,7 @@
#ifndef TABBAR_H
#define TABBAR_H
+
// KDE Includes
#include <KTabBar>
@@ -37,12 +38,12 @@
class QPoint;
class QToolButton;
+
/**
* Tab bar with a few more features such as
* a context menu and shortcuts
*
*/
-
class TabBar : public KTabBar
{
Q_OBJECT
diff --git a/src/urlbar.h b/src/urlbar.h
index 80fbb759..28b1dc08 100644
--- a/src/urlbar.h
+++ b/src/urlbar.h
@@ -47,6 +47,7 @@ class QWidget;
class KCompletion;
class HistoryCompletionModel;
+
class UrlBar : public KHistoryComboBox
{
Q_OBJECT
diff --git a/src/webpluginfactory.cpp b/src/webpluginfactory.cpp
index 5d99ff6d..bb3f4d06 100644
--- a/src/webpluginfactory.cpp
+++ b/src/webpluginfactory.cpp
@@ -28,12 +28,15 @@
#include "webpluginfactory.h"
#include "webpluginfactory.moc"
+// Local Includes
#include "application.h"
#include "mainwindow.h"
#include "previewimage.h"
+// KDE Includes
#include <KDebug>
+
WebPluginFactory::WebPluginFactory(QObject *parent)
: QWebPluginFactory(parent)
{
diff --git a/src/webpluginfactory.h b/src/webpluginfactory.h
index c63b0ce3..738605db 100644
--- a/src/webpluginfactory.h
+++ b/src/webpluginfactory.h
@@ -28,6 +28,7 @@
#define WEB_PLUGIN_FACTORY_H
+// Qt Includes
#include <QtWebKit/QWebPluginFactory>
#include <QtCore/QList>
#include <QtGui/QWidget>
diff --git a/src/websnap.cpp b/src/websnap.cpp
index 284e8fc5..35f1cd39 100644
--- a/src/websnap.cpp
+++ b/src/websnap.cpp
@@ -25,12 +25,15 @@
* ============================================================ */
+// Self Includes
#include "websnap.h"
#include "websnap.moc"
+// KDE Includes
#include <KDebug>
#include <KStandardDirs>
+// Qt Includes
#include <QSize>
#include <QWebFrame>
#include <QWebSettings>
diff --git a/src/websnap.h b/src/websnap.h
index ee513154..7417456b 100644
--- a/src/websnap.h
+++ b/src/websnap.h
@@ -24,12 +24,14 @@
*
* ============================================================ */
+
#ifndef WEB_SNAP_H
#define WEB_SNAP_H
-
+// KDE Includes
#include <KUrl>
+// Qt Includes
#include <QtCore/QObject>
#include <QPixmap>
#include <QWebPage>
diff --git a/src/webview.cpp b/src/webview.cpp
index 417da6bc..ac6f4566 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -67,6 +67,11 @@ WebView::WebView(QWidget* parent)
}
+WebView::~WebView()
+{
+}
+
+
WebPage *WebView::page()
{
if(!m_page)
@@ -179,7 +184,7 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
if(!engine.isEmpty())
{
service = KService::serviceByDesktopPath(QString("searchproviders/%1.desktop").arg(engine));
- const QString searchProviderPrefix = *(service->property("Keys").toStringList().begin()) + keywordDelimiter;
+ const QString searchProviderPrefix = *(service->property("Keys").toStringList().begin()) + keywordDelimiter; // FIXME crashed
data.setData(searchProviderPrefix + "some keyword");
a = new KAction(service->name(), this);
a->setIcon(Application::icon(KUrl(data.uri())));
@@ -188,7 +193,12 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
searchMenu->addAction(a);
}
}
- menu.addAction(searchMenu);
+
+ if (!searchMenu->menu()->isEmpty())
+ {
+ menu.addAction(searchMenu);
+ }
+
menu.addSeparator();
// TODO Add translate, show translation
}
@@ -198,7 +208,12 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
{
menu.addSeparator();
- // TODO Add "View Image" && remove copy_this_image action
+ // TODO remove copy_this_image action
+ a = new KAction(KIcon("view-media-visualization"), i18n("&View Image"), this);
+ a->setData(result.imageUrl());
+ 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);
@@ -304,24 +319,6 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
}
-void WebView::keyPressEvent(QKeyEvent *event)
-{
- if ((event->modifiers() == Qt::ControlModifier) && (event->key() == Qt::Key_Tab))
- {
- emit ctrlTabPressed();
- return;
- }
-
- if ((event->modifiers() == Qt::ControlModifier + Qt::ShiftModifier) && (event->key() == Qt::Key_Backtab))
- {
- emit shiftCtrlTabPressed();
- return;
- }
-
- QWebView::keyPressEvent(event);
-}
-
-
void WebView::mousePressEvent(QMouseEvent *event)
{
m_page->m_pressedButtons = event->buttons();
@@ -382,6 +379,22 @@ void WebView::printFrame()
}
+void WebView::viewImage(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
+{
+ KAction *a = qobject_cast<KAction*>(sender());
+ KUrl url(a->data().toUrl());
+
+ if (modifiers & Qt::ControlModifier || buttons == Qt::MidButton)
+ {
+ Application::instance()->loadUrl(url, Rekonq::SettingOpenTab);
+ }
+ else
+ {
+ Application::instance()->loadUrl(url, Rekonq::CurrentTab);
+ }
+}
+
+
void WebView::openLinkInNewWindow()
{
KAction *a = qobject_cast<KAction*>(sender());
diff --git a/src/webview.h b/src/webview.h
index baf8f9f5..4dc7306d 100644
--- a/src/webview.h
+++ b/src/webview.h
@@ -45,25 +45,16 @@ class WebView : public QWebView
public:
explicit WebView(QWidget *parent = 0);
-
+ ~WebView();
+
WebPage *page();
KUrl url() const;
QString lastStatusBarText() const;
int progress();
-signals:
- // switching tabs
- void ctrlTabPressed();
- void shiftCtrlTabPressed();
-
protected:
void contextMenuEvent(QContextMenuEvent *event);
void mousePressEvent(QMouseEvent *event);
- /**
- * Filters (SHIFT + ) CTRL + TAB events and emit (shift)ctrlTabPressed()
- * to make switch tab
- */
- void keyPressEvent(QKeyEvent *event);
void wheelEvent(QWheelEvent *event);
private slots:
@@ -74,6 +65,7 @@ private slots:
void printFrame();
+ void viewImage(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
void openLinkInNewWindow();
void openLinkInNewTab();