|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
|
|
|
|
*
|
|
|
|
|
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
|
|
|
|
|
* Copyright 2017, Adriaan de Groot <groot@kde.org>
|
|
|
|
|
* Copyright 2017, 2019, Adriaan de Groot <groot@kde.org>
|
|
|
|
|
*
|
|
|
|
|
* Calamares is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
@ -17,9 +17,9 @@
|
|
|
|
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "CheckerWidget.h"
|
|
|
|
|
#include "ResultsListWidget.h"
|
|
|
|
|
|
|
|
|
|
#include "CheckItemWidget.h"
|
|
|
|
|
#include "ResultWidget.h"
|
|
|
|
|
|
|
|
|
|
#include "Branding.h"
|
|
|
|
|
#include "utils/CalamaresUtilsGui.h"
|
|
|
|
@ -33,7 +33,7 @@
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CheckerWidget::CheckerWidget( QWidget* parent )
|
|
|
|
|
ResultsListWidget::ResultsListWidget( QWidget* parent )
|
|
|
|
|
: QWidget( parent )
|
|
|
|
|
{
|
|
|
|
|
setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
|
|
|
|
@ -53,7 +53,7 @@ CheckerWidget::CheckerWidget( QWidget* parent )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
CheckerWidget::init( const Calamares::RequirementsList& checkEntries )
|
|
|
|
|
ResultsListWidget::init( const Calamares::RequirementsList& checkEntries )
|
|
|
|
|
{
|
|
|
|
|
bool allChecked = true;
|
|
|
|
|
bool requirementsSatisfied = true;
|
|
|
|
@ -62,16 +62,14 @@ CheckerWidget::init( const Calamares::RequirementsList& checkEntries )
|
|
|
|
|
{
|
|
|
|
|
if ( !entry.satisfied )
|
|
|
|
|
{
|
|
|
|
|
CheckItemWidget* ciw = new CheckItemWidget( entry.satisfied, entry.mandatory );
|
|
|
|
|
ResultWidget* ciw = new ResultWidget( entry.satisfied, entry.mandatory );
|
|
|
|
|
CALAMARES_RETRANSLATE( ciw->setText( entry.negatedText() ); )
|
|
|
|
|
m_entriesLayout->addWidget( ciw );
|
|
|
|
|
ciw->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
|
|
|
|
|
|
|
|
|
allChecked = false;
|
|
|
|
|
if ( entry.mandatory )
|
|
|
|
|
{
|
|
|
|
|
requirementsSatisfied = false;
|
|
|
|
|
}
|
|
|
|
|
ciw->setAutoFillBackground( true );
|
|
|
|
|
QPalette pal( ciw->palette() );
|
|
|
|
|
pal.setColor( QPalette::Background, Qt::white );
|
|
|
|
@ -155,14 +153,12 @@ CheckerWidget::init( const Calamares::RequirementsList& checkEntries )
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_mainLayout->addStretch();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
CheckerWidget::showDetailsDialog( const Calamares::RequirementsList& checkEntries )
|
|
|
|
|
ResultsListWidget::showDetailsDialog( const Calamares::RequirementsList& checkEntries )
|
|
|
|
|
{
|
|
|
|
|
QDialog* detailsDialog = new QDialog( this );
|
|
|
|
|
QBoxLayout* mainLayout = new QVBoxLayout;
|
|
|
|
@ -179,10 +175,10 @@ CheckerWidget::showDetailsDialog( const Calamares::RequirementsList& checkEntrie
|
|
|
|
|
|
|
|
|
|
for ( const auto& entry : checkEntries )
|
|
|
|
|
{
|
|
|
|
|
if ( entry.enumerationText().isEmpty() )
|
|
|
|
|
if ( !entry.hasDetails() )
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
CheckItemWidget* ciw = new CheckItemWidget( entry.satisfied, entry.mandatory );
|
|
|
|
|
ResultWidget* ciw = new ResultWidget( entry.satisfied, entry.mandatory );
|
|
|
|
|
CALAMARES_RETRANSLATE( ciw->setText( entry.enumerationText() ); )
|
|
|
|
|
entriesLayout->addWidget( ciw );
|
|
|
|
|
ciw->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|