From 2d9d65f33ce98cc261557ece7e374e21dfb536cf Mon Sep 17 00:00:00 2001 From: demmm Date: Fri, 1 Jul 2022 18:00:21 +0200 Subject: [PATCH] [webview] remove broken & unused module adjust settings.conf to replace webview example & entries this fixes https://github.com/calamares/calamares/issues/2003 --- settings.conf | 12 +-- src/modules/webview/CMakeLists.txt | 51 ----------- src/modules/webview/WebViewConfig.h.in | 10 --- src/modules/webview/WebViewStep.cpp | 117 ------------------------- src/modules/webview/WebViewStep.h | 71 --------------- src/modules/webview/owncloud.conf | 6 -- src/modules/webview/webview.conf | 6 -- 7 files changed, 6 insertions(+), 267 deletions(-) delete mode 100644 src/modules/webview/CMakeLists.txt delete mode 100644 src/modules/webview/WebViewConfig.h.in delete mode 100644 src/modules/webview/WebViewStep.cpp delete mode 100644 src/modules/webview/WebViewStep.h delete mode 100644 src/modules/webview/owncloud.conf delete mode 100644 src/modules/webview/webview.conf diff --git a/settings.conf b/settings.conf index 2897da9b6..8f4d60213 100644 --- a/settings.conf +++ b/settings.conf @@ -60,8 +60,8 @@ modules-search: [ local ] # the instances section can safely be left empty. # # Module name plus instance name makes an instance key, e.g. -# "webview@owncloud", where "webview" is the module name (for the webview -# viewmodule) and "owncloud" is the instance name. In the *sequence* +# "packagechooserq@licenseq", where "packagechooserq" is the module name (for the packagechooserq +# viewmodule) and "licenseq" is the instance name. In the *sequence* # section below, use instance-keys to name instances (instead of just # a module name, for modules which have only a single instance). # @@ -86,9 +86,9 @@ modules-search: [ local ] # # YAML: list of maps of string:string key-value pairs. #instances: -#- id: owncloud -# module: webview -# config: owncloud.conf +#- id: licenseq +# module: packagechooserq +# config: licenseq.conf # Sequence section. This section describes the sequence of modules, both # viewmodules and jobmodules, as they should appear and/or run. @@ -116,6 +116,7 @@ sequence: - show: - welcome # - notesqml +# - packagechooserq@licenseq - locale - keyboard - partition @@ -152,7 +153,6 @@ sequence: - bootloader - umount - show: -# - webview@owncloud - finished # A branding component is a directory, either in SHARE/calamares/branding or diff --git a/src/modules/webview/CMakeLists.txt b/src/modules/webview/CMakeLists.txt deleted file mode 100644 index b8ef5d7d4..000000000 --- a/src/modules/webview/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ -# === This file is part of Calamares - === -# -# SPDX-FileCopyrightText: 2020 Adriaan de Groot -# SPDX-License-Identifier: BSD-2-Clause -# -set(CALA_WEBVIEW_LINK_LIBRARIES "") - -option(WEBVIEW_FORCE_WEBKIT "Always build webview with WebKit instead of WebEngine regardless of Qt version." OFF) - -set(_reason "") - -message(STATUS "Found Qt version ${Qt5Core_VERSION}") -if(Qt5Core_VERSION VERSION_LESS 5.6 OR WEBVIEW_FORCE_WEBKIT) - message(STATUS " .. using webkit") - find_package(Qt5 ${QT_VERSION} CONFIG COMPONENTS WebKit WebKitWidgets) - - if(Qt5WebKit_FOUND AND Qt5WebKitWidgets_FOUND) - list(APPEND CALA_WEBVIEW_INCLUDE_DIRECTORIES ${QT_QTWEBKIT_INCLUDE_DIR}) - list(APPEND CALA_WEBVIEW_LINK_LIBRARIES Qt5::WebKit Qt5::WebKitWidgets) - set(WEBVIEW_WITH_WEBKIT 1) - else() - set(_reason "No suitable WebKit") - endif() -else() - message(STATUS " .. using webengine") - find_package(Qt5 ${QT_VERSION} CONFIG COMPONENTS WebEngine WebEngineWidgets) - - if(Qt5WebEngine_FOUND AND Qt5WebEngineWidgets_FOUND) - 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) - else() - set(_reason "No suitable WebEngine") - endif() -endif() - -if(NOT _reason) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/WebViewConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/WebViewConfig.h) - - calamares_add_plugin(webview - TYPE viewmodule - EXPORT_MACRO PLUGINDLLEXPORT_PRO - SOURCES - WebViewStep.cpp - LINK_PRIVATE_LIBRARIES - ${CALA_WEBVIEW_LINK_LIBRARIES} - SHARED_LIB - ) -else() - calamares_skip_module( "webview (${_reason})" ) -endif() diff --git a/src/modules/webview/WebViewConfig.h.in b/src/modules/webview/WebViewConfig.h.in deleted file mode 100644 index ddc07b31c..000000000 --- a/src/modules/webview/WebViewConfig.h.in +++ /dev/null @@ -1,10 +0,0 @@ -/* SPDX-FileCopyrightText: no - SPDX-License-Identifier: CC0-1.0 -*/ -#ifndef CALAMARESWEBVIEWCONFIG_H -#define CALAMARESWEBVIEWCONFIG_H - -#cmakedefine WEBVIEW_WITH_WEBENGINE -#cmakedefine WEBVIEW_WITH_WEBKIT - -#endif // CALAMARESWEBVIEWCONFIG_H diff --git a/src/modules/webview/WebViewStep.cpp b/src/modules/webview/WebViewStep.cpp deleted file mode 100644 index d787b8ec6..000000000 --- a/src/modules/webview/WebViewStep.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* === This file is part of Calamares - === - * - * SPDX-FileCopyrightText: 2015 Rohan Garg - * SPDX-FileCopyrightText: 2016 Teo Mrnjavac - * SPDX-License-Identifier: GPL-3.0-or-later - * - * Calamares is Free Software: see the License-Identifier above. - * - */ - -#include "WebViewStep.h" - -#include - -#ifdef WEBVIEW_WITH_WEBKIT -#include -#else -#include -#include -#endif - -CALAMARES_PLUGIN_FACTORY_DEFINITION( WebViewStepFactory, registerPlugin< WebViewStep >(); ) - -WebViewStep::WebViewStep( QObject* parent ) - : Calamares::ViewStep( parent ) -{ - emit nextStatusChanged( true ); -#ifdef WEBVIEW_WITH_WEBENGINE - QtWebEngine::initialize(); -#endif - m_view = new WebViewWidget(); -#ifdef WEBVIEW_WITH_WEBKIT - m_view->settings()->setFontFamily( QWebSettings::StandardFont, - m_view->settings()->fontFamily( QWebSettings::SansSerifFont ) ); - m_view->setRenderHints( QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform ); -#endif -} - - -WebViewStep::~WebViewStep() -{ - if ( m_view && m_view->parent() == nullptr ) - { - m_view->deleteLater(); - } -} - - -QString -WebViewStep::prettyName() const -{ - return m_prettyName; -} - - -QWidget* -WebViewStep::widget() -{ - return m_view; -} - - -bool -WebViewStep::isNextEnabled() const -{ - return true; -} - - -bool -WebViewStep::isBackEnabled() const -{ - return true; -} - - -bool -WebViewStep::isAtBeginning() const -{ - return true; -} - - -bool -WebViewStep::isAtEnd() const -{ - return true; -} - -void -WebViewStep::onActivate() -{ - m_view->load( QUrl( m_url ) ); - m_view->show(); -} - -QList< Calamares::job_ptr > -WebViewStep::jobs() const -{ - return QList< Calamares::job_ptr >(); -} - - -void -WebViewStep::setConfigurationMap( const QVariantMap& configurationMap ) -{ - if ( configurationMap.contains( "url" ) && configurationMap.value( "url" ).type() == QVariant::String ) - { - m_url = configurationMap.value( "url" ).toString(); - } - - if ( configurationMap.contains( "prettyName" ) - && configurationMap.value( "prettyName" ).type() == QVariant::String ) - { - m_prettyName = configurationMap.value( "prettyName" ).toString(); - } -} diff --git a/src/modules/webview/WebViewStep.h b/src/modules/webview/WebViewStep.h deleted file mode 100644 index 700da2856..000000000 --- a/src/modules/webview/WebViewStep.h +++ /dev/null @@ -1,71 +0,0 @@ -/* === This file is part of Calamares - === - * - * SPDX-FileCopyrightText: 2015 Rohan Garg - * SPDX-FileCopyrightText: 2016 Teo Mrnjavac - * SPDX-FileCopyrightText: 2017 Adriaan de Groot - * SPDX-License-Identifier: GPL-3.0-or-later - * - * Calamares is Free Software: see the License-Identifier above. - * - */ - -#ifndef WEBVIEWPLUGIN_H -#define WEBVIEWPLUGIN_H - -#include "WebViewConfig.h" - -#include "DllMacro.h" -#include "utils/PluginFactory.h" -#include "viewpages/ViewStep.h" - -#include - -#if defined( WEBVIEW_WITH_WEBKIT ) && defined( WEBVIEW_WITH_WEBENGINE ) -#error Both WEBENGINE and WEBKIT enabled -#endif -#if !defined( WEBVIEW_WITH_WEBKIT ) && !defined( WEBVIEW_WITH_WEBENGINE ) -#error Neither WEBENGINE nor WEBKIT enabled -#endif - -#ifdef WEBVIEW_WITH_WEBKIT -class QWebView; -using WebViewWidget = QWebView; -#endif -#ifdef WEBVIEW_WITH_WEBENGINE -class QWebEngineView; -using WebViewWidget = QWebEngineView; -#endif - -class PLUGINDLLEXPORT WebViewStep : public Calamares::ViewStep -{ - Q_OBJECT - -public: - explicit WebViewStep( QObject* parent = nullptr ); - ~WebViewStep() override; - - QString prettyName() const override; - - QWidget* widget() override; - - void onActivate() override; - - bool isNextEnabled() const override; - bool isBackEnabled() const override; - - bool isAtBeginning() const override; - bool isAtEnd() const override; - - QList< Calamares::job_ptr > jobs() const override; - - void setConfigurationMap( const QVariantMap& configurationMap ) override; - -private: - WebViewWidget* m_view; - QString m_url; - QString m_prettyName; -}; - -CALAMARES_PLUGIN_FACTORY_DECLARATION( WebViewStepFactory ) - -#endif // WEBVIEWPLUGIN_H diff --git a/src/modules/webview/owncloud.conf b/src/modules/webview/owncloud.conf deleted file mode 100644 index 4e2930919..000000000 --- a/src/modules/webview/owncloud.conf +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-FileCopyrightText: no -# SPDX-License-Identifier: CC0-1.0 -# ---- -prettyName: "OwnCloud" -url: "https://owncloud.org" diff --git a/src/modules/webview/webview.conf b/src/modules/webview/webview.conf deleted file mode 100644 index 353f81488..000000000 --- a/src/modules/webview/webview.conf +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-FileCopyrightText: no -# SPDX-License-Identifier: CC0-1.0 -# ---- -prettyName: "Webview" -url: "https://calamares.io"