Merge branch 'extra_qml' into calamares
This commit is contained in:
commit
d7767afe1b
@ -1,6 +1,7 @@
|
||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2021 Adriaan de Groot <groot@kde.org>
|
||||
* SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* Calamares is Free Software: see the License-Identifier above.
|
||||
@ -99,7 +100,8 @@ Config::updateGlobalStorage( const QStringList& selected ) const
|
||||
{
|
||||
if ( m_method == PackageChooserMethod::Legacy )
|
||||
{
|
||||
QString value = selected.join( ',' );
|
||||
//QString value = selected.join( ',' );
|
||||
QString value = ( m_pkgc );
|
||||
Calamares::JobQueue::instance()->globalStorage()->insert( m_id, value );
|
||||
cDebug() << m_id<< "selected" << value;
|
||||
}
|
||||
@ -116,6 +118,18 @@ Config::updateGlobalStorage( const QStringList& selected ) const
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Config::setPkgc( const QString& pkgc )
|
||||
{
|
||||
m_pkgc = pkgc;
|
||||
emit pkgcChanged( m_pkgc );
|
||||
}
|
||||
|
||||
QString
|
||||
Config::prettyStatus() const
|
||||
{
|
||||
return tr( "Install option: <strong>%1</strong>" ).arg( m_pkgc );
|
||||
}
|
||||
|
||||
static void
|
||||
fillModel( PackageListModel* model, const QVariantList& items )
|
||||
@ -183,6 +197,7 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
PackageChooserMode::Required );
|
||||
m_method = PackageChooserMethodNames().find( CalamaresUtils::getString( configurationMap, "method" ),
|
||||
PackageChooserMethod::Legacy );
|
||||
m_pkgc = CalamaresUtils::getString( configurationMap, "pkgc" );
|
||||
|
||||
if ( m_method == PackageChooserMethod::Legacy )
|
||||
{
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2021 Adriaan de Groot <groot@kde.org>
|
||||
* SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* Calamares is Free Software: see the License-Identifier above.
|
||||
@ -39,6 +40,9 @@ class Config : public Calamares::ModuleSystem::Config
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY( QString pkgc READ pkgc WRITE setPkgc NOTIFY pkgcChanged )
|
||||
Q_PROPERTY( QString prettyStatus READ prettyStatus NOTIFY prettyStatusChanged FINAL )
|
||||
|
||||
public:
|
||||
Config( QObject* parent = nullptr );
|
||||
~Config() override;
|
||||
@ -74,6 +78,15 @@ public:
|
||||
/// As updateGlobalStorage() with an empty selection list
|
||||
void fillGSSecondaryConfiguration() const { updateGlobalStorage( QStringList() ); }
|
||||
|
||||
QString pkgc() const { return m_pkgc; }
|
||||
void setPkgc( const QString& pkgc );
|
||||
|
||||
QString prettyStatus() const;
|
||||
|
||||
signals:
|
||||
void pkgcChanged( QString pkgc );
|
||||
void prettyStatusChanged();
|
||||
|
||||
private:
|
||||
PackageListModel* m_model = nullptr;
|
||||
QModelIndex m_defaultModelIndex;
|
||||
@ -86,6 +99,8 @@ private:
|
||||
QString m_id;
|
||||
/// Value to use for id if none is set in the config file
|
||||
Calamares::ModuleSystem::InstanceKey m_defaultId;
|
||||
/// QML selection
|
||||
QString m_pkgc;
|
||||
};
|
||||
|
||||
|
||||
|
69
src/modules/packagechooserq/CMakeLists.txt
Normal file
69
src/modules/packagechooserq/CMakeLists.txt
Normal file
@ -0,0 +1,69 @@
|
||||
# === This file is part of Calamares - <https://calamares.io> ===
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
|
||||
# SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
if( NOT WITH_QML )
|
||||
calamares_skip_module( "packagechooserq (QML is not supported in this build)" )
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Core )
|
||||
|
||||
# Add optional libraries here
|
||||
set( USER_EXTRA_LIB )
|
||||
|
||||
# include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../packagechooser )
|
||||
set( _packagechooser ${CMAKE_CURRENT_SOURCE_DIR}/../packagechooser )
|
||||
include_directories( ${_packagechooser} )
|
||||
|
||||
### OPTIONAL AppData XML support in PackageModel
|
||||
#
|
||||
#
|
||||
# TODO:3.3:WITH->BUILD (this doesn't affect the ABI offered by Calamares)
|
||||
option( WITH_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" ON )
|
||||
if ( WITH_APPDATA )
|
||||
find_package(Qt5 COMPONENTS Xml)
|
||||
if ( Qt5Xml_FOUND )
|
||||
add_definitions( -DHAVE_APPDATA )
|
||||
list( APPEND _extra_libraries Qt5::Xml )
|
||||
list( APPEND _extra_src ItemAppData.cpp )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
### OPTIONAL AppStream support in PackageModel
|
||||
#
|
||||
#
|
||||
option( WITH_APPSTREAM "Support appstream: items in PackageChooser (requires libappstream-qt)" ON )
|
||||
if ( WITH_APPSTREAM )
|
||||
find_package(AppStreamQt)
|
||||
set_package_properties(
|
||||
AppStreamQt PROPERTIES
|
||||
DESCRIPTION "Support for AppStream (cache) data"
|
||||
URL "https://github.com/ximion/appstream"
|
||||
PURPOSE "AppStream provides package data"
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
if ( AppStreamQt_FOUND )
|
||||
add_definitions( -DHAVE_APPSTREAM )
|
||||
list( APPEND _extra_libraries AppStreamQt )
|
||||
list( APPEND _extra_src ItemAppStream.cpp )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
calamares_add_plugin( packagechooserq
|
||||
TYPE viewmodule
|
||||
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
||||
SOURCES
|
||||
PackageChooserQmlViewStep.cpp
|
||||
${_packagechooser}/Config.cpp
|
||||
${_packagechooser}/PackageModel.cpp
|
||||
${_packagechooser}/ItemAppData.cpp
|
||||
RESOURCES
|
||||
packagechooserq.qrc
|
||||
LINK_PRIVATE_LIBRARIES
|
||||
calamaresui
|
||||
${_extra_libraries}
|
||||
SHARED_LIB
|
||||
)
|
86
src/modules/packagechooserq/PackageChooserQmlViewStep.cpp
Normal file
86
src/modules/packagechooserq/PackageChooserQmlViewStep.cpp
Normal file
@ -0,0 +1,86 @@
|
||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2019 Adriaan de Groot <groot@kde.org>
|
||||
* SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* Calamares is Free Software: see the License-Identifier above.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "PackageChooserQmlViewStep.h"
|
||||
|
||||
#include "GlobalStorage.h"
|
||||
#include "JobQueue.h"
|
||||
#include "locale/TranslatableConfiguration.h"
|
||||
#include "utils/CalamaresUtilsSystem.h"
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/Variant.h"
|
||||
|
||||
CALAMARES_PLUGIN_FACTORY_DEFINITION( PackageChooserQmlViewStepFactory, registerPlugin< PackageChooserQmlViewStep >(); )
|
||||
|
||||
PackageChooserQmlViewStep::PackageChooserQmlViewStep( QObject* parent )
|
||||
: Calamares::QmlViewStep( parent )
|
||||
, m_config( new Config( this ) )
|
||||
{
|
||||
emit nextStatusChanged( true );
|
||||
}
|
||||
|
||||
QString
|
||||
PackageChooserQmlViewStep::prettyName() const
|
||||
{
|
||||
return tr( "Packages" );
|
||||
}
|
||||
|
||||
QString
|
||||
PackageChooserQmlViewStep::prettyStatus() const
|
||||
{
|
||||
//QString option = m_pkgc;
|
||||
//return tr( "Install option: %1" ).arg( option );
|
||||
return m_config->prettyStatus();
|
||||
}
|
||||
|
||||
bool
|
||||
PackageChooserQmlViewStep::isNextEnabled() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
PackageChooserQmlViewStep::isBackEnabled() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
PackageChooserQmlViewStep::isAtBeginning() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
PackageChooserQmlViewStep::isAtEnd() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Calamares::JobList
|
||||
PackageChooserQmlViewStep::jobs() const
|
||||
{
|
||||
Calamares::JobList l;
|
||||
return l;
|
||||
}
|
||||
|
||||
void
|
||||
PackageChooserQmlViewStep::onLeave()
|
||||
{
|
||||
m_config->fillGSSecondaryConfiguration();
|
||||
}
|
||||
|
||||
void
|
||||
PackageChooserQmlViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
{
|
||||
m_config->setDefaultId( moduleInstanceKey() );
|
||||
m_config->setConfigurationMap( configurationMap );
|
||||
Calamares::QmlViewStep::setConfigurationMap( configurationMap ); // call parent implementation last
|
||||
}
|
58
src/modules/packagechooserq/PackageChooserQmlViewStep.h
Normal file
58
src/modules/packagechooserq/PackageChooserQmlViewStep.h
Normal file
@ -0,0 +1,58 @@
|
||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2019 Adriaan de Groot <groot@kde.org>
|
||||
* SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* Calamares is Free Software: see the License-Identifier above.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef PACKAGECHOOSERQMLVIEWSTEP_H
|
||||
#define PACKAGECHOOSERQMLVIEWSTEP_H
|
||||
|
||||
// Config from packagechooser module
|
||||
#include "Config.h"
|
||||
|
||||
#include "DllMacro.h"
|
||||
#include "locale/TranslatableConfiguration.h"
|
||||
#include "utils/PluginFactory.h"
|
||||
#include "viewpages/QmlViewStep.h"
|
||||
|
||||
#include <QVariantMap>
|
||||
|
||||
class Config;
|
||||
class PackageChooserPage;
|
||||
|
||||
class PLUGINDLLEXPORT PackageChooserQmlViewStep : public Calamares::QmlViewStep
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PackageChooserQmlViewStep( QObject* parent = nullptr );
|
||||
|
||||
QString prettyName() const override;
|
||||
QString prettyStatus() const override;
|
||||
|
||||
bool isNextEnabled() const override;
|
||||
bool isBackEnabled() const override;
|
||||
|
||||
bool isAtBeginning() const override;
|
||||
bool isAtEnd() const override;
|
||||
|
||||
//void onActivate() override;
|
||||
void onLeave() override;
|
||||
|
||||
Calamares::JobList jobs() const override;
|
||||
|
||||
void setConfigurationMap( const QVariantMap& configurationMap ) override;
|
||||
|
||||
QObject* getConfig() override { return m_config; }
|
||||
|
||||
private:
|
||||
Config* m_config;
|
||||
};
|
||||
|
||||
CALAMARES_PLUGIN_FACTORY_DECLARATION( PackageChooserQmlViewStepFactory )
|
||||
|
||||
#endif // PACKAGECHOOSERQMLVIEWSTEP_H
|
BIN
src/modules/packagechooserq/images/libreoffice.jpg
Normal file
BIN
src/modules/packagechooserq/images/libreoffice.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
@ -0,0 +1,2 @@
|
||||
SPDX-FileCopyrightText: 2020 demmm <anke62@gmail.com>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
BIN
src/modules/packagechooserq/images/no-selection.png
Normal file
BIN
src/modules/packagechooserq/images/no-selection.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 184 KiB |
@ -0,0 +1,2 @@
|
||||
SPDX-FileCopyrightText: 2020 demmm <anke62@gmail.com>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
BIN
src/modules/packagechooserq/images/plasma.png
Normal file
BIN
src/modules/packagechooserq/images/plasma.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
2
src/modules/packagechooserq/images/plasma.png.license
Normal file
2
src/modules/packagechooserq/images/plasma.png.license
Normal file
@ -0,0 +1,2 @@
|
||||
SPDX-FileCopyrightText: 2021 pngegg <https://www.pngegg.com/>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
48
src/modules/packagechooserq/packagechooserq.conf
Normal file
48
src/modules/packagechooserq/packagechooserq.conf
Normal file
@ -0,0 +1,48 @@
|
||||
# SPDX-FileCopyrightText: no
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
#
|
||||
# Configuration for the low-density software chooser
|
||||
---
|
||||
# Software selection mode, to set whether the software packages
|
||||
# can be chosen singly, or multiply.
|
||||
#
|
||||
# Possible modes are "optional", "required" (for zero-or-one or exactly-one)
|
||||
# or "optionalmultiple", "requiredmultiple" (for zero-or-more
|
||||
# or one-or-more).
|
||||
mode: required
|
||||
|
||||
# Software installation method:
|
||||
#
|
||||
# - "legacy" or "custom" or "contextualprocess"
|
||||
# When set to "legacy", writes a GlobalStorage value for the choice that
|
||||
# has been made. The key is *packagechooser_<id>*. Normally, the module's
|
||||
# instance name is used; see the *instances* section of `settings.conf`.
|
||||
# If there is just one packagechooser module, and no special instance is set,
|
||||
# resulting GS key is probably *packagechooser@packagechooser*.
|
||||
# You can set *id* to change that, but it is not recommended.
|
||||
#
|
||||
# The GS value is a comma-separated list of the IDs of the selected
|
||||
# packages, or an empty string if none is selected.
|
||||
#
|
||||
# With "legacy" installation, you should have a contextualprocess or similar
|
||||
# module somewhere in the `exec` phase to process the GlobalStorage key
|
||||
# and actually **do** something for the packages.
|
||||
#
|
||||
# - "packages"
|
||||
# When set to "packages", writes GlobalStorage values suitable for
|
||||
# consumption by the *packages* module (which should appear later
|
||||
# in the `exec` section. These package settings will then be handed
|
||||
# off to whatever package manager is configured there.
|
||||
# The *id* key is not used.
|
||||
#
|
||||
# There is no need to put this module in the `exec` section. There
|
||||
# are no jobs that this module provides. You should put **other**
|
||||
# modules, either *contextualprocess* or *packages* or some custom
|
||||
# module, in the `exec` section to do the actual work.
|
||||
method: legacy
|
||||
# The *id* key is used only in "legacy" mode
|
||||
# id: ""
|
||||
|
||||
# The *pkgc* is used for setting the default selection in the QML view
|
||||
pkgc: libreoffice
|
||||
|
254
src/modules/packagechooserq/packagechooserq.qml
Normal file
254
src/modules/packagechooserq/packagechooserq.qml
Normal file
@ -0,0 +1,254 @@
|
||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* Calamares is Free Software: see the License-Identifier above.
|
||||
*
|
||||
*/
|
||||
|
||||
import io.calamares.core 1.0
|
||||
import io.calamares.ui 1.0
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
Item {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "#f2f2f2"
|
||||
|
||||
ButtonGroup {
|
||||
id: switchGroup
|
||||
}
|
||||
|
||||
Column {
|
||||
id: column
|
||||
anchors.centerIn: parent
|
||||
spacing: 5
|
||||
|
||||
Rectangle {
|
||||
//id: rectangle
|
||||
width: 700
|
||||
height: 150
|
||||
color: "#ffffff"
|
||||
radius: 10
|
||||
border.width: 0
|
||||
Text {
|
||||
width: 450
|
||||
height: 104
|
||||
anchors.centerIn: parent
|
||||
text: qsTr("LibreOffice is a powerful and free office suite, used by millions of people around the world. It includes several applications that make it the most versatile Free and Open Source office suite on the market.<br/>
|
||||
Default option.")
|
||||
font.pointSize: 10
|
||||
anchors.verticalCenterOffset: -10
|
||||
anchors.horizontalCenterOffset: 100
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
|
||||
Switch {
|
||||
id: element2
|
||||
x: 500
|
||||
y: 110
|
||||
width: 187
|
||||
height: 14
|
||||
text: qsTr("LibreOffice")
|
||||
checked: true
|
||||
hoverEnabled: true
|
||||
ButtonGroup.group: switchGroup
|
||||
|
||||
indicator: Rectangle {
|
||||
implicitWidth: 40
|
||||
implicitHeight: 14
|
||||
radius: 10
|
||||
color: element2.checked ? "#3498db" : "#B9B9B9"
|
||||
border.color: element2.checked ? "#3498db" : "#cccccc"
|
||||
|
||||
Rectangle {
|
||||
x: element2.checked ? parent.width - width : 0
|
||||
y: (parent.height - height) / 2
|
||||
width: 20
|
||||
height: 20
|
||||
radius: 10
|
||||
color: element2.down ? "#cccccc" : "#ffffff"
|
||||
border.color: element2.checked ? (element1.down ? "#3498db" : "#3498db") : "#999999"
|
||||
}
|
||||
}
|
||||
|
||||
onCheckedChanged: {
|
||||
if ( ! checked ) {
|
||||
print("L not used")
|
||||
}
|
||||
else {
|
||||
config.pkgc = "libreoffice"
|
||||
print( config.pkgc )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
id: image2
|
||||
x: 8
|
||||
y: 25
|
||||
height: 100
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source: "images/libreoffice.jpg"
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: 700
|
||||
height: 150
|
||||
radius: 10
|
||||
border.width: 0
|
||||
Text {
|
||||
width: 450
|
||||
height: 104
|
||||
anchors.centerIn: parent
|
||||
text: qsTr("If you don't want to install an office suite, just select No Office Suite. You can always add one (or more) later on your installed system as the need arrives.")
|
||||
font.pointSize: 10
|
||||
anchors.verticalCenterOffset: -10
|
||||
anchors.horizontalCenterOffset: 100
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
|
||||
Switch {
|
||||
id: element1
|
||||
x: 500
|
||||
y: 110
|
||||
width: 187
|
||||
height: 14
|
||||
text: qsTr("No Office Suite")
|
||||
checked: false
|
||||
hoverEnabled: true
|
||||
ButtonGroup.group: switchGroup
|
||||
|
||||
indicator: Rectangle {
|
||||
implicitWidth: 40
|
||||
implicitHeight: 14
|
||||
radius: 10
|
||||
color: element1.checked ? "#3498db" : "#B9B9B9"
|
||||
border.color: element1.checked ? "#3498db" : "#cccccc"
|
||||
|
||||
Rectangle {
|
||||
x: element1.checked ? parent.width - width : 0
|
||||
y: (parent.height - height) / 2
|
||||
width: 20
|
||||
height: 20
|
||||
radius: 10
|
||||
color: element1.down ? "#cccccc" : "#ffffff"
|
||||
border.color: element1.checked ? (element1.down ? "#3498db" : "#3498db") : "#999999"
|
||||
}
|
||||
}
|
||||
|
||||
onCheckedChanged: {
|
||||
if ( ! checked ) {
|
||||
print("not used")
|
||||
//console.log("removed")
|
||||
}
|
||||
else {
|
||||
print("No Office Suite")
|
||||
config.pkgc = "no_office_suite"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
id: image
|
||||
x: 8
|
||||
y: 25
|
||||
height: 100
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source: "images/no-selection.png"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: 700
|
||||
height: 150
|
||||
color: "#ffffff"
|
||||
radius: 10
|
||||
border.width: 0
|
||||
Text {
|
||||
width: 450
|
||||
height: 104
|
||||
anchors.centerIn: parent
|
||||
text: qsTr("Create a minimal Desktop install, remove all extra applications and decide later on what you would like to add to your system. Examples of what won't be on such an install, there will be no Office Suite, no media players, no image viewer or print support. It will be just a desktop, file browser, package manager, text editor and simple web-browser.")
|
||||
font.pointSize: 10
|
||||
anchors.verticalCenterOffset: -10
|
||||
anchors.horizontalCenterOffset: 100
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
|
||||
Switch {
|
||||
id: element3
|
||||
x: 500
|
||||
y: 110
|
||||
width: 187
|
||||
height: 14
|
||||
text: qsTr("Minimal Install")
|
||||
checked: false
|
||||
hoverEnabled: true
|
||||
ButtonGroup.group: switchGroup
|
||||
|
||||
indicator: Rectangle {
|
||||
implicitWidth: 40
|
||||
implicitHeight: 14
|
||||
radius: 10
|
||||
color: element3.checked ? "#3498db" : "#B9B9B9"
|
||||
border.color: element3.checked ? "#3498db" : "#cccccc"
|
||||
|
||||
Rectangle {
|
||||
x: element3.checked ? parent.width - width : 0
|
||||
y: (parent.height - height) / 2
|
||||
width: 20
|
||||
height: 20
|
||||
radius: 10
|
||||
color: element3.down ? "#cccccc" : "#ffffff"
|
||||
border.color: element3.checked ? (element3.down ? "#3498db" : "#3498db") : "#999999"
|
||||
}
|
||||
}
|
||||
|
||||
onCheckedChanged: {
|
||||
if ( ! checked ) {
|
||||
print("M not used")
|
||||
}
|
||||
else {
|
||||
print("minimal")
|
||||
config.pkgc = "minimal_install"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
id: image3
|
||||
x: 8
|
||||
y: 25
|
||||
height: 100
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source: "images/plasma.png"
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: 700
|
||||
height: 25
|
||||
color: "#f2f2f2"
|
||||
border.width: 0
|
||||
Text {
|
||||
height: 25
|
||||
anchors.centerIn: parent
|
||||
text: qsTr("Please select an option for your install, or use the default: LibreOffice included.")
|
||||
font.pointSize: 10
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
8
src/modules/packagechooserq/packagechooserq.qrc
Normal file
8
src/modules/packagechooserq/packagechooserq.qrc
Normal file
@ -0,0 +1,8 @@
|
||||
<RCC>
|
||||
<qresource>
|
||||
<file>packagechooserq.qml</file>
|
||||
<file>images/libreoffice.jpg</file>
|
||||
<file>images/no-selection.png</file>
|
||||
<file>images/plasma.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -227,7 +227,8 @@ fillGSConfigurationEFI( Calamares::GlobalStorage* gs, const QVariantMap& configu
|
||||
QString firmwareType( PartUtils::isEfiSystem() ? QStringLiteral( "efi" ) : QStringLiteral( "bios" ) );
|
||||
gs->insert( "firmwareType", firmwareType );
|
||||
|
||||
gs->insert( "efiSystemPartition", CalamaresUtils::getString( configurationMap, "efiSystemPartition", QStringLiteral( "/boot/efi" ) ) );
|
||||
gs->insert( "efiSystemPartition",
|
||||
CalamaresUtils::getString( configurationMap, "efiSystemPartition", QStringLiteral( "/boot/efi" ) ) );
|
||||
|
||||
// Read and parse key efiSystemPartitionSize
|
||||
if ( configurationMap.contains( "efiSystemPartitionSize" ) )
|
||||
@ -263,7 +264,8 @@ Config::fillConfigurationFSTypes(const QVariantMap& configurationMap)
|
||||
fsRealName = PartUtils::canonicalFilesystemName( fsName, &fsType );
|
||||
if ( fsType == FileSystem::Type::Unknown )
|
||||
{
|
||||
cWarning() << "Partition-module setting *defaultFileSystemType* is bad (" << fsName << ") using ext4 instead";
|
||||
cWarning() << "Partition-module setting *defaultFileSystemType* is bad (" << fsName
|
||||
<< ") using ext4 instead";
|
||||
fsRealName = PartUtils::canonicalFilesystemName( QStringLiteral( "ext4" ), &fsType );
|
||||
}
|
||||
else if ( fsRealName != fsName )
|
||||
|
@ -27,7 +27,8 @@ class Config : public QObject
|
||||
Q_PROPERTY( SwapChoice swapChoice READ swapChoice WRITE setSwapChoice NOTIFY swapChoiceChanged )
|
||||
|
||||
///@brief Name of the FS that will be used when erasing type disk (e.g. "default filesystem")
|
||||
Q_PROPERTY( QString eraseModeFilesystem READ eraseFsType WRITE setEraseFsTypeChoice NOTIFY eraseModeFilesystemChanged )
|
||||
Q_PROPERTY(
|
||||
QString eraseModeFilesystem READ eraseFsType WRITE setEraseFsTypeChoice NOTIFY eraseModeFilesystemChanged )
|
||||
|
||||
Q_PROPERTY( bool allowManualPartitioning READ allowManualPartitioning CONSTANT FINAL )
|
||||
|
||||
|
@ -109,13 +109,142 @@ PartitionViewStep::prettyName() const
|
||||
return tr( "Partitions" );
|
||||
}
|
||||
|
||||
|
||||
QWidget*
|
||||
PartitionViewStep::widget()
|
||||
/** @brief Gather the pretty descriptions of all the partitioning jobs
|
||||
*
|
||||
* Returns a QStringList of each job's pretty description, including
|
||||
* empty strings and duplicates. The list is in-order of how the
|
||||
* jobs will be run.
|
||||
*/
|
||||
static QStringList
|
||||
jobDescriptions( const Calamares::JobList& jobs )
|
||||
{
|
||||
return m_widget;
|
||||
QStringList jobsLines;
|
||||
for ( const Calamares::job_ptr& job : qAsConst( jobs ) )
|
||||
{
|
||||
if ( !job->prettyDescription().isEmpty() )
|
||||
{
|
||||
jobsLines.append( job->prettyDescription() );
|
||||
}
|
||||
}
|
||||
return jobsLines;
|
||||
}
|
||||
|
||||
/** @brief A top-level description of what @p choice does
|
||||
*
|
||||
* Returns a (branded) string describing what @p choice will do.
|
||||
*/
|
||||
static QString
|
||||
modeDescription( Config::InstallChoice choice )
|
||||
{
|
||||
const auto* branding = Calamares::Branding::instance();
|
||||
static const char context[] = "PartitionViewStep";
|
||||
|
||||
switch ( choice )
|
||||
{
|
||||
case Config::InstallChoice::Alongside:
|
||||
return QCoreApplication::translate( context, "Install %1 <strong>alongside</strong> another operating system." )
|
||||
.arg( branding->shortVersionedName() );
|
||||
break;
|
||||
case Config::InstallChoice::Erase:
|
||||
return QCoreApplication::translate( context, "<strong>Erase</strong> disk and install %1." )
|
||||
.arg( branding->shortVersionedName() );
|
||||
break;
|
||||
case Config::InstallChoice::Replace:
|
||||
return QCoreApplication::translate( context, "<strong>Replace</strong> a partition with %1." )
|
||||
.arg( branding->shortVersionedName() );
|
||||
break;
|
||||
case Config::InstallChoice::NoChoice:
|
||||
case Config::InstallChoice::Manual:
|
||||
return QCoreApplication::translate( context, "<strong>Manual</strong> partitioning." );
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
/** @brief A top-level description of what @p choice does to disk @p info
|
||||
*
|
||||
* Returns a (branded, and device-specific) string describing what
|
||||
* will be done to device @p info when @p choice is made. The @p listLength
|
||||
* is used to provide context; when more than one disk is in use, the description
|
||||
* works differently.
|
||||
*/
|
||||
static QString
|
||||
diskDescription( int listLength, const PartitionCoreModule::SummaryInfo& info, Config::InstallChoice choice )
|
||||
{
|
||||
const auto* branding = Calamares::Branding::instance();
|
||||
static const char context[] = "PartitionViewStep";
|
||||
|
||||
if ( listLength == 1 ) // this is the only disk preview
|
||||
{
|
||||
switch ( choice )
|
||||
{
|
||||
case Config::Alongside:
|
||||
return QCoreApplication::translate(
|
||||
context,
|
||||
"Install %1 <strong>alongside</strong> another operating system on disk "
|
||||
"<strong>%2</strong> (%3)." )
|
||||
.arg( branding->shortVersionedName() )
|
||||
.arg( info.deviceNode )
|
||||
.arg( info.deviceName );
|
||||
break;
|
||||
case Config::Erase:
|
||||
return QCoreApplication::translate( context,
|
||||
"<strong>Erase</strong> disk <strong>%2</strong> (%3) and install %1." )
|
||||
.arg( branding->shortVersionedName() )
|
||||
.arg( info.deviceNode )
|
||||
.arg( info.deviceName );
|
||||
break;
|
||||
case Config::Replace:
|
||||
return QCoreApplication::translate(
|
||||
context, "<strong>Replace</strong> a partition on disk <strong>%2</strong> (%3) with %1." )
|
||||
.arg( branding->shortVersionedName() )
|
||||
.arg( info.deviceNode )
|
||||
.arg( info.deviceName );
|
||||
break;
|
||||
case Config::NoChoice:
|
||||
case Config::Manual:
|
||||
return QCoreApplication::translate(
|
||||
context, "<strong>Manual</strong> partitioning on disk <strong>%1</strong> (%2)." )
|
||||
.arg( info.deviceNode )
|
||||
.arg( info.deviceName );
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
else // multiple disk previews!
|
||||
{
|
||||
return QCoreApplication::translate( context, "Disk <strong>%1</strong> (%2)" )
|
||||
.arg( info.deviceNode )
|
||||
.arg( info.deviceName );
|
||||
}
|
||||
}
|
||||
|
||||
QString
|
||||
PartitionViewStep::prettyStatus() const
|
||||
{
|
||||
QString jobsLabel, modeText, diskInfoLabel;
|
||||
|
||||
const Config::InstallChoice choice = m_config->installChoice();
|
||||
const QList< PartitionCoreModule::SummaryInfo > list = m_core->createSummaryInfo();
|
||||
|
||||
cDebug() << "Summary for Partition" << list.length() << choice;
|
||||
if ( list.length() > 1 ) // There are changes on more than one disk
|
||||
{
|
||||
modeText = modeDescription( choice );
|
||||
}
|
||||
|
||||
for ( const auto& info : list )
|
||||
{
|
||||
// TODO: this overwrites each iteration
|
||||
diskInfoLabel = diskDescription( list.length(), info, choice );
|
||||
}
|
||||
|
||||
const QStringList jobsLines = jobDescriptions( jobs() );
|
||||
if ( !jobsLines.isEmpty() )
|
||||
{
|
||||
jobsLabel = jobsLines.join( "<br/>" );
|
||||
}
|
||||
|
||||
return diskInfoLabel + "<br/>" + jobsLabel;
|
||||
}
|
||||
|
||||
QWidget*
|
||||
PartitionViewStep::createSummaryWidget() const
|
||||
@ -132,73 +261,19 @@ PartitionViewStep::createSummaryWidget() const
|
||||
formLayout->setContentsMargins( MARGIN, 0, MARGIN, MARGIN );
|
||||
mainLayout->addLayout( formLayout );
|
||||
|
||||
const auto* branding = Calamares::Branding::instance();
|
||||
QList< PartitionCoreModule::SummaryInfo > list = m_core->createSummaryInfo();
|
||||
const QList< PartitionCoreModule::SummaryInfo > list = m_core->createSummaryInfo();
|
||||
if ( list.length() > 1 ) // There are changes on more than one disk
|
||||
{
|
||||
//NOTE: all of this should only happen when Manual partitioning is active.
|
||||
// Any other choice should result in a list.length() == 1.
|
||||
QLabel* modeLabel = new QLabel;
|
||||
formLayout->addRow( modeLabel );
|
||||
QString modeText;
|
||||
switch ( choice )
|
||||
{
|
||||
case Config::InstallChoice::Alongside:
|
||||
modeText = tr( "Install %1 <strong>alongside</strong> another operating system." )
|
||||
.arg( branding->shortVersionedName() );
|
||||
break;
|
||||
case Config::InstallChoice::Erase:
|
||||
modeText = tr( "<strong>Erase</strong> disk and install %1." ).arg( branding->shortVersionedName() );
|
||||
break;
|
||||
case Config::InstallChoice::Replace:
|
||||
modeText = tr( "<strong>Replace</strong> a partition with %1." ).arg( branding->shortVersionedName() );
|
||||
break;
|
||||
case Config::InstallChoice::NoChoice:
|
||||
case Config::InstallChoice::Manual:
|
||||
modeText = tr( "<strong>Manual</strong> partitioning." );
|
||||
}
|
||||
modeLabel->setText( modeText );
|
||||
modeLabel->setText( modeDescription( choice ) );
|
||||
}
|
||||
for ( const auto& info : list )
|
||||
{
|
||||
QLabel* diskInfoLabel = new QLabel;
|
||||
if ( list.length() == 1 ) // this is the only disk preview
|
||||
{
|
||||
QString modeText;
|
||||
switch ( choice )
|
||||
{
|
||||
case Config::InstallChoice::Alongside:
|
||||
modeText = tr( "Install %1 <strong>alongside</strong> another operating system on disk "
|
||||
"<strong>%2</strong> (%3)." )
|
||||
.arg( branding->shortVersionedName() )
|
||||
.arg( info.deviceNode )
|
||||
.arg( info.deviceName );
|
||||
break;
|
||||
case Config::InstallChoice::Erase:
|
||||
modeText = tr( "<strong>Erase</strong> disk <strong>%2</strong> (%3) and install %1." )
|
||||
.arg( branding->shortVersionedName() )
|
||||
.arg( info.deviceNode )
|
||||
.arg( info.deviceName );
|
||||
break;
|
||||
case Config::InstallChoice::Replace:
|
||||
modeText = tr( "<strong>Replace</strong> a partition on disk <strong>%2</strong> (%3) with %1." )
|
||||
.arg( branding->shortVersionedName() )
|
||||
.arg( info.deviceNode )
|
||||
.arg( info.deviceName );
|
||||
break;
|
||||
case Config::InstallChoice::NoChoice:
|
||||
case Config::InstallChoice::Manual:
|
||||
modeText = tr( "<strong>Manual</strong> partitioning on disk <strong>%1</strong> (%2)." )
|
||||
.arg( info.deviceNode )
|
||||
.arg( info.deviceName );
|
||||
}
|
||||
diskInfoLabel->setText( modeText );
|
||||
}
|
||||
else // multiple disk previews!
|
||||
{
|
||||
diskInfoLabel->setText(
|
||||
tr( "Disk <strong>%1</strong> (%2)" ).arg( info.deviceNode ).arg( info.deviceName ) );
|
||||
}
|
||||
diskInfoLabel->setText( diskDescription( list.length(), info, choice ) );
|
||||
formLayout->addRow( diskInfoLabel );
|
||||
|
||||
PartitionBarsView* preview;
|
||||
@ -243,14 +318,7 @@ PartitionViewStep::createSummaryWidget() const
|
||||
field->addWidget( previewLabels );
|
||||
formLayout->addRow( tr( "After:" ), field );
|
||||
}
|
||||
QStringList jobsLines;
|
||||
foreach ( const Calamares::job_ptr& job, jobs() )
|
||||
{
|
||||
if ( !job->prettyDescription().isEmpty() )
|
||||
{
|
||||
jobsLines.append( job->prettyDescription() );
|
||||
}
|
||||
}
|
||||
const QStringList jobsLines = jobDescriptions( jobs() );
|
||||
if ( !jobsLines.isEmpty() )
|
||||
{
|
||||
QLabel* jobsLabel = new QLabel( widget );
|
||||
@ -265,6 +333,11 @@ PartitionViewStep::createSummaryWidget() const
|
||||
return widget;
|
||||
}
|
||||
|
||||
QWidget*
|
||||
PartitionViewStep::widget()
|
||||
{
|
||||
return m_widget;
|
||||
}
|
||||
|
||||
void
|
||||
PartitionViewStep::next()
|
||||
@ -599,8 +672,7 @@ PartitionViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
QFuture< void > future = QtConcurrent::run( this, &PartitionViewStep::initPartitionCoreModule );
|
||||
m_future->setFuture( future );
|
||||
|
||||
m_core->initLayout( m_config->defaultFsType(),
|
||||
configurationMap.value( "partitionLayout" ).toList() );
|
||||
m_core->initLayout( m_config->defaultFsType(), configurationMap.value( "partitionLayout" ).toList() );
|
||||
}
|
||||
|
||||
|
||||
|
@ -43,6 +43,7 @@ public:
|
||||
~PartitionViewStep() override;
|
||||
|
||||
QString prettyName() const override;
|
||||
QString prettyStatus() const override;
|
||||
QWidget* createSummaryWidget() const override;
|
||||
|
||||
QWidget* widget() override;
|
||||
|
@ -8,8 +8,9 @@ calamares_add_plugin( summary
|
||||
TYPE viewmodule
|
||||
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
||||
SOURCES
|
||||
SummaryViewStep.cpp
|
||||
Config.cpp
|
||||
SummaryPage.cpp
|
||||
SummaryViewStep.cpp
|
||||
UI
|
||||
SHARED_LIB
|
||||
NO_CONFIG
|
||||
|
127
src/modules/summary/Config.cpp
Normal file
127
src/modules/summary/Config.cpp
Normal file
@ -0,0 +1,127 @@
|
||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2020, Camilo Higuita <milo.h@aol.com>
|
||||
* SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* Calamares is Free Software: see the License-Identifier above.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "Config.h"
|
||||
|
||||
#include "Branding.h"
|
||||
#include "Settings.h"
|
||||
#include "ViewManager.h"
|
||||
#include "utils/CalamaresUtilsGui.h"
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/Retranslator.h"
|
||||
#include "viewpages/ExecutionViewStep.h"
|
||||
|
||||
SummaryModel::SummaryModel( QObject* parent )
|
||||
: QAbstractListModel( parent )
|
||||
{
|
||||
}
|
||||
|
||||
QHash< int, QByteArray >
|
||||
SummaryModel::roleNames() const
|
||||
{
|
||||
return { { Qt::DisplayRole, "title" }, { Qt::UserRole, "message" } };
|
||||
}
|
||||
|
||||
QVariant
|
||||
SummaryModel::data( const QModelIndex& index, int role ) const
|
||||
{
|
||||
if ( !index.isValid() )
|
||||
{
|
||||
return QVariant();
|
||||
}
|
||||
const auto item = m_summary.at( index.row() );
|
||||
return role == Qt::DisplayRole ? item.title : item.message;
|
||||
}
|
||||
|
||||
int
|
||||
SummaryModel::rowCount( const QModelIndex& ) const
|
||||
{
|
||||
return m_summary.count();
|
||||
}
|
||||
|
||||
void
|
||||
SummaryModel::setSummaryList( const Calamares::ViewStepList& steps, bool withWidgets )
|
||||
{
|
||||
Q_EMIT beginResetModel();
|
||||
m_summary.clear();
|
||||
|
||||
for ( Calamares::ViewStep* step : steps )
|
||||
{
|
||||
QString text = step->prettyStatus();
|
||||
QWidget* widget = withWidgets ? step->createSummaryWidget() : nullptr;
|
||||
|
||||
if ( text.isEmpty() && !widget )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
m_summary << StepSummary { step->prettyName(), text, widget };
|
||||
}
|
||||
Q_EMIT endResetModel();
|
||||
}
|
||||
|
||||
Config::Config( QObject* parent )
|
||||
: QObject( parent )
|
||||
, m_summary( new SummaryModel( this ) )
|
||||
|
||||
{
|
||||
CALAMARES_RETRANSLATE_SLOT( &Config::retranslate );
|
||||
retranslate();
|
||||
}
|
||||
|
||||
void
|
||||
Config::retranslate()
|
||||
{
|
||||
m_title = tr( "Summary" );
|
||||
|
||||
if ( Calamares::Settings::instance()->isSetupMode() )
|
||||
{
|
||||
m_message = tr( "This is an overview of what will happen once you start "
|
||||
"the setup procedure." );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_message = tr( "This is an overview of what will happen once you start "
|
||||
"the install procedure." );
|
||||
}
|
||||
Q_EMIT titleChanged( m_title );
|
||||
Q_EMIT messageChanged( m_message );
|
||||
}
|
||||
|
||||
void
|
||||
Config::collectSummaries( const Calamares::ViewStep* upToHere )
|
||||
{
|
||||
Calamares::ViewStepList steps;
|
||||
for ( Calamares::ViewStep* step : Calamares::ViewManager::instance()->viewSteps() )
|
||||
{
|
||||
// *Assume* that if there's an exec step in the sequence,
|
||||
// we don't need a summary for steps before it. This works in
|
||||
// practice if there's a summary step before each exec --
|
||||
// and in practice, there's only one of each.
|
||||
if ( qobject_cast< Calamares::ExecutionViewStep* >( step ) )
|
||||
{
|
||||
steps.clear();
|
||||
continue;
|
||||
}
|
||||
|
||||
// Having reached the parent view-step of the Config object,
|
||||
// we know we're providing a summary of steps up until this
|
||||
// view step, so we now have steps since the previous exec, up
|
||||
// to this summary.
|
||||
if ( upToHere == step )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
steps.append( step );
|
||||
}
|
||||
|
||||
m_summary->setSummaryList( steps );
|
||||
}
|
96
src/modules/summary/Config.h
Normal file
96
src/modules/summary/Config.h
Normal file
@ -0,0 +1,96 @@
|
||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2019-2020, Adriaan de Groot <groot@kde.org>
|
||||
* SPDX-FileCopyrightText: 2020, Camilo Higuita <milo.h@aol.com>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* Calamares is Free Software: see the License-Identifier above.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SUMMARY_CONFIG_H
|
||||
#define SUMMARY_CONFIG_H
|
||||
|
||||
#include "viewpages/ViewStep.h"
|
||||
|
||||
#include <QAbstractListModel>
|
||||
#include <QObject>
|
||||
#include <QQmlParserStatus>
|
||||
|
||||
class Config;
|
||||
|
||||
/** @brief Data for one step
|
||||
*
|
||||
* A step generally has a text description, but **may** have a
|
||||
* QWidget. There is no ownership of the QWidget, that is assumed
|
||||
* to be handed off to some owning parent-widget.
|
||||
*/
|
||||
struct StepSummary
|
||||
{
|
||||
QString title;
|
||||
QString message;
|
||||
QWidget* widget = nullptr;
|
||||
};
|
||||
|
||||
class SummaryModel : public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class Config;
|
||||
|
||||
public:
|
||||
explicit SummaryModel( QObject* parent = nullptr );
|
||||
int rowCount( const QModelIndex& = QModelIndex() ) const override;
|
||||
QVariant data( const QModelIndex& index, int role ) const override;
|
||||
|
||||
protected:
|
||||
QHash< int, QByteArray > roleNames() const override;
|
||||
|
||||
private:
|
||||
/** @brief Sets the model data from @p steps
|
||||
*
|
||||
* Replaces the list of summaries with summaries given by
|
||||
* the jobs and ViewSteps objects in @p steps. If @p withWidgets
|
||||
* is @c true, then also queries for widget summaries alongside
|
||||
* the text summaries for each step.
|
||||
*/
|
||||
void setSummaryList( const Calamares::ViewStepList& steps, bool withWidgets = false );
|
||||
|
||||
QVector< StepSummary > m_summary;
|
||||
};
|
||||
|
||||
class Config : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
///@brief Name of this summary (generally, "Summary")
|
||||
Q_PROPERTY( QString title READ title NOTIFY titleChanged )
|
||||
///@brief Description of what the summary means
|
||||
Q_PROPERTY( QString message READ message NOTIFY messageChanged )
|
||||
|
||||
Q_PROPERTY( QAbstractListModel* summaryModel READ summaryModel CONSTANT FINAL )
|
||||
|
||||
public:
|
||||
explicit Config( QObject* parent = nullptr );
|
||||
|
||||
///@brief Called later, to load the model once all viewsteps are there
|
||||
void collectSummaries( const Calamares::ViewStep* upToHere );
|
||||
|
||||
QAbstractListModel* summaryModel() const { return m_summary; }
|
||||
|
||||
QString title() const { return m_title; }
|
||||
QString message() const { return m_message; }
|
||||
|
||||
private:
|
||||
Calamares::ViewStepList stepsForSummary( const Calamares::ViewStepList& allSteps ) const;
|
||||
void retranslate();
|
||||
|
||||
SummaryModel* m_summary;
|
||||
|
||||
QString m_title;
|
||||
QString m_message;
|
||||
|
||||
Q_SIGNALS:
|
||||
void titleChanged( QString title );
|
||||
void messageChanged( QString message );
|
||||
};
|
||||
#endif
|
@ -29,7 +29,7 @@
|
||||
|
||||
static const int SECTION_SPACING = 12;
|
||||
|
||||
SummaryPage::SummaryPage( const SummaryViewStep* thisViewStep, QWidget* parent )
|
||||
SummaryPage::SummaryPage( Config* config, const SummaryViewStep* thisViewStep, QWidget* parent )
|
||||
: QWidget()
|
||||
, m_thisViewStep( thisViewStep )
|
||||
, m_contentWidget( nullptr )
|
||||
@ -37,6 +37,7 @@ SummaryPage::SummaryPage( const SummaryViewStep* thisViewStep, QWidget* parent )
|
||||
{
|
||||
Q_UNUSED( parent )
|
||||
|
||||
|
||||
this->setObjectName( "summaryStep" );
|
||||
|
||||
Q_ASSERT( m_thisViewStep );
|
||||
@ -45,11 +46,8 @@ SummaryPage::SummaryPage( const SummaryViewStep* thisViewStep, QWidget* parent )
|
||||
|
||||
QLabel* headerLabel = new QLabel( this );
|
||||
headerLabel->setObjectName( "summaryTitle" );
|
||||
CALAMARES_RETRANSLATE( if ( Calamares::Settings::instance()->isSetupMode() )
|
||||
headerLabel->setText( tr( "This is an overview of what will happen once you start "
|
||||
"the setup procedure." ) );
|
||||
else headerLabel->setText( tr( "This is an overview of what will happen once you start "
|
||||
"the install procedure." ) ); );
|
||||
headerLabel->setText( config->message() );
|
||||
connect( config, &Config::messageChanged, headerLabel, &QLabel::setText );
|
||||
layout->addWidget( headerLabel );
|
||||
layout->addWidget( m_scrollArea );
|
||||
m_scrollArea->setWidgetResizable( true );
|
||||
@ -63,12 +61,45 @@ SummaryPage::SummaryPage( const SummaryViewStep* thisViewStep, QWidget* parent )
|
||||
}
|
||||
|
||||
|
||||
static QLabel*
|
||||
createTitleLabel( const QString& text, const QFont& titleFont )
|
||||
{
|
||||
QLabel* label = new QLabel( text );
|
||||
label->setObjectName( "summaryItemTitle" );
|
||||
label->setFont( titleFont );
|
||||
label->setContentsMargins( 0, 0, 0, 0 );
|
||||
|
||||
return label;
|
||||
}
|
||||
|
||||
static QLabel*
|
||||
createBodyLabel( const QString& text, const QPalette& bodyPalette )
|
||||
{
|
||||
QLabel* label = new QLabel;
|
||||
label->setObjectName( "summaryItemBody" );
|
||||
label->setMargin( CalamaresUtils::defaultFontHeight() / 2 );
|
||||
label->setAutoFillBackground( true );
|
||||
label->setPalette( bodyPalette );
|
||||
label->setText( text );
|
||||
return label;
|
||||
}
|
||||
|
||||
// Adds a widget for those ViewSteps that want a summary;
|
||||
// see SummaryPage documentation and also ViewStep docs.
|
||||
void
|
||||
SummaryPage::onActivate()
|
||||
{
|
||||
createContentWidget();
|
||||
delete m_contentWidget; // It might have been created previously
|
||||
m_contentWidget = new QWidget;
|
||||
m_layout = new QVBoxLayout( m_contentWidget );
|
||||
CalamaresUtils::unmarginLayout( m_layout );
|
||||
|
||||
QFont titleFont = font();
|
||||
titleFont.setWeight( QFont::Light );
|
||||
titleFont.setPointSize( CalamaresUtils::defaultFontSize() * 2 );
|
||||
|
||||
QPalette bodyPalette( palette() );
|
||||
bodyPalette.setColor( WindowBackground, palette().window().color().lighter( 108 ) );
|
||||
|
||||
bool first = true;
|
||||
const Calamares::ViewStepList steps = stepsForSummary( Calamares::ViewManager::instance()->viewSteps() );
|
||||
@ -92,7 +123,7 @@ SummaryPage::onActivate()
|
||||
m_layout->addSpacing( SECTION_SPACING );
|
||||
}
|
||||
|
||||
m_layout->addWidget( createTitleLabel( step->prettyName() ) );
|
||||
m_layout->addWidget( createTitleLabel( step->prettyName(), titleFont ) );
|
||||
QHBoxLayout* itemBodyLayout = new QHBoxLayout;
|
||||
m_layout->addSpacing( CalamaresUtils::defaultFontHeight() / 2 );
|
||||
m_layout->addLayout( itemBodyLayout );
|
||||
@ -102,7 +133,7 @@ SummaryPage::onActivate()
|
||||
CalamaresUtils::unmarginLayout( itemBodyLayout );
|
||||
if ( !text.isEmpty() )
|
||||
{
|
||||
itemBodyCoreLayout->addWidget( createBodyLabel( text ) );
|
||||
itemBodyCoreLayout->addWidget( createBodyLabel( text, bodyPalette ) );
|
||||
}
|
||||
if ( widget )
|
||||
{
|
||||
@ -156,40 +187,9 @@ SummaryPage::stepsForSummary( const Calamares::ViewStepList& allSteps ) const
|
||||
return steps;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SummaryPage::createContentWidget()
|
||||
SummaryPage::onLeave()
|
||||
{
|
||||
delete m_contentWidget;
|
||||
m_contentWidget = new QWidget;
|
||||
m_layout = new QVBoxLayout( m_contentWidget );
|
||||
CalamaresUtils::unmarginLayout( m_layout );
|
||||
}
|
||||
|
||||
QLabel*
|
||||
SummaryPage::createTitleLabel( const QString& text ) const
|
||||
{
|
||||
QLabel* label = new QLabel( text );
|
||||
label->setObjectName( "summaryItemTitle" );
|
||||
QFont fnt = font();
|
||||
fnt.setWeight( QFont::Light );
|
||||
fnt.setPointSize( CalamaresUtils::defaultFontSize() * 2 );
|
||||
label->setFont( fnt );
|
||||
label->setContentsMargins( 0, 0, 0, 0 );
|
||||
|
||||
return label;
|
||||
}
|
||||
|
||||
QLabel*
|
||||
SummaryPage::createBodyLabel( const QString& text ) const
|
||||
{
|
||||
QLabel* label = new QLabel;
|
||||
label->setObjectName( "summaryItemBody" );
|
||||
label->setMargin( CalamaresUtils::defaultFontHeight() / 2 );
|
||||
QPalette pal( palette() );
|
||||
pal.setColor( WindowBackground, palette().window().color().lighter( 108 ) );
|
||||
label->setAutoFillBackground( true );
|
||||
label->setPalette( pal );
|
||||
label->setText( text );
|
||||
return label;
|
||||
m_contentWidget = nullptr;
|
||||
}
|
||||
|
@ -14,10 +14,13 @@
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class Config;
|
||||
class SummaryViewStep;
|
||||
|
||||
class QLabel;
|
||||
class QScrollArea;
|
||||
class QVBoxLayout;
|
||||
class SummaryViewStep;
|
||||
|
||||
|
||||
/** @brief Provide a summary view with to-be-done action descriptions.
|
||||
*
|
||||
@ -42,10 +45,12 @@ class SummaryPage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SummaryPage( const SummaryViewStep* thisViewStep, QWidget* parent = nullptr );
|
||||
explicit SummaryPage( Config* config, const SummaryViewStep* thisViewStep, QWidget* parent = nullptr );
|
||||
|
||||
/// @brief Create contents showing all of the summary
|
||||
void onActivate();
|
||||
void createContentWidget();
|
||||
/// @brief Clean up the widgets
|
||||
void onLeave();
|
||||
|
||||
private:
|
||||
Calamares::ViewStepList stepsForSummary( const Calamares::ViewStepList& allSteps ) const;
|
||||
@ -55,9 +60,6 @@ private:
|
||||
QVBoxLayout* m_layout = nullptr;
|
||||
QWidget* m_contentWidget = nullptr;
|
||||
|
||||
QLabel* createTitleLabel( const QString& text ) const;
|
||||
QLabel* createBodyLabel( const QString& text ) const;
|
||||
|
||||
QScrollArea* m_scrollArea;
|
||||
};
|
||||
|
||||
|
@ -15,7 +15,8 @@ CALAMARES_PLUGIN_FACTORY_DEFINITION( SummaryViewStepFactory, registerPlugin< Sum
|
||||
|
||||
SummaryViewStep::SummaryViewStep( QObject* parent )
|
||||
: Calamares::ViewStep( parent )
|
||||
, m_widget( new SummaryPage( this ) )
|
||||
, m_config( new Config( this ) )
|
||||
, m_widget( new SummaryPage( m_config, this ) )
|
||||
{
|
||||
emit nextStatusChanged( true );
|
||||
}
|
||||
@ -27,13 +28,14 @@ SummaryViewStep::~SummaryViewStep()
|
||||
{
|
||||
m_widget->deleteLater();
|
||||
}
|
||||
delete m_config;
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
SummaryViewStep::prettyName() const
|
||||
{
|
||||
return tr( "Summary" );
|
||||
return m_config->title();
|
||||
}
|
||||
|
||||
|
||||
@ -72,16 +74,17 @@ SummaryViewStep::isAtEnd() const
|
||||
}
|
||||
|
||||
|
||||
QList< Calamares::job_ptr >
|
||||
Calamares::JobList
|
||||
SummaryViewStep::jobs() const
|
||||
{
|
||||
return QList< Calamares::job_ptr >();
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SummaryViewStep::onActivate()
|
||||
{
|
||||
m_config->collectSummaries( this );
|
||||
m_widget->onActivate();
|
||||
}
|
||||
|
||||
@ -89,5 +92,5 @@ SummaryViewStep::onActivate()
|
||||
void
|
||||
SummaryViewStep::onLeave()
|
||||
{
|
||||
m_widget->createContentWidget();
|
||||
m_widget->onLeave();
|
||||
}
|
||||
|
@ -10,12 +10,11 @@
|
||||
#ifndef SUMMARYPAGEPLUGIN_H
|
||||
#define SUMMARYPAGEPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "utils/PluginFactory.h"
|
||||
#include "viewpages/ViewStep.h"
|
||||
#include "Config.h"
|
||||
|
||||
#include "DllMacro.h"
|
||||
#include "utils/PluginFactory.h"
|
||||
#include "viewpages/ViewStep.h"
|
||||
|
||||
class SummaryPage;
|
||||
|
||||
@ -37,13 +36,14 @@ public:
|
||||
bool isAtBeginning() const override;
|
||||
bool isAtEnd() const override;
|
||||
|
||||
QList< Calamares::job_ptr > jobs() const override;
|
||||
Calamares::JobList jobs() const override;
|
||||
|
||||
void onActivate() override;
|
||||
void onLeave() override;
|
||||
|
||||
private:
|
||||
SummaryPage* m_widget;
|
||||
Config* m_config = nullptr;
|
||||
SummaryPage* m_widget = nullptr;
|
||||
};
|
||||
|
||||
CALAMARES_PLUGIN_FACTORY_DECLARATION( SummaryViewStepFactory )
|
||||
|
21
src/modules/summaryq/CMakeLists.txt
Normal file
21
src/modules/summaryq/CMakeLists.txt
Normal file
@ -0,0 +1,21 @@
|
||||
if( NOT WITH_QML )
|
||||
calamares_skip_module( "summaryq (QML is not supported in this build)" )
|
||||
return()
|
||||
endif()
|
||||
|
||||
set( _summary ${CMAKE_CURRENT_SOURCE_DIR}/../summary )
|
||||
include_directories( ${_summary} )
|
||||
|
||||
calamares_add_plugin( summaryq
|
||||
TYPE viewmodule
|
||||
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
||||
SOURCES
|
||||
SummaryQmlViewStep.cpp
|
||||
${_summary}/Config.cpp
|
||||
UI
|
||||
RESOURCES
|
||||
summaryq.qrc
|
||||
LINK_PRIVATE_LIBRARIES
|
||||
calamaresui
|
||||
SHARED_LIB
|
||||
)
|
73
src/modules/summaryq/SummaryQmlViewStep.cpp
Normal file
73
src/modules/summaryq/SummaryQmlViewStep.cpp
Normal file
@ -0,0 +1,73 @@
|
||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2014-2015, Teo Mrnjavac <teo@kde.org>
|
||||
* SPDX-FileCopyrightText: 2020, Camilo Higuita <milo.h@aol.com>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* Calamares is Free Software: see the License-Identifier above.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "SummaryQmlViewStep.h"
|
||||
|
||||
CALAMARES_PLUGIN_FACTORY_DEFINITION( SummaryQmlViewStepFactory, registerPlugin< SummaryQmlViewStep >(); )
|
||||
|
||||
SummaryQmlViewStep::SummaryQmlViewStep( QObject* parent )
|
||||
: Calamares::QmlViewStep( parent )
|
||||
, m_config( new Config( this ) )
|
||||
{
|
||||
emit nextStatusChanged( true );
|
||||
}
|
||||
|
||||
|
||||
SummaryQmlViewStep::~SummaryQmlViewStep() {}
|
||||
|
||||
QString
|
||||
SummaryQmlViewStep::prettyName() const
|
||||
{
|
||||
return m_config->title();
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SummaryQmlViewStep::isNextEnabled() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SummaryQmlViewStep::isBackEnabled() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SummaryQmlViewStep::isAtBeginning() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SummaryQmlViewStep::isAtEnd() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Calamares::JobList
|
||||
SummaryQmlViewStep::jobs() const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SummaryQmlViewStep::onActivate()
|
||||
{
|
||||
// Collect the steps before this one: those need to have their
|
||||
// summary (text or widget) displayed.
|
||||
m_config->collectSummaries( this );
|
||||
}
|
49
src/modules/summaryq/SummaryQmlViewStep.h
Normal file
49
src/modules/summaryq/SummaryQmlViewStep.h
Normal file
@ -0,0 +1,49 @@
|
||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2014-2015, Teo Mrnjavac <teo@kde.org>
|
||||
* SPDX-FileCopyrightText: 2020, Camilo Higuita <milo.h@aol.com>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* Calamares is Free Software: see the License-Identifier above.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SUMMARYQMLVIEWSTEP_H
|
||||
#define SUMMARYQMLVIEWSTEP_H
|
||||
|
||||
#include "Config.h"
|
||||
|
||||
#include "DllMacro.h"
|
||||
#include "utils/PluginFactory.h"
|
||||
#include "viewpages/QmlViewStep.h"
|
||||
|
||||
class PLUGINDLLEXPORT SummaryQmlViewStep : public Calamares::QmlViewStep
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SummaryQmlViewStep( QObject* parent = nullptr );
|
||||
virtual ~SummaryQmlViewStep() override;
|
||||
|
||||
QString prettyName() const override;
|
||||
|
||||
|
||||
bool isNextEnabled() const override;
|
||||
bool isBackEnabled() const override;
|
||||
|
||||
bool isAtBeginning() const override;
|
||||
bool isAtEnd() const override;
|
||||
|
||||
Calamares::JobList jobs() const override;
|
||||
|
||||
void onActivate() override;
|
||||
|
||||
QObject* getConfig() override { return m_config; }
|
||||
|
||||
private:
|
||||
Config* m_config;
|
||||
};
|
||||
|
||||
CALAMARES_PLUGIN_FACTORY_DECLARATION( SummaryQmlViewStepFactory )
|
||||
|
||||
#endif // SUMMARYQMLVIEWSTEP_H
|
22
src/modules/summaryq/img/keyboard.svg
Normal file
22
src/modules/summaryq/img/keyboard.svg
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
<svg width="64" version="1.1" xmlns="http://www.w3.org/2000/svg" height="64" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
|
||||
<defs id="defs5455">
|
||||
<linearGradient inkscape:collect="always" id="linearGradient4876">
|
||||
<stop style="stop-color:#b0b8b8" id="stop4878"/>
|
||||
<stop offset="1" style="stop-color:#eff1f1" id="stop4880"/>
|
||||
</linearGradient>
|
||||
<linearGradient inkscape:collect="always" xlink:href="#linearGradient4876" id="linearGradient4185" y1="539.79797" y2="506.47214" x2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0.81249961 0 0 0.88235295 76.6073 64.50563)"/>
|
||||
</defs>
|
||||
<metadata id="metadata5458"/>
|
||||
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="g4882" transform="matrix(1 0 0 1 -376.57144 -493.79798)">
|
||||
<rect width="52" x="382.57144" y="510.79797" height="30" style="fill:url(#linearGradient4185)" id="rect4177"/>
|
||||
<path style="fill:#334545" id="path4245" d="M 7 21 L 7 23 L 12 23 L 12 21 L 7 21 z M 13 21 L 13 23 L 17 23 L 17 21 L 13 21 z M 18 21 L 18 23 L 22 23 L 22 21 L 18 21 z M 23 21 L 23 23 L 27 23 L 27 21 L 23 21 z M 28 21 L 28 23 L 32 23 L 32 21 L 28 21 z M 33 21 L 33 23 L 37 23 L 37 21 L 33 21 z M 38 21 L 38 23 L 42 23 L 42 21 L 38 21 z M 43 21 L 43 23 L 47 23 L 47 21 L 43 21 z M 48 21 L 48 23 L 52 23 L 52 21 L 48 21 z M 53 21 L 53 23 L 57 23 L 57 21 L 53 21 z M 7 24 L 7 28 L 11 28 L 11 24 L 7 24 z M 12 24 L 12 28 L 16 28 L 16 24 L 12 24 z M 17 24 L 17 28 L 21 28 L 21 24 L 17 24 z M 22 24 L 22 28 L 26 28 L 26 24 L 22 24 z M 27 24 L 27 28 L 31 28 L 31 24 L 27 24 z M 32 24 L 32 28 L 36 28 L 36 24 L 32 24 z M 37 24 L 37 28 L 41 28 L 41 24 L 37 24 z M 42 24 L 42 28 L 46 28 L 46 24 L 42 24 z M 47 24 L 47 28 L 51 28 L 51 24 L 47 24 z M 52 24 L 52 28 L 57 28 L 57 24 L 52 24 z M 7 29 L 7 33 L 13 33 L 13 29 L 7 29 z M 14 29 L 14 33 L 18 33 L 18 29 L 14 29 z M 19 29 L 19 33 L 23 33 L 23 29 L 19 29 z M 24 29 L 24 33 L 28 33 L 28 29 L 24 29 z M 29 29 L 29 33 L 33 33 L 33 29 L 29 29 z M 34 29 L 34 33 L 38 33 L 38 29 L 34 29 z M 39 29 L 39 33 L 43 33 L 43 29 L 39 29 z M 44 29 L 44 33 L 48 33 L 48 29 L 44 29 z M 49 29 L 49 33 L 57 33 L 57 29 L 49 29 z M 7 34 L 7 38 L 17 38 L 17 34 L 7 34 z M 18 34 L 18 38 L 22 38 L 22 34 L 18 34 z M 23 34 L 23 38 L 27 38 L 27 34 L 23 34 z M 28 34 L 28 38 L 32 38 L 32 34 L 28 34 z M 33 34 L 33 38 L 37 38 L 37 34 L 33 34 z M 38 34 L 38 38 L 42 38 L 42 34 L 38 34 z M 43 34 L 43 38 L 47 38 L 47 34 L 43 34 z M 48 34 L 48 38 L 57 38 L 57 34 L 48 34 z M 7 39 L 7 43 L 13.099609 43 L 13.099609 39 L 7 39 z M 14 39 L 14 43 L 18 43 L 18 39 L 14 39 z M 19 39 L 19 43 L 37 43 L 37 39 L 19 39 z M 38 39 L 38 43 L 42 43 L 42 39 L 38 39 z M 48 39 L 48 43 L 52 43 L 52 39 L 48 39 z M 43 41 L 43 43 L 47 43 L 47 41 L 43 41 z M 53 41 L 53 43 L 57 43 L 57 41 L 53 41 z " transform="matrix(1 0 0 1 376.57144 493.79798)"/>
|
||||
<rect width="51.999973" x="382.57144" y="539.79797" height="1" style="fill:#909c9c" id="rect4187"/>
|
||||
<rect width="1" x="431.57141" y="511.79797" height="1" style="fill:#31c281" id="rect4462-0-90"/>
|
||||
<rect width="1" x="428.57135" y="511.79797" height="1" style="fill:#31c281" id="rect4975"/>
|
||||
<rect width="1" x="425.57141" y="511.79797" height="1" style="fill:#31c281" id="rect4977"/>
|
||||
<path style="fill:#172525" id="path4245-5" d="M 7 22 L 7 23 L 11 23 L 12 23 L 12 22 L 7 22 z M 13 22 L 13 23 L 16 23 L 17 23 L 17 22 L 13 22 z M 18 22 L 18 23 L 21 23 L 22 23 L 22 22 L 18 22 z M 23 22 L 23 23 L 26 23 L 27 23 L 27 22 L 23 22 z M 28 22 L 28 23 L 31 23 L 32 23 L 32 22 L 28 22 z M 33 22 L 33 23 L 36 23 L 37 23 L 37 22 L 33 22 z M 38 22 L 38 23 L 41 23 L 42 23 L 42 22 L 38 22 z M 43 22 L 43 23 L 46 23 L 47 23 L 47 22 L 43 22 z M 48 22 L 48 23 L 51 23 L 52 23 L 52 22 L 48 22 z M 53 22 L 53 23 L 57 23 L 57 22 L 53 22 z M 7 27 L 7 28 L 11 28 L 11 27 L 7 27 z M 12 27 L 12 28 L 13 28 L 14 28 L 16 28 L 16 27 L 12 27 z M 17 27 L 17 28 L 18 28 L 19 28 L 21 28 L 21 27 L 17 27 z M 22 27 L 22 28 L 23 28 L 24 28 L 26 28 L 26 27 L 22 27 z M 27 27 L 27 28 L 28 28 L 29 28 L 31 28 L 31 27 L 27 27 z M 32 27 L 32 28 L 33 28 L 34 28 L 36 28 L 36 27 L 32 27 z M 37 27 L 37 28 L 38 28 L 39 28 L 41 28 L 41 27 L 37 27 z M 42 27 L 42 28 L 43 28 L 44 28 L 46 28 L 46 27 L 42 27 z M 47 27 L 47 28 L 48 28 L 49 28 L 51 28 L 51 27 L 47 27 z M 52 27 L 52 28 L 57 28 L 57 27 L 52 27 z M 7 32 L 7 33 L 13 33 L 13 32 L 7 32 z M 14 32 L 14 33 L 17 33 L 18 33 L 18 32 L 14 32 z M 19 32 L 19 33 L 22 33 L 23 33 L 23 32 L 19 32 z M 24 32 L 24 33 L 27 33 L 28 33 L 28 32 L 24 32 z M 29 32 L 29 33 L 32 33 L 33 33 L 33 32 L 29 32 z M 34 32 L 34 33 L 37 33 L 38 33 L 38 32 L 34 32 z M 39 32 L 39 33 L 42 33 L 43 33 L 43 32 L 39 32 z M 44 32 L 44 33 L 47 33 L 48 33 L 48 32 L 44 32 z M 49 32 L 49 33 L 57 33 L 57 32 L 49 32 z M 7 37 L 7 38 L 13.099609 38 L 14 38 L 17 38 L 17 37 L 7 37 z M 18 37 L 18 38 L 19 38 L 22 38 L 22 37 L 18 37 z M 23 37 L 23 38 L 27 38 L 27 37 L 23 37 z M 28 37 L 28 38 L 32 38 L 32 37 L 28 37 z M 33 37 L 33 38 L 37 38 L 37 37 L 33 37 z M 38 37 L 38 38 L 42 38 L 42 37 L 38 37 z M 43 37 L 43 38 L 47 38 L 47 37 L 43 37 z M 48 37 L 48 38 L 52 38 L 57 38 L 57 37 L 48 37 z M 48 40 L 48 41 L 52 41 L 52 40 L 48 40 z M 7 42 L 7 43 L 13.099609 43 L 13.099609 42 L 7 42 z M 14 42 L 14 43 L 18 43 L 18 42 L 14 42 z M 19 42 L 19 43 L 37 43 L 37 42 L 19 42 z M 38 42 L 38 43 L 42 43 L 42 42 L 38 42 z M 43 42 L 43 43 L 47 43 L 47 42 L 43 42 z M 48 42 L 48 43 L 52 43 L 52 42 L 48 42 z M 53 42 L 53 43 L 57 43 L 57 42 L 53 42 z " transform="matrix(1 0 0 1 376.57144 493.79798)"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 5.5 KiB |
2
src/modules/summaryq/img/keyboard.svg.license
Normal file
2
src/modules/summaryq/img/keyboard.svg.license
Normal file
@ -0,0 +1,2 @@
|
||||
SPDX-FileCopyrightText: 2021 KDE Visual Design Group <visual-design@kde.org>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
39
src/modules/summaryq/img/lokalize.svg
Normal file
39
src/modules/summaryq/img/lokalize.svg
Normal file
@ -0,0 +1,39 @@
|
||||
<svg width="48" xmlns="http://www.w3.org/2000/svg" height="48" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<defs>
|
||||
<linearGradient id="a" y1="22" y2="8" x2="0" gradientUnits="userSpaceOnUse" gradientTransform="translate(429.57 508.8)">
|
||||
<stop stop-color="#2e3436"/>
|
||||
<stop offset="1" stop-color="#555753"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="b" y1="543.8" y2="502.66" gradientUnits="userSpaceOnUse" x2="0" gradientTransform="matrix(.66667 0 0 .63518 139.19 192.52)">
|
||||
<stop stop-color="#c6cdd1"/>
|
||||
<stop offset="1" stop-color="#e0e5e7"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="c" y1="529.8" x1="400.57" y2="548.8" gradientUnits="userSpaceOnUse" x2="418.57" gradientTransform="translate(11-6)">
|
||||
<stop/>
|
||||
<stop offset="1" stop-opacity="0"/>
|
||||
</linearGradient>
|
||||
<linearGradient xlink:href="#b" id="d" y1="543.8" y2="502.66" gradientUnits="userSpaceOnUse" x2="0" gradientTransform="matrix(.66667 0 0 .63518 124.19 185.52)"/>
|
||||
<linearGradient xlink:href="#c" id="e" y1="523.8" x1="388.57" y2="538.8" gradientUnits="userSpaceOnUse" x2="400.57" gradientTransform="translate(11-7)"/>
|
||||
</defs>
|
||||
<g transform="translate(-384.57-499.8)">
|
||||
<rect width="20" x="392.57" y="504.8" fill="url(#d)" rx="0" height="28"/>
|
||||
<rect width="20" x="392.57" y="504.8" fill="#566069" height="4"/>
|
||||
<rect width="20" x="392.57" y="508.8" fill="#3daee9" height="1"/>
|
||||
<rect width="18" x="394.57" y="509.8" fill="#ffffff" height="21"/>
|
||||
<path fill="#464e55" d="m412.57 504.8l-5 7v4l5-7z"/>
|
||||
<g color-rendering="auto" color-interpolation-filters="linearRGB" shape-rendering="auto" image-rendering="auto" text-rendering="auto" color-interpolation="sRGB" color="#000000">
|
||||
<path fill="#1583bd" d="m412.57 508.8l-5 7v1l5-7z"/>
|
||||
<path fill="#a1aeb4" d="m412.57 509.8l-5 7v1l5-7z"/>
|
||||
</g>
|
||||
<rect width="20" x="407.57" y="511.8" fill="url(#b)" rx="0" height="28"/>
|
||||
<rect width="20" x="407.57" y="511.8" fill="#566069" height="4"/>
|
||||
<rect width="20" x="407.57" y="515.8" fill="#3daee9" height="1"/>
|
||||
<rect width="18" x="407.57" y="516.8" fill="#ffffff" height="21"/>
|
||||
<path opacity=".117" color-interpolation-filters="linearRGB" color="#000000" image-rendering="auto" color-rendering="auto" fill-rule="evenodd" d="m417.57 522.8l1 1h3l6 6v10l-5-.039-8.59-8.584 2.372-2.595-3.782-3.782 4-1z" color-interpolation="sRGB" text-rendering="auto" fill="url(#c)" shape-rendering="auto"/>
|
||||
<rect width="2" x="424.57" y="512.8" fill="#eff0f1" rx="1" height="2"/>
|
||||
<rect color-interpolation-filters="linearRGB" x="504.8" y="-392.57" color="#000000" image-rendering="auto" color-rendering="auto" width="41" color-interpolation="sRGB" text-rendering="auto" fill="url(#a)" height="2" shape-rendering="auto" transform="rotate(90)"/>
|
||||
<path fill="#555753" d="m416.57 522.8v1h-4v1h6.125v.25c0 .226-.141.768-.299 1.143-.174.414-.556.977-.926 1.365l-.307.32-.221-.24c-.302-.33-.752-1.01-.92-1.391l-.141-.314h-1.205l.125.303c.234.568.749 1.348 1.244 1.883.44.476.454.38-.113.801-.851.632-1.508 1.016-2.256 1.32l-.404.164.707.773.27-.135c.834-.417 1.801-1.031 2.488-1.578l.385-.305.293.238c.14.113.36.276.531.4.026.019.059.046.082.063.161.114.236.167.275.178.564.386 1.164.766 1.738 1.053l.283.141.369-.406.371-.404-.424-.172c-.682-.278-1.313-.652-2.049-1.174-.062-.051-.142-.114-.314-.236-.228-.162-.414-.311-.414-.332 0-.021.13-.181.291-.355.867-.942 1.39-1.902 1.535-2.814l.072-.537h1.807v-1h-4v-1z"/>
|
||||
<path opacity=".117" color-interpolation-filters="linearRGB" color="#000000" image-rendering="auto" color-rendering="auto" fill-rule="evenodd" d="m402.63 515.81l4.988 4.988-.05 12h-.254l-8.973-8.973 3.06-8.01z" color-interpolation="sRGB" text-rendering="auto" fill="url(#e)" shape-rendering="auto"/>
|
||||
<path fill="#555753" d="m402.02 516.88l-1.444 3.922h2.885zm-.612-1.068h1.229l3.055 8.01h-1.127l-.726-2.025-3.617.004-.73 2.02h-1.143z"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.8 KiB |
2
src/modules/summaryq/img/lokalize.svg.license
Normal file
2
src/modules/summaryq/img/lokalize.svg.license
Normal file
@ -0,0 +1,2 @@
|
||||
SPDX-FileCopyrightText: 2021 KDE Visual Design Group <visual-design@kde.org>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
112
src/modules/summaryq/summaryq.qml
Normal file
112
src/modules/summaryq/summaryq.qml
Normal file
@ -0,0 +1,112 @@
|
||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* Calamares is Free Software: see the License-Identifier above.
|
||||
*
|
||||
*/
|
||||
|
||||
import io.calamares.core 1.0
|
||||
import io.calamares.ui 1.0
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.13
|
||||
import QtQuick.Layouts 1.3
|
||||
import org.kde.kirigami 2.7 as Kirigami
|
||||
import QtGraphicalEffects 1.0
|
||||
import QtQuick.Window 2.3
|
||||
|
||||
Kirigami.ScrollablePage {
|
||||
width: 860 //parent.width //860
|
||||
height: 640 //parent.height //640
|
||||
|
||||
Kirigami.Theme.backgroundColor: "#EFF0F1"
|
||||
Kirigami.Theme.textColor: "#1F1F1F"
|
||||
|
||||
header: Kirigami.Heading {
|
||||
Layout.fillWidth: true
|
||||
height: 100
|
||||
horizontalAlignment: Qt.AlignHCenter
|
||||
color: Kirigami.Theme.textColor
|
||||
font.weight: Font.Medium
|
||||
font.pointSize: 12
|
||||
text: config.message
|
||||
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
width: parent.width
|
||||
|
||||
Component {
|
||||
id: _delegate
|
||||
|
||||
Rectangle {
|
||||
id: rect
|
||||
border.color: "#BDC3C7"
|
||||
width: parent.width - 80
|
||||
implicitHeight: message.implicitHeight + title.implicitHeight + 20
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
Item {
|
||||
width: parent.width - 80
|
||||
implicitHeight: message.implicitHeight + title.implicitHeight + 20
|
||||
|
||||
Kirigami.FormLayout {
|
||||
|
||||
GridLayout {
|
||||
anchors {
|
||||
//left: parent.left
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
}
|
||||
rowSpacing: Kirigami.Units.largeSpacing
|
||||
columnSpacing: Kirigami.Units.largeSpacing
|
||||
columns: width > Kirigami.Units.gridUnit * 20 ? 4 : 2
|
||||
|
||||
Image {
|
||||
id: image
|
||||
Layout.maximumHeight: Kirigami.Units.iconSizes.huge
|
||||
Layout.preferredWidth: height
|
||||
Layout.alignment: Qt.AlignTop
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source: index === 0 ? "img/lokalize.svg"
|
||||
: ( index === 1 ? "img/keyboard.svg"
|
||||
: ( index === 2 ? "qrc:/data/images/partition-manual.svg"
|
||||
: "qrc:/data/images/partition-partition.svg" ) )
|
||||
}
|
||||
ColumnLayout {
|
||||
|
||||
Label {
|
||||
id: title
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.WordWrap
|
||||
text: model.title
|
||||
font.weight: Font.Medium
|
||||
font.pointSize: 16
|
||||
}
|
||||
Rectangle {
|
||||
height: 2
|
||||
width: 200
|
||||
border.color: "#BDC3C7"
|
||||
}
|
||||
Label {
|
||||
id: message
|
||||
Layout.fillWidth: true
|
||||
text: model.message
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ListView {
|
||||
anchors.fill: parent
|
||||
spacing: 20
|
||||
model: config.summaryModel
|
||||
delegate: _delegate
|
||||
}
|
||||
}
|
7
src/modules/summaryq/summaryq.qrc
Normal file
7
src/modules/summaryq/summaryq.qrc
Normal file
@ -0,0 +1,7 @@
|
||||
<RCC>
|
||||
<qresource>
|
||||
<file>summaryq.qml</file>
|
||||
<file>img/keyboard.svg</file>
|
||||
<file>img/lokalize.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
Loading…
Reference in New Issue
Block a user