|
|
|
@ -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 );
|
|
|
|
@ -97,7 +95,7 @@ CheckerWidget::init( const Calamares::RequirementsList& checkEntries )
|
|
|
|
|
"requirements for installing %1.<br/>"
|
|
|
|
|
"Installation cannot continue. "
|
|
|
|
|
"<a href=\"#details\">Details...</a>" )
|
|
|
|
|
.arg( *Calamares::Branding::ShortVersionedName ) );
|
|
|
|
|
.arg( *Calamares::Branding::ShortVersionedName ) );
|
|
|
|
|
)
|
|
|
|
|
textLabel->setOpenExternalLinks( false );
|
|
|
|
|
connect( textLabel, &QLabel::linkActivated,
|
|
|
|
@ -114,7 +112,7 @@ CheckerWidget::init( const Calamares::RequirementsList& checkEntries )
|
|
|
|
|
"recommended requirements for installing %1.<br/>"
|
|
|
|
|
"Installation can continue, but some features "
|
|
|
|
|
"might be disabled." )
|
|
|
|
|
.arg( *Calamares::Branding::ShortVersionedName ) );
|
|
|
|
|
.arg( *Calamares::Branding::ShortVersionedName ) );
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -122,16 +120,16 @@ CheckerWidget::init( const Calamares::RequirementsList& checkEntries )
|
|
|
|
|
if ( allChecked && requirementsSatisfied )
|
|
|
|
|
{
|
|
|
|
|
if ( !Calamares::Branding::instance()->
|
|
|
|
|
imagePath( Calamares::Branding::ProductWelcome ).isEmpty() )
|
|
|
|
|
imagePath( Calamares::Branding::ProductWelcome ).isEmpty() )
|
|
|
|
|
{
|
|
|
|
|
QPixmap theImage = QPixmap( Calamares::Branding::instance()->
|
|
|
|
|
imagePath( Calamares::Branding::ProductWelcome ) );
|
|
|
|
|
imagePath( Calamares::Branding::ProductWelcome ) );
|
|
|
|
|
if ( !theImage.isNull() )
|
|
|
|
|
{
|
|
|
|
|
QLabel* imageLabel;
|
|
|
|
|
if ( Calamares::Branding::instance()->welcomeExpandingLogo() )
|
|
|
|
|
{
|
|
|
|
|
FixedAspectRatioLabel *p = new FixedAspectRatioLabel;
|
|
|
|
|
FixedAspectRatioLabel* p = new FixedAspectRatioLabel;
|
|
|
|
|
p->setPixmap( theImage );
|
|
|
|
|
imageLabel = p;
|
|
|
|
|
}
|
|
|
|
@ -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 );
|
|
|
|
@ -194,8 +190,8 @@ CheckerWidget::showDetailsDialog( const Calamares::RequirementsList& checkEntrie
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QDialogButtonBox* buttonBox = new QDialogButtonBox( QDialogButtonBox::Close,
|
|
|
|
|
Qt::Horizontal,
|
|
|
|
|
this );
|
|
|
|
|
Qt::Horizontal,
|
|
|
|
|
this );
|
|
|
|
|
mainLayout->addWidget( buttonBox );
|
|
|
|
|
|
|
|
|
|
detailsDialog->setModal( true );
|