|
|
|
@ -20,15 +20,19 @@
|
|
|
|
|
#include "utils/Retranslator.h"
|
|
|
|
|
#include "viewpages/ExecutionViewStep.h"
|
|
|
|
|
|
|
|
|
|
SummaryModel::SummaryModel(QObject* parent) : QAbstractListModel(parent)
|
|
|
|
|
{}
|
|
|
|
|
SummaryModel::SummaryModel( QObject* parent )
|
|
|
|
|
: QAbstractListModel( parent )
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QHash<int, QByteArray> SummaryModel::roleNames() const
|
|
|
|
|
QHash< int, QByteArray >
|
|
|
|
|
SummaryModel::roleNames() const
|
|
|
|
|
{
|
|
|
|
|
return { { Qt::DisplayRole, "title" }, { Qt::UserRole, "message" } };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QVariant SummaryModel::data(const QModelIndex& index, int role) const
|
|
|
|
|
QVariant
|
|
|
|
|
SummaryModel::data( const QModelIndex& index, int role ) const
|
|
|
|
|
{
|
|
|
|
|
if ( !index.isValid() )
|
|
|
|
|
{
|
|
|
|
@ -38,12 +42,14 @@ QVariant SummaryModel::data(const QModelIndex& index, int role) const
|
|
|
|
|
return role == Qt::DisplayRole ? item->title : item->message;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int SummaryModel::rowCount(const QModelIndex&) const
|
|
|
|
|
int
|
|
|
|
|
SummaryModel::rowCount( const QModelIndex& ) const
|
|
|
|
|
{
|
|
|
|
|
return m_summary.count();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SummaryModel::setSummary(const Calamares::ViewStepList& steps)
|
|
|
|
|
void
|
|
|
|
|
SummaryModel::setSummary( const Calamares::ViewStepList& steps )
|
|
|
|
|
{
|
|
|
|
|
m_summary.clear();
|
|
|
|
|
Q_EMIT beginResetModel();
|
|
|
|
@ -54,44 +60,50 @@ void SummaryModel::setSummary(const Calamares::ViewStepList& steps)
|
|
|
|
|
QWidget* widget = step->createSummaryWidget();
|
|
|
|
|
|
|
|
|
|
if ( text.isEmpty() && !widget )
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_summary << new StepSummary {step->prettyName(), text};
|
|
|
|
|
|
|
|
|
|
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) )
|
|
|
|
|
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." ) );
|
|
|
|
|
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." ) );
|
|
|
|
|
"the install procedure." ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::componentComplete()
|
|
|
|
|
void
|
|
|
|
|
Config::componentComplete()
|
|
|
|
|
{
|
|
|
|
|
refresh();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::refresh()
|
|
|
|
|
void
|
|
|
|
|
Config::refresh()
|
|
|
|
|
{
|
|
|
|
|
m_summary->setSummary( stepsForSummary( Calamares::ViewManager::instance()->viewSteps() ));
|
|
|
|
|
m_summary->setSummary( stepsForSummary( Calamares::ViewManager::instance()->viewSteps() ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::init()
|
|
|
|
|
void
|
|
|
|
|
Config::init()
|
|
|
|
|
{
|
|
|
|
|
refresh();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Calamares::ViewStepList Config::stepsForSummary( const Calamares::ViewStepList& allSteps ) const
|
|
|
|
|
Calamares::ViewStepList
|
|
|
|
|
Config::stepsForSummary( const Calamares::ViewStepList& allSteps ) const
|
|
|
|
|
{
|
|
|
|
|
Calamares::ViewStepList steps;
|
|
|
|
|
for ( Calamares::ViewStep* step : allSteps )
|
|
|
|
@ -103,12 +115,12 @@ Calamares::ViewStepList Config::stepsForSummary( const Calamares::ViewStepList&
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( m_thisViewStep == step )
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
steps.append( step );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return steps;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|