[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 )
|
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
|
||||||
|
|
||||||
find_package( LIBPARTED REQUIRED )
|
|
||||||
find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED DBus Network )
|
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 )
|
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
|
||||||
|
|
||||||
set( CHECKER_SOURCES
|
set( CHECKER_SOURCES
|
||||||
checker/CheckItemWidget.cpp
|
checker/CheckItemWidget.cpp
|
||||||
checker/CheckerWidget.cpp
|
checker/CheckerWidget.cpp
|
||||||
checker/RequirementsChecker.cpp
|
checker/RequirementsChecker.cpp
|
||||||
checker/partman_devices.c
|
${PARTMAN_SRC}
|
||||||
)
|
|
||||||
set( CHECKER_LINK_LIBRARIES
|
|
||||||
${LIBPARTED_LIBS}
|
|
||||||
Qt5::DBus
|
|
||||||
Qt5::Network
|
|
||||||
)
|
)
|
||||||
|
|
||||||
calamares_add_plugin( welcome
|
calamares_add_plugin( welcome
|
||||||
@ -29,5 +33,7 @@ calamares_add_plugin( welcome
|
|||||||
LINK_PRIVATE_LIBRARIES
|
LINK_PRIVATE_LIBRARIES
|
||||||
calamaresui
|
calamaresui
|
||||||
${CHECKER_LINK_LIBRARIES}
|
${CHECKER_LINK_LIBRARIES}
|
||||||
|
Qt5::DBus
|
||||||
|
Qt5::Network
|
||||||
SHARED_LIB
|
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 2014-2015, Teo Mrnjavac <teo@kde.org>
|
||||||
* Copyright 2015, Anke Boersma <demm@kaosx.us>
|
* 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
|
* 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
|
||||||
@ -82,7 +82,7 @@ WelcomePage::WelcomePage( RequirementsChecker* requirementsChecker, QWidget* par
|
|||||||
" Philip Müller, Pier Luigi Fiorini, Rohan Garg and the <a "
|
" Philip Müller, Pier Luigi Fiorini, Rohan Garg and the <a "
|
||||||
"href=\"https://www.transifex.com/calamares/calamares/\">Calamares "
|
"href=\"https://www.transifex.com/calamares/calamares/\">Calamares "
|
||||||
"translators team</a>.<br/><br/>"
|
"translators team</a>.<br/><br/>"
|
||||||
"<a href=\"http://calamares.io/\">Calamares</a> "
|
"<a href=\"https://calamares.io/\">Calamares</a> "
|
||||||
"development is sponsored by <br/>"
|
"development is sponsored by <br/>"
|
||||||
"<a href=\"http://www.blue-systems.com/\">Blue Systems</a> - "
|
"<a href=\"http://www.blue-systems.com/\">Blue Systems</a> - "
|
||||||
"Liberating Software."
|
"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>
|
* 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>
|
* 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>
|
* 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 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
|
* 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
|
||||||
@ -23,7 +24,15 @@
|
|||||||
|
|
||||||
#include <QBoxLayout>
|
#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,
|
CheckItemWidget::CheckItemWidget( bool checked,
|
||||||
|
bool required,
|
||||||
QWidget* parent )
|
QWidget* parent )
|
||||||
: QWidget( parent )
|
: QWidget( parent )
|
||||||
{
|
{
|
||||||
@ -38,15 +47,13 @@ CheckItemWidget::CheckItemWidget( bool checked,
|
|||||||
m_textLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
m_textLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
||||||
|
|
||||||
if ( checked )
|
if ( checked )
|
||||||
m_iconLabel->setPixmap( CalamaresUtils::defaultPixmap( CalamaresUtils::Yes,
|
// Condition is satisfied
|
||||||
CalamaresUtils::Original,
|
setCondition( m_iconLabel, CalamaresUtils::StatusOk );
|
||||||
QSize( m_iconLabel->height(),
|
|
||||||
m_iconLabel->height() ) ) );
|
|
||||||
else
|
else
|
||||||
m_iconLabel->setPixmap( CalamaresUtils::defaultPixmap( CalamaresUtils::No,
|
if ( required )
|
||||||
CalamaresUtils::Original,
|
setCondition( m_iconLabel, CalamaresUtils::StatusError );
|
||||||
QSize( m_iconLabel->height(),
|
else
|
||||||
m_iconLabel->height() ) ) );
|
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 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
|
* 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
|
||||||
@ -25,7 +26,7 @@ class CheckItemWidget : public QWidget
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit CheckItemWidget( bool checked,
|
explicit CheckItemWidget( bool checked, bool required,
|
||||||
QWidget* parent = nullptr );
|
QWidget* parent = nullptr );
|
||||||
|
|
||||||
void setText( const QString& text );
|
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 2014-2015, Teo Mrnjavac <teo@kde.org>
|
||||||
* Copyright 2017, Adriaan de Groot <groot@kde.org>
|
* Copyright 2017, Adriaan de Groot <groot@kde.org>
|
||||||
@ -62,7 +62,7 @@ CheckerWidget::init( const QList< PrepareEntry >& checkEntries )
|
|||||||
{
|
{
|
||||||
if ( !entry.checked )
|
if ( !entry.checked )
|
||||||
{
|
{
|
||||||
CheckItemWidget* ciw = new CheckItemWidget( entry.checked );
|
CheckItemWidget* ciw = new CheckItemWidget( entry.checked, entry.required );
|
||||||
CALAMARES_RETRANSLATE( ciw->setText( entry.negatedText() ); )
|
CALAMARES_RETRANSLATE( ciw->setText( entry.negatedText() ); )
|
||||||
m_entriesLayout->addWidget( ciw );
|
m_entriesLayout->addWidget( ciw );
|
||||||
ciw->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
ciw->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
||||||
@ -182,7 +182,7 @@ CheckerWidget::showDetailsDialog( const QList< PrepareEntry >& checkEntries )
|
|||||||
if ( entry.enumerationText().isEmpty() )
|
if ( entry.enumerationText().isEmpty() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
CheckItemWidget* ciw = new CheckItemWidget( entry.checked );
|
CheckItemWidget* ciw = new CheckItemWidget( entry.checked, entry.required );
|
||||||
CALAMARES_RETRANSLATE( ciw->setText( entry.enumerationText() ); )
|
CALAMARES_RETRANSLATE( ciw->setText( entry.enumerationText() ); )
|
||||||
entriesLayout->addWidget( ciw );
|
entriesLayout->addWidget( ciw );
|
||||||
ciw->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
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>
|
* 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 2014-2017, Teo Mrnjavac <teo@kde.org>
|
||||||
* Copyright 2017, Adriaan de Groot <groot@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
|
* 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
|
||||||
@ -78,7 +79,7 @@ RequirementsChecker::RequirementsChecker( QObject* parent )
|
|||||||
bool hasPower = false;
|
bool hasPower = false;
|
||||||
bool hasInternet = false;
|
bool hasInternet = false;
|
||||||
bool isRoot = 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);
|
qint64 requiredStorageB = CalamaresUtils::GiBtoBytes(m_requiredStorageGB);
|
||||||
cDebug() << "Need at least storage bytes:" << requiredStorageB;
|
cDebug() << "Need at least storage bytes:" << requiredStorageB;
|
||||||
@ -99,8 +100,12 @@ RequirementsChecker::RequirementsChecker( QObject* parent )
|
|||||||
if ( m_entriesToCheck.contains( "root" ) )
|
if ( m_entriesToCheck.contains( "root" ) )
|
||||||
isRoot = checkIsRoot();
|
isRoot = checkIsRoot();
|
||||||
|
|
||||||
cDebug() << "enoughStorage, enoughRam, hasPower, hasInternet, isRoot: "
|
cDebug() << "RequirementsChecker output:"
|
||||||
<< enoughStorage << enoughRam << hasPower << hasInternet << isRoot;
|
<< " enoughStorage:" << enoughStorage
|
||||||
|
<< " enoughRam:" << enoughRam
|
||||||
|
<< " hasPower:" << hasPower
|
||||||
|
<< " hasInternet:" << hasInternet
|
||||||
|
<< " isRoot:" << isRoot;
|
||||||
|
|
||||||
QList< PrepareEntry > checkEntries;
|
QList< PrepareEntry > checkEntries;
|
||||||
foreach ( const QString& entry, m_entriesToCheck )
|
foreach ( const QString& entry, m_entriesToCheck )
|
||||||
@ -308,7 +313,12 @@ RequirementsChecker::verdict() const
|
|||||||
bool
|
bool
|
||||||
RequirementsChecker::checkEnoughStorage( qint64 requiredSpace )
|
RequirementsChecker::checkEnoughStorage( qint64 requiredSpace )
|
||||||
{
|
{
|
||||||
|
#ifdef WITHOUT_LIBPARTED
|
||||||
|
cDebug() << "WARNING: RequirementsChecker is configured without libparted.";
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
return check_big_enough( requiredSpace );
|
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 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
|
* 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
|
||||||
@ -27,6 +28,15 @@
|
|||||||
class CheckerWidget;
|
class CheckerWidget;
|
||||||
class QWidget;
|
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
|
struct PrepareEntry
|
||||||
{
|
{
|
||||||
QString name;
|
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>
|
* 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>
|
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user