[welcome] merge with upstream master branch
This commit is contained in:
parent
a206167690
commit
84a29ddfec
@ -1,20 +1,24 @@
|
||||
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
|
||||
|
||||
find_package( LIBPARTED REQUIRED )
|
||||
find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED DBus Network )
|
||||
|
||||
find_package( LIBPARTED )
|
||||
if ( LIBPARTED_FOUND )
|
||||
set( PARTMAN_SRC checker/partman_devices.c )
|
||||
set( CHECKER_LINK_LIBRARIES ${LIBPARTED_LIBRARY} )
|
||||
else()
|
||||
set( PARTMAN_SRC )
|
||||
set( CHECKER_LINK_LIBRARIES )
|
||||
add_definitions( -DWITHOUT_LIBPARTED )
|
||||
endif()
|
||||
|
||||
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
|
||||
|
||||
set( CHECKER_SOURCES
|
||||
checker/CheckItemWidget.cpp
|
||||
checker/CheckerWidget.cpp
|
||||
checker/RequirementsChecker.cpp
|
||||
checker/partman_devices.c
|
||||
)
|
||||
set( CHECKER_LINK_LIBRARIES
|
||||
${LIBPARTED_LIBS}
|
||||
Qt5::DBus
|
||||
Qt5::Network
|
||||
${PARTMAN_SRC}
|
||||
)
|
||||
|
||||
calamares_add_plugin( welcome
|
||||
@ -29,5 +33,7 @@ calamares_add_plugin( welcome
|
||||
LINK_PRIVATE_LIBRARIES
|
||||
calamaresui
|
||||
${CHECKER_LINK_LIBRARIES}
|
||||
Qt5::DBus
|
||||
Qt5::Network
|
||||
SHARED_LIB
|
||||
)
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
|
||||
* Copyright 2015, Anke Boersma <demm@kaosx.us>
|
||||
* Copyright 2017, Adriaan de Groot <groot@kde.org>
|
||||
* Copyright 2017-2018, 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
|
||||
@ -82,7 +82,7 @@ WelcomePage::WelcomePage( RequirementsChecker* requirementsChecker, QWidget* par
|
||||
" Philip Müller, Pier Luigi Fiorini, Rohan Garg and the <a "
|
||||
"href=\"https://www.transifex.com/calamares/calamares/\">Calamares "
|
||||
"translators team</a>.<br/><br/>"
|
||||
"<a href=\"http://calamares.io/\">Calamares</a> "
|
||||
"<a href=\"https://calamares.io/\">Calamares</a> "
|
||||
"development is sponsored by <br/>"
|
||||
"<a href=\"http://www.blue-systems.com/\">Blue Systems</a> - "
|
||||
"Liberating Software."
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
/* === 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>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -23,7 +24,15 @@
|
||||
|
||||
#include <QBoxLayout>
|
||||
|
||||
static inline void setCondition( QLabel* label, CalamaresUtils::ImageType t )
|
||||
{
|
||||
label->setPixmap( CalamaresUtils::defaultPixmap( t,
|
||||
CalamaresUtils::Original,
|
||||
QSize( label->height(), label->height() ) ) );
|
||||
}
|
||||
|
||||
CheckItemWidget::CheckItemWidget( bool checked,
|
||||
bool required,
|
||||
QWidget* parent )
|
||||
: QWidget( parent )
|
||||
{
|
||||
@ -38,15 +47,13 @@ CheckItemWidget::CheckItemWidget( bool checked,
|
||||
m_textLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
||||
|
||||
if ( checked )
|
||||
m_iconLabel->setPixmap( CalamaresUtils::defaultPixmap( CalamaresUtils::Yes,
|
||||
CalamaresUtils::Original,
|
||||
QSize( m_iconLabel->height(),
|
||||
m_iconLabel->height() ) ) );
|
||||
// Condition is satisfied
|
||||
setCondition( m_iconLabel, CalamaresUtils::StatusOk );
|
||||
else
|
||||
m_iconLabel->setPixmap( CalamaresUtils::defaultPixmap( CalamaresUtils::No,
|
||||
CalamaresUtils::Original,
|
||||
QSize( m_iconLabel->height(),
|
||||
m_iconLabel->height() ) ) );
|
||||
if ( required )
|
||||
setCondition( m_iconLabel, CalamaresUtils::StatusError );
|
||||
else
|
||||
setCondition( m_iconLabel, CalamaresUtils::StatusWarning );
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
/* === 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>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -25,7 +26,7 @@ class CheckItemWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CheckItemWidget( bool checked,
|
||||
explicit CheckItemWidget( bool checked, bool required,
|
||||
QWidget* parent = nullptr );
|
||||
|
||||
void setText( const QString& text );
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
/* === 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>
|
||||
@ -62,7 +62,7 @@ CheckerWidget::init( const QList< PrepareEntry >& checkEntries )
|
||||
{
|
||||
if ( !entry.checked )
|
||||
{
|
||||
CheckItemWidget* ciw = new CheckItemWidget( entry.checked );
|
||||
CheckItemWidget* ciw = new CheckItemWidget( entry.checked, entry.required );
|
||||
CALAMARES_RETRANSLATE( ciw->setText( entry.negatedText() ); )
|
||||
m_entriesLayout->addWidget( ciw );
|
||||
ciw->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
||||
@ -182,7 +182,7 @@ CheckerWidget::showDetailsDialog( const QList< PrepareEntry >& checkEntries )
|
||||
if ( entry.enumerationText().isEmpty() )
|
||||
continue;
|
||||
|
||||
CheckItemWidget* ciw = new CheckItemWidget( entry.checked );
|
||||
CheckItemWidget* ciw = new CheckItemWidget( entry.checked, entry.required );
|
||||
CALAMARES_RETRANSLATE( ciw->setText( entry.enumerationText() ); )
|
||||
entriesLayout->addWidget( ciw );
|
||||
ciw->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
|
@ -1,7 +1,8 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014-2017, Teo Mrnjavac <teo@kde.org>
|
||||
* Copyright 2017, Adriaan de Groot <groot@kde.org>
|
||||
* Copyright 2017, Gabriel Craciunescu <crazy@frugalware.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
|
||||
@ -78,7 +79,7 @@ RequirementsChecker::RequirementsChecker( QObject* parent )
|
||||
bool hasPower = false;
|
||||
bool hasInternet = false;
|
||||
bool isRoot = false;
|
||||
bool enoughScreen = (availableSize.width() >= CalamaresUtils::windowPreferredWidth) && (availableSize.height() >= CalamaresUtils::windowPreferredHeight);
|
||||
bool enoughScreen = (availableSize.width() >= CalamaresUtils::windowMinimumWidth) && (availableSize.height() >= CalamaresUtils::windowMinimumHeight);
|
||||
|
||||
qint64 requiredStorageB = CalamaresUtils::GiBtoBytes(m_requiredStorageGB);
|
||||
cDebug() << "Need at least storage bytes:" << requiredStorageB;
|
||||
@ -99,8 +100,12 @@ RequirementsChecker::RequirementsChecker( QObject* parent )
|
||||
if ( m_entriesToCheck.contains( "root" ) )
|
||||
isRoot = checkIsRoot();
|
||||
|
||||
cDebug() << "enoughStorage, enoughRam, hasPower, hasInternet, isRoot: "
|
||||
<< enoughStorage << enoughRam << hasPower << hasInternet << isRoot;
|
||||
cDebug() << "RequirementsChecker output:"
|
||||
<< " enoughStorage:" << enoughStorage
|
||||
<< " enoughRam:" << enoughRam
|
||||
<< " hasPower:" << hasPower
|
||||
<< " hasInternet:" << hasInternet
|
||||
<< " isRoot:" << isRoot;
|
||||
|
||||
QList< PrepareEntry > checkEntries;
|
||||
foreach ( const QString& entry, m_entriesToCheck )
|
||||
@ -308,7 +313,12 @@ RequirementsChecker::verdict() const
|
||||
bool
|
||||
RequirementsChecker::checkEnoughStorage( qint64 requiredSpace )
|
||||
{
|
||||
#ifdef WITHOUT_LIBPARTED
|
||||
cDebug() << "WARNING: RequirementsChecker is configured without libparted.";
|
||||
return false;
|
||||
#else
|
||||
return check_big_enough( requiredSpace );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014-2017, Teo Mrnjavac <teo@kde.org>
|
||||
* Copyright 2017, 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
|
||||
@ -27,6 +28,15 @@
|
||||
class CheckerWidget;
|
||||
class QWidget;
|
||||
|
||||
/**
|
||||
* An indication of a requirement, which is checked in preparation
|
||||
* for system installation. An entry has a name and some explanation,
|
||||
* as well as three meaningful states:
|
||||
* - checked = true, the requirement is met (green)
|
||||
* - checked = false, the requirement is not met
|
||||
* - required = false, warn about it (yellow), no failure
|
||||
* - required = true, prohibit installation (red)
|
||||
*/
|
||||
struct PrepareEntry
|
||||
{
|
||||
QString name;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user