Fixed compilation with QtWebKit < 2.2 and AKN plugin.

remotes/origin/falkon
nowrep 14 years ago
parent 57d566490d
commit dbfc09538c
  1. 11
      BUILDING
  2. 2
      src/defines.pri
  3. 19
      src/lib/other/sourceviewer.cpp
  4. 4
      src/lib/plugins/pluginproxy.h
  5. 1
      src/lib/tools/htmlhighlighter.h
  6. 4
      src/lib/webview/webpage.cpp
  7. 6
      src/lib/webview/webpage.h
  8. 1
      src/plugins/AccessKeysNavigation/akn_plugin.cpp
  9. 2
      src/plugins/MouseGestures/MouseGestures.pro
  10. 1
      src/plugins/MouseGestures/mousegesturesplugin.cpp
  11. 2
      src/plugins/TestPlugin/TestPlugin.pro
  12. 1
      src/plugins/TestPlugin/testplugin.cpp

@ -75,6 +75,16 @@ Available Defines
example: example:
$ export USE_WEBGL="true" $ export USE_WEBGL="true"
USE_QTWEBKIT_2_2 Enable support for Geolocation and Notifications API.
You need to have QtWebKit version at least 2.2 to pass compilation
with this define.
Note: In order to get support for Geolocation and Notifications,
your QtWebKit has to be compiled with its support.
(disabled by default)
example:
$ export USE_QTWEBKIT_2_2="true"
NONBLOCK_JS_DIALOGS Enable non-blocking JavaScript dialogs from alert() prompt() NONBLOCK_JS_DIALOGS Enable non-blocking JavaScript dialogs from alert() prompt()
and confirm() functions. They are shown inside page and are not and confirm() functions. They are shown inside page and are not
blocking application window. blocking application window.
@ -129,4 +139,3 @@ Available Defines
example: example:
$ export QUPZILLA_PREFIX="/usr/" $ export QUPZILLA_PREFIX="/usr/"

