mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 10:55:46 -05:00
[welcome] Config should not have its own RequirementsModel
- Use the one from ModuleManager
This commit is contained in:
parent
153757933a
commit
fabe5ec439
4 changed files with 20 additions and 21 deletions
|
@ -87,10 +87,13 @@ public:
|
|||
|
||||
/**
|
||||
* @brief Starts asynchronous requirements checking for each module.
|
||||
* When this is done, the signal modulesChecked is emitted.
|
||||
* When this is done, the signal requirementsComplete is emitted.
|
||||
*/
|
||||
void checkRequirements();
|
||||
|
||||
///@brief Gets the model that requirements-checking works on.
|
||||
RequirementsModel* requirementsModel() { return m_requirementsModel; }
|
||||
|
||||
signals:
|
||||
void initDone();
|
||||
void modulesLoaded(); /// All of the modules were loaded successfully
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "Settings.h"
|
||||
#include "geoip/Handler.h"
|
||||
#include "locale/Lookup.h"
|
||||
#include "modulesystem/ModuleManager.h"
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/Retranslator.h"
|
||||
#include "utils/Variant.h"
|
||||
|
@ -30,14 +31,8 @@
|
|||
|
||||
Config::Config( QObject* parent )
|
||||
: QObject( parent )
|
||||
, m_requirementsModel( new Calamares::RequirementsModel( this ) )
|
||||
, m_languages( CalamaresUtils::Locale::availableTranslations() )
|
||||
{
|
||||
connect( m_requirementsModel,
|
||||
&Calamares::RequirementsModel::satisfiedRequirementsChanged,
|
||||
this,
|
||||
&Config::setIsNextEnabled );
|
||||
|
||||
initLanguages();
|
||||
|
||||
CALAMARES_RETRANSLATE_SLOT( &Config::retranslate )
|
||||
|
@ -49,12 +44,13 @@ Config::retranslate()
|
|||
m_genericWelcomeMessage = genericWelcomeMessage().arg( Calamares::Branding::instance()->versionedName() );
|
||||
emit genericWelcomeMessageChanged( m_genericWelcomeMessage );
|
||||
|
||||
if ( !m_requirementsModel->satisfiedRequirements() )
|
||||
const auto* r = requirementsModel();
|
||||
if ( !r->satisfiedRequirements() )
|
||||
{
|
||||
QString message;
|
||||
const bool setup = Calamares::Settings::instance()->isSetupMode();
|
||||
|
||||
if ( !m_requirementsModel->satisfiedMandatory() )
|
||||
if ( !r->satisfiedMandatory() )
|
||||
{
|
||||
message = setup ? tr( "This computer does not satisfy the minimum "
|
||||
"requirements for setting up %1.<br/>"
|
||||
|
@ -95,6 +91,13 @@ Config::languagesModel() const
|
|||
return m_languages;
|
||||
}
|
||||
|
||||
Calamares::RequirementsModel*
|
||||
Config::requirementsModel() const
|
||||
{
|
||||
return Calamares::ModuleManager::instance()->requirementsModel();
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
Config::languageIcon() const
|
||||
{
|
||||
|
@ -183,12 +186,6 @@ Config::setLocaleIndex( int index )
|
|||
emit localeIndexChanged( m_localeIndex );
|
||||
}
|
||||
|
||||
Calamares::RequirementsModel&
|
||||
Config::requirementsModel() const
|
||||
{
|
||||
return *m_requirementsModel;
|
||||
}
|
||||
|
||||
void
|
||||
Config::setIsNextEnabled( bool isNextEnabled )
|
||||
{
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#define WELCOME_CONFIG_H
|
||||
|
||||
#include "locale/LabelModel.h"
|
||||
#include "modulesystem/Requirement.h"
|
||||
#include "modulesystem/RequirementsModel.h"
|
||||
|
||||
#include <QObject>
|
||||
|
@ -30,7 +29,7 @@ class Config : public QObject
|
|||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY( CalamaresUtils::Locale::LabelModel* languagesModel READ languagesModel CONSTANT FINAL )
|
||||
Q_PROPERTY( Calamares::RequirementsModel* requirementsModel MEMBER m_requirementsModel CONSTANT FINAL )
|
||||
Q_PROPERTY( Calamares::RequirementsModel* requirementsModel READ requirementsModel CONSTANT FINAL )
|
||||
|
||||
Q_PROPERTY( QString languageIcon READ languageIcon CONSTANT FINAL )
|
||||
|
||||
|
@ -52,8 +51,6 @@ public:
|
|||
|
||||
void setConfigurationMap( const QVariantMap& );
|
||||
|
||||
Calamares::RequirementsModel& requirementsModel() const;
|
||||
|
||||
void setCountryCode( const QString& countryCode );
|
||||
|
||||
QString languageIcon() const;
|
||||
|
@ -83,6 +80,9 @@ public slots:
|
|||
CalamaresUtils::Locale::LabelModel* languagesModel() const;
|
||||
void retranslate();
|
||||
|
||||
///@brief The **global** requirements model, from ModuleManager
|
||||
Calamares::RequirementsModel* requirementsModel() const;
|
||||
|
||||
signals:
|
||||
void countryCodeChanged( QString countryCode );
|
||||
void localeIndexChanged( int localeIndex );
|
||||
|
@ -99,7 +99,6 @@ signals:
|
|||
private:
|
||||
void initLanguages();
|
||||
|
||||
Calamares::RequirementsModel* m_requirementsModel;
|
||||
CalamaresUtils::Locale::LabelModel* m_languages;
|
||||
|
||||
QString m_languageIcon;
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
WelcomePage::WelcomePage( Config* conf, QWidget* parent )
|
||||
: QWidget( parent )
|
||||
, ui( new Ui::WelcomePage )
|
||||
, m_checkingWidget( new CheckerContainer( conf->requirementsModel(), this ) )
|
||||
, m_checkingWidget( new CheckerContainer( *(conf->requirementsModel()), this ) )
|
||||
, m_languages( nullptr )
|
||||
, m_conf( conf )
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue