[welcome] Code-formatting

- Update copyright headers
 - Apply calamaresstyle
main
Adriaan de Groot 7 years ago
parent 54ba0aaf13
commit 4d8acdf425

@ -1,7 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> === /* === This file is part of Calamares - <https://github.com/calamares> ===
* *
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org> * 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 * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -26,14 +26,15 @@
static inline void setCondition( QLabel* label, CalamaresUtils::ImageType t ) static inline void setCondition( QLabel* label, CalamaresUtils::ImageType t )
{ {
label->setPixmap( CalamaresUtils::defaultPixmap( t, label->setPixmap(
CalamaresUtils::Original, CalamaresUtils::defaultPixmap( t,
QSize( label->height(), label->height() ) ) ); CalamaresUtils::Original,
QSize( label->height(), label->height() ) ) );
} }
ResultWidget::ResultWidget( bool satisfied, ResultWidget::ResultWidget( bool satisfied,
bool required, bool required,
QWidget* parent ) QWidget* parent )
: QWidget( parent ) : QWidget( parent )
{ {
QBoxLayout* mainLayout = new QHBoxLayout; QBoxLayout* mainLayout = new QHBoxLayout;
@ -48,11 +49,10 @@ ResultWidget::ResultWidget( bool satisfied,
if ( satisfied ) if ( satisfied )
setCondition( m_iconLabel, CalamaresUtils::StatusOk ); setCondition( m_iconLabel, CalamaresUtils::StatusOk );
else if ( required )
setCondition( m_iconLabel, CalamaresUtils::StatusError );
else else
if ( required ) setCondition( m_iconLabel, CalamaresUtils::StatusWarning );
setCondition( m_iconLabel, CalamaresUtils::StatusError );
else
setCondition( m_iconLabel, CalamaresUtils::StatusWarning );
} }

@ -1,7 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> === /* === This file is part of Calamares - <https://github.com/calamares> ===
* *
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org> * 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 * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -69,9 +69,7 @@ ResultsListWidget::init( const Calamares::RequirementsList& checkEntries )
allChecked = false; allChecked = false;
if ( entry.mandatory ) if ( entry.mandatory )
{
requirementsSatisfied = false; requirementsSatisfied = false;
}
ciw->setAutoFillBackground( true ); ciw->setAutoFillBackground( true );
QPalette pal( ciw->palette() ); QPalette pal( ciw->palette() );
pal.setColor( QPalette::Background, Qt::white ); pal.setColor( QPalette::Background, Qt::white );
@ -97,7 +95,7 @@ ResultsListWidget::init( const Calamares::RequirementsList& checkEntries )
"requirements for installing %1.<br/>" "requirements for installing %1.<br/>"
"Installation cannot continue. " "Installation cannot continue. "
"<a href=\"#details\">Details...</a>" ) "<a href=\"#details\">Details...</a>" )
.arg( *Calamares::Branding::ShortVersionedName ) ); .arg( *Calamares::Branding::ShortVersionedName ) );
) )
textLabel->setOpenExternalLinks( false ); textLabel->setOpenExternalLinks( false );
connect( textLabel, &QLabel::linkActivated, connect( textLabel, &QLabel::linkActivated,
@ -114,7 +112,7 @@ ResultsListWidget::init( const Calamares::RequirementsList& checkEntries )
"recommended requirements for installing %1.<br/>" "recommended requirements for installing %1.<br/>"
"Installation can continue, but some features " "Installation can continue, but some features "
"might be disabled." ) "might be disabled." )
.arg( *Calamares::Branding::ShortVersionedName ) ); .arg( *Calamares::Branding::ShortVersionedName ) );
) )
} }
} }
@ -122,16 +120,16 @@ ResultsListWidget::init( const Calamares::RequirementsList& checkEntries )
if ( allChecked && requirementsSatisfied ) if ( allChecked && requirementsSatisfied )
{ {
if ( !Calamares::Branding::instance()-> if ( !Calamares::Branding::instance()->
imagePath( Calamares::Branding::ProductWelcome ).isEmpty() ) imagePath( Calamares::Branding::ProductWelcome ).isEmpty() )
{ {
QPixmap theImage = QPixmap( Calamares::Branding::instance()-> QPixmap theImage = QPixmap( Calamares::Branding::instance()->
imagePath( Calamares::Branding::ProductWelcome ) ); imagePath( Calamares::Branding::ProductWelcome ) );
if ( !theImage.isNull() ) if ( !theImage.isNull() )
{ {
QLabel* imageLabel; QLabel* imageLabel;
if ( Calamares::Branding::instance()->welcomeExpandingLogo() ) if ( Calamares::Branding::instance()->welcomeExpandingLogo() )
{ {
FixedAspectRatioLabel *p = new FixedAspectRatioLabel; FixedAspectRatioLabel* p = new FixedAspectRatioLabel;
p->setPixmap( theImage ); p->setPixmap( theImage );
imageLabel = p; imageLabel = p;
} }
@ -155,9 +153,7 @@ ResultsListWidget::init( const Calamares::RequirementsList& checkEntries )
) )
} }
else else
{
m_mainLayout->addStretch(); m_mainLayout->addStretch();
}
} }
@ -194,8 +190,8 @@ ResultsListWidget::showDetailsDialog( const Calamares::RequirementsList& checkEn
} }
QDialogButtonBox* buttonBox = new QDialogButtonBox( QDialogButtonBox::Close, QDialogButtonBox* buttonBox = new QDialogButtonBox( QDialogButtonBox::Close,
Qt::Horizontal, Qt::Horizontal,
this ); this );
mainLayout->addWidget( buttonBox ); mainLayout->addWidget( buttonBox );
detailsDialog->setModal( true ); detailsDialog->setModal( true );

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> === /* === This file is part of Calamares - <https://github.com/calamares> ===
* *
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org> * Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
* Copyright 2019, Adriaan de Groot <groot@kde.org>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

Loading…
Cancel
Save