[summaryq] adding summaryq

initial work done by Nitrux/Camilo Higuita in 2020, reflected in license headers
C++ adjusted to make it build & work
as noted in the inline comments e80618ef1c
there are quite a few errors in the C++, but it builds, runs and shows the correct output
This commit is contained in:
demmm 2021-07-06 19:09:20 +02:00
parent 6388b41e6c
commit 6bb7df918d
11 changed files with 525 additions and 0 deletions

View file

@ -0,0 +1,22 @@
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( ${_finished} )
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
calamares_add_plugin( summaryq
TYPE viewmodule
EXPORT_MACRO PLUGINDLLEXPORT_PRO
SOURCES
SummaryQmlViewStep.cpp
Config.cpp
UI
RESOURCES
summaryq.qrc
LINK_PRIVATE_LIBRARIES
calamaresui
SHARED_LIB
)

View file

@ -0,0 +1,114 @@
/* === 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 "SummaryQmlViewStep.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::setSummary(const Calamares::ViewStepList& steps)
{
m_summary.clear();
Q_EMIT beginResetModel();
for ( Calamares::ViewStep* step : steps )
{
QString text = step->prettyStatus();
QWidget* widget = step->createSummaryWidget();
if ( text.isEmpty() && !widget )
continue;
m_summary << new StepSummary {step->prettyName(), text};
}
Q_EMIT endResetModel();
}
Config::Config(QObject *parent) : QObject(parent)
, m_thisViewStep(static_cast<SummaryQmlViewStep*>(parent))
, m_summary( new SummaryModel(this) )
{
m_title = m_thisViewStep->prettyName();
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." ) );
}
void Config::componentComplete()
{
refresh();
}
void Config::refresh()
{
m_summary->setSummary( stepsForSummary( Calamares::ViewManager::instance()->viewSteps() ));
}
void Config::init()
{
refresh();
}
Calamares::ViewStepList Config::stepsForSummary( const Calamares::ViewStepList& allSteps ) const
{
Calamares::ViewStepList steps;
for ( Calamares::ViewStep* step : allSteps )
{
if ( qobject_cast< Calamares::ExecutionViewStep* >( step ) )
{
steps.clear();
continue;
}
if ( m_thisViewStep == step )
break;
steps.append( step );
}
return steps;
}

View file

@ -0,0 +1,75 @@
/* === 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 <QObject>
#include <QAbstractListModel>
#include <QQmlParserStatus>
#include "viewpages/ViewStep.h"
class SummaryQmlViewStep;
struct StepSummary
{
QString title;
QString message;
};
class SummaryModel : public QAbstractListModel
{
Q_OBJECT
public:
explicit SummaryModel(QObject *parent = nullptr);
int rowCount( const QModelIndex& = QModelIndex() ) const override;
QVariant data( const QModelIndex& index, int role ) const override;
void setSummary(const Calamares::ViewStepList &steps);
protected:
QHash< int, QByteArray > roleNames() const override;
private:
QVector<StepSummary*> m_summary;
};
class Config : public QObject, public QQmlParserStatus
{
Q_OBJECT
Q_PROPERTY(QString message MEMBER m_message NOTIFY messageChanged CONSTANT)
Q_PROPERTY(QString title MEMBER m_title NOTIFY titleChanged CONSTANT)
Q_PROPERTY(SummaryModel * summaryModel READ summaryModel CONSTANT FINAL)
public:
explicit Config(QObject *parent = nullptr);
virtual void componentComplete() override;
virtual void classBegin() override {}
void refresh();
void init();
SummaryModel * summaryModel() const
{
return m_summary;
}
private:
Calamares::ViewStepList stepsForSummary( const Calamares::ViewStepList& allSteps ) const;
const SummaryQmlViewStep* m_thisViewStep;
SummaryModel *m_summary;
QString m_message;
QString m_title;
signals:
void messageChanged();
void titleChanged();
};
#endif

View file

@ -0,0 +1,75 @@
/* === 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 tr( "Summary" );
}
bool
SummaryQmlViewStep::isNextEnabled() const
{
return true;
}
bool
SummaryQmlViewStep::isBackEnabled() const
{
return true;
}
bool
SummaryQmlViewStep::isAtBeginning() const
{
return true;
}
bool
SummaryQmlViewStep::isAtEnd() const
{
return true;
}
QList< Calamares::job_ptr >
SummaryQmlViewStep::jobs() const
{
return QList< Calamares::job_ptr >();
}
void
SummaryQmlViewStep::onActivate()
{
m_config->init();
}

View file

@ -0,0 +1,55 @@
/* === 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 "utils/PluginFactory.h"
#include "viewpages/QmlViewStep.h"
#include "DllMacro.h"
#include <QObject>
class SummaryPage;
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;
QList< Calamares::job_ptr > jobs() const override;
void onActivate() override;
QObject * getConfig() override
{
return m_config;
}
private:
Config *m_config;
};
CALAMARES_PLUGIN_FACTORY_DECLARATION( SummaryQmlViewStepFactory )
#endif // SUMMARYQMLVIEWSTEP_H

View 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

View file

@ -0,0 +1,2 @@
SPDX-FileCopyrightText: 2021 KDE Visual Design Group <visual-design@kde.org>
SPDX-License-Identifier: GPL-3.0-or-later

View 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

View file

@ -0,0 +1,2 @@
SPDX-FileCopyrightText: 2021 KDE Visual Design Group <visual-design@kde.org>
SPDX-License-Identifier: GPL-3.0-or-later

View 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
}
}

View file

@ -0,0 +1,7 @@
<RCC>
<qresource>
<file>summaryq.qml</file>
<file>img/keyboard.svg</file>
<file>img/lokalize.svg</file>
</qresource>
</RCC>