@ -28,6 +28,7 @@ d_w7api = $$(W7API)
d_kde = $$(KDE) d_kde = $$(KDE)
d_portable = $$(PORTABLE_BUILD) d_portable = $$(PORTABLE_BUILD)
d_nonblock_dialogs = $$(NONBLOCK_JS_DIALOGS) d_nonblock_dialogs = $$(NONBLOCK_JS_DIALOGS)
d_use_qtwebkit_2_2 = $$(USE_QTWEBKIT_2_2)
equals(d_no_system_datapath, "true") { DEFINES += NO_SYSTEM_DATAPATH } equals(d_no_system_datapath, "true") { DEFINES += NO_SYSTEM_DATAPATH }
equals(d_use_webgl, "true") { DEFINES += USE_WEBGL } equals(d_use_webgl, "true") { DEFINES += USE_WEBGL }
@ -35,6 +36,7 @@ equals(d_w7api, "true") { DEFINES += W7API }
equals(d_kde, "true") { DEFINES += KDE } equals(d_kde, "true") { DEFINES += KDE }
equals(d_portable, "true") { DEFINES += PORTABLE_BUILD } equals(d_portable, "true") { DEFINES += PORTABLE_BUILD }
equals(d_nonblock_dialogs, "true") { DEFINES += NONBLOCK_JS_DIALOGS } equals(d_nonblock_dialogs, "true") { DEFINES += NONBLOCK_JS_DIALOGS }
equals(d_use_qtwebkit_2_2, "true") { DEFINES += USE_QTWEBKIT_2_2 }
!mac:unix { !mac:unix {
d_prefix = $$(QUPZILLA_PREFIX) d_prefix = $$(QUPZILLA_PREFIX)

@ -32,6 +32,8 @@
#include <QInputDialog> #include <QInputDialog>
#include <QWebFrame> #include <QWebFrame>
#include <QTextEdit>
SourceViewer::SourceViewer(QWebFrame* frame, const QString &selectedHtml) SourceViewer::SourceViewer(QWebFrame* frame, const QString &selectedHtml)
: QWidget(0) : QWidget(0)
, m_frame(frame) , m_frame(frame)
@ -41,6 +43,8 @@ SourceViewer::SourceViewer(QWebFrame* frame, const QString &selectedHtml)
m_layout = new QBoxLayout(QBoxLayout::TopToBottom, this); m_layout = new QBoxLayout(QBoxLayout::TopToBottom, this);
m_sourceEdit = new PlainEditWithLines(this); m_sourceEdit = new PlainEditWithLines(this);
m_sourceEdit->setObjectName("sourceviewer-textedit"); m_sourceEdit->setObjectName("sourceviewer-textedit");
m_sourceEdit->setReadOnly(true);
m_sourceEdit->setUndoRedoEnabled(false);
m_statusBar = new QStatusBar(this); m_statusBar = new QStatusBar(this);
m_statusBar->showMessage(frame->url().toString()); m_statusBar->showMessage(frame->url().toString());
@ -51,9 +55,7 @@ SourceViewer::SourceViewer(QWebFrame* frame, const QString &selectedHtml)
m_layout->setSpacing(0); m_layout->setSpacing(0);
m_layout->setMenuBar(menuBar); m_layout->setMenuBar(menuBar);
this->resize(650, 600); resize(650, 600);
m_sourceEdit->setReadOnly(true);
m_sourceEdit->moveCursor(QTextCursor::Start);
QFont font; QFont font;
font.setFamily("Tahoma"); font.setFamily("Tahoma");
@ -94,18 +96,14 @@ SourceViewer::SourceViewer(QWebFrame* frame, const QString &selectedHtml)
qz_centerWidgetToParent(this, frame->page()->view()); qz_centerWidgetToParent(this, frame->page()->view());
m_sourceEdit->setUndoRedoEnabled(false); m_sourceEdit->setPlainText(frame->toHtml());
m_sourceEdit->insertPlainText(frame->toHtml());
m_sourceEdit->setUndoRedoEnabled(true);
//Highlight selectedHtml //Highlight selectedHtml
if (!selectedHtml.isEmpty()) { if (!selectedHtml.isEmpty()) {
m_sourceEdit->find(selectedHtml, QTextDocument::FindWholeWords); m_sourceEdit->find(selectedHtml, QTextDocument::FindWholeWords);
} }
else { else {
QTextCursor cursor = m_sourceEdit->textCursor(); m_sourceEdit->moveCursor(QTextCursor::Start);
cursor.setPosition(0);
m_sourceEdit->setTextCursor(cursor);
} }
} }
@ -145,7 +143,7 @@ void SourceViewer::reload()
{ {
if (m_frame) { if (m_frame) {
m_sourceEdit->clear(); m_sourceEdit->clear();
m_sourceEdit->insertPlainText(m_frame.data()->toHtml()); m_sourceEdit->setPlainText(m_frame.data()->toHtml());
m_statusBar->showMessage(tr("Source reloaded")); m_statusBar->showMessage(tr("Source reloaded"));
} }
@ -157,6 +155,7 @@ void SourceViewer::reload()
void SourceViewer::setTextEditable() void SourceViewer::setTextEditable()
{ {
m_sourceEdit->setReadOnly(!m_sourceEdit->isReadOnly()); m_sourceEdit->setReadOnly(!m_sourceEdit->isReadOnly());
m_sourceEdit->setUndoRedoEnabled(true);
m_statusBar->showMessage(tr("Editable changed")); m_statusBar->showMessage(tr("Editable changed"));
} }

@ -18,11 +18,11 @@
#ifndef PLUGINPROXY_H #ifndef PLUGINPROXY_H
#define PLUGINPROXY_H #define PLUGINPROXY_H
#include "mainapplication.h"
#include "networkmanager.h"
#include "plugins.h" #include "plugins.h"
#include "qz_namespace.h" #include "qz_namespace.h"
class QupZilla;
class QT_QUPZILLA_EXPORT PluginProxy : public Plugins class QT_QUPZILLA_EXPORT PluginProxy : public Plugins
{ {
Q_OBJECT Q_OBJECT

@ -78,6 +78,7 @@ private:
QRegExp pattern; QRegExp pattern;
QTextCharFormat format; QTextCharFormat format;
}; };
QVector<HighlightingRule> highlightingRules; QVector<HighlightingRule> highlightingRules;
QRegExp commentStartExpression; QRegExp commentStartExpression;

@ -82,7 +82,7 @@ WebPage::WebPage(QupZilla* mainClass)
connect(mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(addJavaScriptObject())); connect(mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(addJavaScriptObject()));
#if (QTWEBKIT_VERSION >= QTWEBKIT_VERSION_CHECK(2, 2, 0)) #ifdef USE_QTWEBKIT_2_2
connect(this, SIGNAL(featurePermissionRequested(QWebFrame*, QWebPage::Feature)), this, SLOT(featurePermissionRequested(QWebFrame*, QWebPage::Feature))); connect(this, SIGNAL(featurePermissionRequested(QWebFrame*, QWebPage::Feature)), this, SLOT(featurePermissionRequested(QWebFrame*, QWebPage::Feature)));
#endif #endif
} }
@ -286,7 +286,7 @@ void WebPage::windowCloseRequested()
webView->closeView(); webView->closeView();
} }
#if (QTWEBKIT_VERSION >= QTWEBKIT_VERSION_CHECK(2, 2, 0)) #ifdef USE_QTWEBKIT_2_2
void WebPage::featurePermissionRequested(QWebFrame* frame, const QWebPage::Feature &feature) void WebPage::featurePermissionRequested(QWebFrame* frame, const QWebPage::Feature &feature)
{ {
// We should probably ask user here ... -,- // We should probably ask user here ... -,-

@ -75,7 +75,6 @@ signals:
void privacyChanged(bool status); void privacyChanged(bool status);
protected slots: protected slots:
QWebPage* createWindow(QWebPage::WebWindowType type);
void handleUnsupportedContent(QNetworkReply* url); void handleUnsupportedContent(QNetworkReply* url);
void progress(int prog); void progress(int prog);
@ -91,10 +90,13 @@ private slots:
void downloadRequested(const QNetworkRequest &request); void downloadRequested(const QNetworkRequest &request);
void windowCloseRequested(); void windowCloseRequested();
#if (QTWEBKIT_VERSION >= QTWEBKIT_VERSION_CHECK(2, 2, 0)) #ifdef USE_QTWEBKIT_2_2
void featurePermissionRequested(QWebFrame* frame, const QWebPage::Feature &feature); void featurePermissionRequested(QWebFrame* frame, const QWebPage::Feature &feature);
#endif #endif
protected:
QWebPage* createWindow(QWebPage::WebWindowType type);
private: private:
virtual bool supportsExtension(Extension extension) const; virtual bool supportsExtension(Extension extension) const;
virtual bool extension(Extension extension, const ExtensionOption* option, ExtensionReturn* output = 0); virtual bool extension(Extension extension, const ExtensionOption* option, ExtensionReturn* output = 0);

@ -18,6 +18,7 @@
#include "akn_plugin.h" #include "akn_plugin.h"
#include "akn_handler.h" #include "akn_handler.h"
#include "akn_settings.h" #include "akn_settings.h"
#include "mainapplication.h"
#include "pluginproxy.h" #include "pluginproxy.h"
#include "qupzilla.h" #include "qupzilla.h"

@ -1,4 +1,4 @@
QT += network webkit QT += webkit
TARGET = MouseGestures TARGET = MouseGestures
os2: TARGET = MouseGes os2: TARGET = MouseGes

@ -18,6 +18,7 @@
#include "mousegesturesplugin.h" #include "mousegesturesplugin.h"
#include "pluginproxy.h" #include "pluginproxy.h"
#include "mousegestures.h" #include "mousegestures.h"
#include "mainapplication.h"
#include "qupzilla.h" #include "qupzilla.h"
#include <QTranslator> #include <QTranslator>

@ -3,7 +3,7 @@
# Project created by QtCreator 2011-02-13T10:23:13 # Project created by QtCreator 2011-02-13T10:23:13
# #
#------------------------------------------------- #-------------------------------------------------
QT += network webkit QT += webkit
TARGET = TestPlugin TARGET = TestPlugin
# OS/2 allows only 8 chars in TARGET # OS/2 allows only 8 chars in TARGET
os2: TARGET = TestPlug os2: TARGET = TestPlug

@ -19,6 +19,7 @@
#include "qupzilla.h" #include "qupzilla.h"
#include "webview.h" #include "webview.h"
#include "pluginproxy.h" #include "pluginproxy.h"
#include "mainapplication.h"
#include <QTranslator> #include <QTranslator>
#include <QPushButton> #include <QPushButton>

Loading…
Cancel
Save