correct typo
This commit is contained in:
parent
1c0e69e1c2
commit
b6b9f888fc
@ -30,13 +30,13 @@ RequirementsModel::setRequirementsList( const Calamares::RequirementsList& requi
|
|||||||
CALAMARES_RETRANSLATE_SLOT( &RequirementsModel::retranslate )
|
CALAMARES_RETRANSLATE_SLOT( &RequirementsModel::retranslate )
|
||||||
|
|
||||||
emit beginResetModel();
|
emit beginResetModel();
|
||||||
m_requierements = requirements;
|
m_requirements = requirements;
|
||||||
|
|
||||||
auto isUnSatisfied = []( const Calamares::RequirementEntry& e ) { return !e.satisfied; };
|
auto isUnSatisfied = []( const Calamares::RequirementEntry& e ) { return !e.satisfied; };
|
||||||
auto isMandatoryAndUnSatisfied = []( const Calamares::RequirementEntry& e ) { return e.mandatory && !e.satisfied; };
|
auto isMandatoryAndUnSatisfied = []( const Calamares::RequirementEntry& e ) { return e.mandatory && !e.satisfied; };
|
||||||
|
|
||||||
m_satisfiedRequirements = std::none_of( m_requierements.begin(), m_requierements.end(), isUnSatisfied );
|
m_satisfiedRequirements = std::none_of( m_requirements.begin(), m_requirements.end(), isUnSatisfied );
|
||||||
m_satisfiedMandatory = std::none_of( m_requierements.begin(), m_requierements.end(), isMandatoryAndUnSatisfied );
|
m_satisfiedMandatory = std::none_of( m_requirements.begin(), m_requirements.end(), isMandatoryAndUnSatisfied );
|
||||||
|
|
||||||
emit satisfiedRequirementsChanged(m_satisfiedRequirements);
|
emit satisfiedRequirementsChanged(m_satisfiedRequirements);
|
||||||
emit satisfiedMandatoryChanged();
|
emit satisfiedMandatoryChanged();
|
||||||
@ -46,13 +46,13 @@ RequirementsModel::setRequirementsList( const Calamares::RequirementsList& requi
|
|||||||
int
|
int
|
||||||
RequirementsModel::rowCount( const QModelIndex& ) const
|
RequirementsModel::rowCount( const QModelIndex& ) const
|
||||||
{
|
{
|
||||||
return m_requierements.count();
|
return m_requirements.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant
|
QVariant
|
||||||
RequirementsModel::data( const QModelIndex& index, int role ) const
|
RequirementsModel::data( const QModelIndex& index, int role ) const
|
||||||
{
|
{
|
||||||
const auto requirement = m_requierements.at( index.row() );
|
const auto requirement = m_requirements.at( index.row() );
|
||||||
|
|
||||||
switch ( role )
|
switch ( role )
|
||||||
{
|
{
|
||||||
@ -92,28 +92,12 @@ Config::Config( QObject* parent ) : QObject( parent )
|
|||||||
initLanguages();
|
initLanguages();
|
||||||
|
|
||||||
CALAMARES_RETRANSLATE_SLOT( &Config::retranslate )
|
CALAMARES_RETRANSLATE_SLOT( &Config::retranslate )
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Config::retranslate()
|
Config::retranslate()
|
||||||
{
|
{
|
||||||
QString message;
|
m_genericWelcomeMessage = genericWelcomeMessage().arg( *Calamares::Branding::VersionedName );
|
||||||
|
|
||||||
if ( Calamares::Settings::instance()->isSetupMode() )
|
|
||||||
{
|
|
||||||
message = Calamares::Branding::instance()->welcomeStyleCalamares()
|
|
||||||
? tr( "<h1>Welcome to the Calamares setup program for %1.</h1>" )
|
|
||||||
: tr( "<h1>Welcome to %1 setup.</h1>" );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
message = Calamares::Branding::instance()->welcomeStyleCalamares()
|
|
||||||
? tr( "<h1>Welcome to the Calamares installer for %1.</h1>" )
|
|
||||||
: tr( "<h1>Welcome to the %1 installer.</h1>" );
|
|
||||||
}
|
|
||||||
|
|
||||||
m_genericWelcomeMessage = message.arg( *Calamares::Branding::VersionedName );
|
|
||||||
emit genericWelcomeMessageChanged();
|
emit genericWelcomeMessageChanged();
|
||||||
|
|
||||||
m_requirementsModel->retranslate();
|
m_requirementsModel->retranslate();
|
||||||
@ -224,51 +208,60 @@ Config::setIsNextEnabled( const bool& isNextEnabled )
|
|||||||
emit isNextEnabledChanged( m_isNextEnabled );
|
emit isNextEnabledChanged( m_isNextEnabled );
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Config::donateUrl() const
|
QString
|
||||||
|
Config::donateUrl() const
|
||||||
{
|
{
|
||||||
return m_donateUrl;
|
return m_donateUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::setDonateUrl(const QString& url)
|
void
|
||||||
|
Config::setDonateUrl(const QString& url)
|
||||||
{
|
{
|
||||||
m_donateUrl = url;
|
m_donateUrl = url;
|
||||||
emit donateUrlChanged();
|
emit donateUrlChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Config::knownIssuesUrl() const
|
QString
|
||||||
|
Config::knownIssuesUrl() const
|
||||||
{
|
{
|
||||||
return m_knownIssuesUrl;
|
return m_knownIssuesUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::setKnownIssuesUrl(const QString& url)
|
void
|
||||||
|
Config::setKnownIssuesUrl(const QString& url)
|
||||||
{
|
{
|
||||||
m_knownIssuesUrl = url;
|
m_knownIssuesUrl = url;
|
||||||
emit knownIssuesUrlChanged();
|
emit knownIssuesUrlChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::setReleaseNotesUrl(const QString& url)
|
void
|
||||||
|
Config::setReleaseNotesUrl(const QString& url)
|
||||||
{
|
{
|
||||||
m_releaseNotesUrl = url;
|
m_releaseNotesUrl = url;
|
||||||
emit releaseNotesUrlChanged();
|
emit releaseNotesUrlChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Config::releaseNotesUrl() const
|
QString
|
||||||
|
Config::releaseNotesUrl() const
|
||||||
{
|
{
|
||||||
return m_releaseNotesUrl;
|
return m_releaseNotesUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Config::supportUrl() const
|
QString
|
||||||
|
Config::supportUrl() const
|
||||||
{
|
{
|
||||||
return m_supportUrl;
|
return m_supportUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::setSupportUrl(const QString& url)
|
void
|
||||||
|
Config::setSupportUrl(const QString& url)
|
||||||
{
|
{
|
||||||
m_supportUrl = url;
|
m_supportUrl = url;
|
||||||
emit supportUrlChanged();
|
emit supportUrlChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RequirementsModel::retranslate()
|
void
|
||||||
|
RequirementsModel::retranslate()
|
||||||
{
|
{
|
||||||
if ( !m_satisfiedRequirements )
|
if ( !m_satisfiedRequirements )
|
||||||
{
|
{
|
||||||
@ -308,3 +301,25 @@ void RequirementsModel::retranslate()
|
|||||||
|
|
||||||
emit warningMessageChanged();
|
emit warningMessageChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString
|
||||||
|
Config::genericWelcomeMessage()
|
||||||
|
{
|
||||||
|
QString message;
|
||||||
|
|
||||||
|
if ( Calamares::Settings::instance()->isSetupMode() )
|
||||||
|
{
|
||||||
|
message = Calamares::Branding::instance()->welcomeStyleCalamares()
|
||||||
|
? tr( "<h1>Welcome to the Calamares setup program for %1.</h1>" )
|
||||||
|
: tr( "<h1>Welcome to %1 setup.</h1>" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
message = Calamares::Branding::instance()->welcomeStyleCalamares()
|
||||||
|
? tr( "<h1>Welcome to the Calamares installer for %1.</h1>" )
|
||||||
|
: tr( "<h1>Welcome to the %1 installer.</h1>" );
|
||||||
|
}
|
||||||
|
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ public:
|
|||||||
if(index > count() || index < 0)
|
if(index > count() || index < 0)
|
||||||
return *(new Calamares::RequirementEntry());
|
return *(new Calamares::RequirementEntry());
|
||||||
|
|
||||||
return m_requierements.at(index);
|
return m_requirements.at(index);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ public:
|
|||||||
int rowCount(const QModelIndex&) const override;
|
int rowCount(const QModelIndex&) const override;
|
||||||
int count() const
|
int count() const
|
||||||
{
|
{
|
||||||
return m_requierements.count();
|
return m_requirements.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString warningMessage() const
|
QString warningMessage() const
|
||||||
@ -85,7 +85,7 @@ protected:
|
|||||||
QHash<int, QByteArray> roleNames() const override;
|
QHash<int, QByteArray> roleNames() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Calamares::RequirementsList m_requierements;
|
Calamares::RequirementsList m_requirements;
|
||||||
bool m_satisfiedRequirements = false;
|
bool m_satisfiedRequirements = false;
|
||||||
bool m_satisfiedMandatory = false;
|
bool m_satisfiedMandatory = false;
|
||||||
|
|
||||||
@ -141,6 +141,9 @@ public:
|
|||||||
QString donateUrl() const;
|
QString donateUrl() const;
|
||||||
void setDonateUrl(const QString &url);
|
void setDonateUrl(const QString &url);
|
||||||
|
|
||||||
|
QString genericWelcomeMessage();
|
||||||
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
CalamaresUtils::Locale::LabelModel* languagesModel() const;
|
CalamaresUtils::Locale::LabelModel* languagesModel() const;
|
||||||
void retranslate();
|
void retranslate();
|
||||||
|
Loading…
Reference in New Issue
Block a user