diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-07-26 18:51:13 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-07-26 18:51:13 +0200 |
commit | c2cf251dfe808e1a4e336dbf1cddc645d63c2e2f (patch) | |
tree | f038c3a38a7532cf15f1d988ac4ad9b6954228e3 /src/webpage.cpp | |
parent | Fixing a bit GooWiki actions and updating TODO (diff) | |
download | rekonq-c2cf251dfe808e1a4e336dbf1cddc645d63c2e2f.tar.xz |
A lot of fixes here:
- CTRL + click browsing
- mouse wheel gestures
- cleaning a bit web* classes
This has been possible restoring some code from rekonq 0.1 web classes
implementation.
Diffstat (limited to 'src/webpage.cpp')
-rw-r--r-- | src/webpage.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/webpage.cpp b/src/webpage.cpp index bb6f0d9c..771b7f04 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -73,6 +73,8 @@ WebPage::WebPage(QObject *parent) : QWebPage(parent) + , m_keyboardModifiers(Qt::NoModifier) + , m_pressedButtons(Qt::NoButton) { setForwardUnsupportedContent(true); @@ -84,6 +86,34 @@ WebPage::WebPage(QObject *parent) } +bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type) +{ + if (m_keyboardModifiers & Qt::ControlModifier || m_pressedButtons == Qt::MidButton) + { + Application::instance()->loadUrl(request.url(), Rekonq::NewTab); + m_keyboardModifiers = Qt::NoModifier; + m_pressedButtons = Qt::NoButton; + return false; + } + + if (frame == mainFrame()) + { + return QWebPage::acceptNavigationRequest(frame, request, type); + } + else + { + // if frame doesn't exists (perhaps) we are pointing to a blank target.. + if (!frame) + { + Application::instance()->loadUrl(request.url(), Rekonq::NewTab); + return false; + } + } + + return QWebPage::acceptNavigationRequest(frame, request, type); +} + + WebPage *WebPage::createWindow(QWebPage::WebWindowType type) { kDebug() << "WebPage createWindow slot"; |