Revert "Merge pull request #239 from calamares/qtwebengine"

This reverts commit 8f0fafa147, reversing
changes made to b8729bf1b3.
This commit is contained in:
Teo Mrnjavac 2016-03-24 20:03:05 +01:00
parent 8f0fafa147
commit 8806bb67ac
4 changed files with 10 additions and 69 deletions

View File

@ -1,42 +1,11 @@
list( APPEND CALA_WEBVIEW_INCLUDE_DIRECTORIES
${PROJECT_BINARY_DIR}/src/libcalamaresui
)
list( APPEND CALA_WEBVIEW_LINK_LIBRARIES
calamaresui
)
if ( Qt5Core_VERSION VERSION_LESS 5.6 )
find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED WebKit WebKitWidgets ) find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED WebKit WebKitWidgets )
list( APPEND CALA_WEBVIEW_INCLUDE_DIRECTORIES include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui
${QT_QTWEBKIT_INCLUDE_DIR} ${QT_QTWEBKIT_INCLUDE_DIR} )
)
list( APPEND CALA_WEBVIEW_LINK_LIBRARIES
Qt5::WebKit
Qt5::WebKitWidgets
)
set( WEBVIEW_WITH_WEBKIT 1 )
else()
find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED WebEngine WebEngineWidgets )
list( APPEND CALA_WEBVIEW_INCLUDE_DIRECTORIES
${QT_QTWEBENGINE_INCLUDE_DIR}
)
list( APPEND CALA_WEBVIEW_LINK_LIBRARIES
Qt5::WebEngine
Qt5::WebEngineWidgets
)
set( WEBVIEW_WITH_WEBENGINE 1 )
endif()
include_directories( ${CALA_WEBVIEW_INCLUDE_DIRECTORIES} )
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules ) ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/WebViewConfig.h.in
${CMAKE_CURRENT_BINARY_DIR}/WebViewConfig.h )
calamares_add_plugin( webview calamares_add_plugin( webview
TYPE viewmodule TYPE viewmodule
@ -44,6 +13,8 @@ calamares_add_plugin( webview
SOURCES SOURCES
WebViewStep.cpp WebViewStep.cpp
LINK_LIBRARIES LINK_LIBRARIES
${CALA_WEBVIEW_LINK_LIBRARIES} calamaresui
Qt5::WebKit
Qt5::WebKitWidgets
SHARED_LIB SHARED_LIB
) )

View File

@ -1,7 +0,0 @@
#ifndef CALAMARESWEBVIEWCONFIG_H
#define CALAMARESWEBVIEWCONFIG_H
#cmakedefine WEBVIEW_WITH_WEBENGINE
#cmakedefine WEBVIEW_WITH_WEBKIT
#endif // CALAMARESWEBVIEWCONFIG_H

View File

@ -1,7 +1,6 @@
/* === This file is part of Calamares - <http://github.com/calamares> === /* === This file is part of Calamares - <http://github.com/calamares> ===
* *
* Copyright 2015, Rohan Garg <rohan@garg.io> * Copyright 2015, Rohan Garg <rohan@garg.io>
* Copyright 2016, Teo Mrnjavac <teo@kde.org>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -20,12 +19,7 @@
#include "WebViewStep.h" #include "WebViewStep.h"
#include <QVariant> #include <QVariant>
#ifdef WEBVIEW_WITH_WEBKIT
#include <QWebView> #include <QWebView>
#else
#include <QWebEngineView>
#endif
CALAMARES_PLUGIN_FACTORY_DEFINITION( WebViewStepFactory, registerPlugin<WebViewStep>(); ) CALAMARES_PLUGIN_FACTORY_DEFINITION( WebViewStepFactory, registerPlugin<WebViewStep>(); )
@ -33,17 +27,7 @@ WebViewStep::WebViewStep( QObject* parent )
: Calamares::ViewStep( parent ) : Calamares::ViewStep( parent )
{ {
emit nextStatusChanged( true ); emit nextStatusChanged( true );
m_view = new C_QWEBVIEW(); m_view = new QWebView;
#ifdef WEBVIEW_WITH_WEBKIT
m_view->settings()->setFontFamily( QWebSettings::StandardFont,
m_view->settings()->
fontFamily( QWebSettings::SansSerifFont ) );
m_view->setRenderHints( QPainter::Antialiasing |
QPainter::TextAntialiasing |
QPainter::HighQualityAntialiasing |
QPainter::SmoothPixmapTransform |
QPainter::NonCosmeticDefaultPen );
#endif
} }

View File

@ -1,7 +1,6 @@
/* === This file is part of Calamares - <http://github.com/calamares> === /* === This file is part of Calamares - <http://github.com/calamares> ===
* *
* Copyright 2015, Rohan Garg <rohan@garg.io> * Copyright 2015, Rohan Garg <rohan@garg.io>
* Copyright 2016, Teo Mrnjavac <teo@kde.org>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -20,7 +19,7 @@
#ifndef WEBVIEWPLUGIN_H #ifndef WEBVIEWPLUGIN_H
#define WEBVIEWPLUGIN_H #define WEBVIEWPLUGIN_H
#include "WebViewConfig.h" #include <QObject>
#include <utils/PluginFactory.h> #include <utils/PluginFactory.h>
#include <viewpages/ViewStep.h> #include <viewpages/ViewStep.h>
@ -29,13 +28,7 @@
#include <QVariantMap> #include <QVariantMap>
#ifdef WEBVIEW_WITH_WEBKIT class QWebView;
#define C_QWEBVIEW QWebView
#else
#define C_QWEBVIEW QWebEngineView
#endif
class C_QWEBVIEW;
class PLUGINDLLEXPORT WebViewStep : public Calamares::ViewStep class PLUGINDLLEXPORT WebViewStep : public Calamares::ViewStep
{ {
@ -64,7 +57,7 @@ public:
void setConfigurationMap( const QVariantMap& configurationMap ) override; void setConfigurationMap( const QVariantMap& configurationMap ) override;
private: private:
C_QWEBVIEW *m_view; QWebView *m_view;
QString m_url; QString m_url;
QString m_prettyName; QString m_prettyName;
}; };