[welcome] Apply coding style
This commit is contained in:
parent
ff74113675
commit
1ede7003c0
@ -17,10 +17,10 @@
|
||||
*/
|
||||
|
||||
#include "Config.h"
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/Retranslator.h"
|
||||
#include "Branding.h"
|
||||
#include "Settings.h"
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/Retranslator.h"
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
@ -83,7 +83,8 @@ RequirementsModel::roleNames() const
|
||||
return roles;
|
||||
}
|
||||
|
||||
Config::Config( QObject* parent ) : QObject( parent )
|
||||
Config::Config( QObject* parent )
|
||||
: QObject( parent )
|
||||
, m_requirementsModel( new RequirementsModel( this ) )
|
||||
, m_languages( CalamaresUtils::Locale::availableTranslations() )
|
||||
{
|
||||
@ -180,8 +181,11 @@ Config::setLanguageIcon(const QString &languageIcon )
|
||||
void
|
||||
Config::setLocaleIndex( const int& index )
|
||||
{
|
||||
if(index == m_localeIndex || index > CalamaresUtils::Locale::availableTranslations()->rowCount(QModelIndex()) || index < 0)
|
||||
if ( index == m_localeIndex || index > CalamaresUtils::Locale::availableTranslations()->rowCount( QModelIndex() )
|
||||
|| index < 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_localeIndex = index;
|
||||
|
||||
@ -189,8 +193,7 @@ Config::setLocaleIndex(const int& index)
|
||||
cDebug() << "Selected locale" << selectedLocale;
|
||||
|
||||
QLocale::setDefault( selectedLocale );
|
||||
CalamaresUtils::installTranslator(
|
||||
selectedLocale, Calamares::Branding::instance()->translationsDirectory(), qApp );
|
||||
CalamaresUtils::installTranslator( selectedLocale, Calamares::Branding::instance()->translationsDirectory(), qApp );
|
||||
|
||||
emit localeIndexChanged( m_localeIndex );
|
||||
}
|
||||
@ -278,8 +281,8 @@ RequirementsModel::retranslate()
|
||||
"requirements for installing %1.<br/>"
|
||||
"Installation cannot continue. "
|
||||
"<a href=\"#details\">Details...</a>" );
|
||||
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
message = setup ? tr( "This computer does not satisfy some of the "
|
||||
"recommended requirements for setting up %1.<br/>"
|
||||
@ -292,7 +295,8 @@ RequirementsModel::retranslate()
|
||||
}
|
||||
|
||||
m_warningMessage = message.arg( *Calamares::Branding::ShortVersionedName );
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
m_warningMessage = tr( "This program will ask you some questions and "
|
||||
"set up %2 on your computer." )
|
||||
@ -322,4 +326,3 @@ Config::genericWelcomeMessage()
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
|
@ -19,9 +19,9 @@
|
||||
#ifndef WELCOME_CONFIG_H
|
||||
#define WELCOME_CONFIG_H
|
||||
|
||||
#include "modulesystem/Requirement.h"
|
||||
#include <QObject>
|
||||
#include <QUrl>
|
||||
#include "modulesystem/Requirement.h"
|
||||
|
||||
#include "locale/LabelModel.h"
|
||||
|
||||
@ -45,37 +45,26 @@ public:
|
||||
HasDetails
|
||||
};
|
||||
|
||||
bool satisfiedRequirements() const
|
||||
{
|
||||
return m_satisfiedRequirements;
|
||||
}
|
||||
bool satisfiedRequirements() const { return m_satisfiedRequirements; }
|
||||
|
||||
bool satisfiedMandatory() const
|
||||
{
|
||||
return m_satisfiedMandatory;
|
||||
}
|
||||
bool satisfiedMandatory() const { return m_satisfiedMandatory; }
|
||||
|
||||
const Calamares::RequirementEntry& getEntry( const int& index ) const
|
||||
{
|
||||
|
||||
if ( index > count() || index < 0 )
|
||||
{
|
||||
return *( new Calamares::RequirementEntry() );
|
||||
}
|
||||
|
||||
return m_requirements.at( index );
|
||||
|
||||
}
|
||||
|
||||
void setRequirementsList( const Calamares::RequirementsList& requirements );
|
||||
int rowCount( const QModelIndex& ) const override;
|
||||
int count() const
|
||||
{
|
||||
return m_requirements.count();
|
||||
}
|
||||
int count() const { return m_requirements.count(); }
|
||||
|
||||
QString warningMessage() const
|
||||
{
|
||||
return m_warningMessage;
|
||||
}
|
||||
QString warningMessage() const { return m_warningMessage; }
|
||||
|
||||
void retranslate();
|
||||
|
||||
@ -175,7 +164,6 @@ signals:
|
||||
void knownIssuesUrlChanged();
|
||||
void releaseNotesUrlChanged();
|
||||
void donateUrlChanged();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -25,9 +25,9 @@
|
||||
|
||||
#include "Branding.h"
|
||||
#include "CalamaresVersion.h"
|
||||
#include "Config.h"
|
||||
#include "Settings.h"
|
||||
#include "ViewManager.h"
|
||||
#include "Config.h"
|
||||
|
||||
#include "locale/LabelModel.h"
|
||||
#include "modulesystem/ModuleManager.h"
|
||||
@ -84,7 +84,8 @@ WelcomePage::WelcomePage( Config *conf, QWidget* parent )
|
||||
ui->verticalLayout->insertWidget( welcome_text_idx + 1, m_checkingWidget );
|
||||
}
|
||||
|
||||
void WelcomePage::init()
|
||||
void
|
||||
WelcomePage::init()
|
||||
{
|
||||
//setup the url buttons
|
||||
setupButton( WelcomePage::Button::Support, m_conf->supportUrl() );
|
||||
@ -113,7 +114,9 @@ WelcomePage::initLanguages()
|
||||
ui->languageWidget->setCurrentIndex( m_conf->localeIndex() );
|
||||
|
||||
connect( ui->languageWidget,
|
||||
static_cast< void ( QComboBox::* )( int ) >( &QComboBox::currentIndexChanged ), m_conf, &Config::setLocaleIndex );
|
||||
static_cast< void ( QComboBox::* )( int ) >( &QComboBox::currentIndexChanged ),
|
||||
m_conf,
|
||||
&Config::setLocaleIndex );
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -145,8 +145,10 @@ WelcomeViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
using Calamares::Branding;
|
||||
|
||||
m_conf->setSupportUrl( jobOrBrandingSetting( Branding::SupportUrl, configurationMap, "showSupportUrl" ) );
|
||||
m_conf->setKnownIssuesUrl( jobOrBrandingSetting( Branding::KnownIssuesUrl, configurationMap, "showKnownIssuesUrl" ) );
|
||||
m_conf->setReleaseNotesUrl( jobOrBrandingSetting( Branding::ReleaseNotesUrl, configurationMap, "showReleaseNotesUrl" ) );
|
||||
m_conf->setKnownIssuesUrl(
|
||||
jobOrBrandingSetting( Branding::KnownIssuesUrl, configurationMap, "showKnownIssuesUrl" ) );
|
||||
m_conf->setReleaseNotesUrl(
|
||||
jobOrBrandingSetting( Branding::ReleaseNotesUrl, configurationMap, "showReleaseNotesUrl" ) );
|
||||
m_conf->setDonateUrl( CalamaresUtils::getString( configurationMap, "showDonateUrl" ) );
|
||||
|
||||
if ( configurationMap.contains( "requirements" )
|
||||
|
Loading…
Reference in New Issue
Block a user