[welcome] Chase Branding API change

main
Adriaan de Groot 5 years ago
parent 0046c3f161
commit 70054e5db4

@ -41,7 +41,7 @@ Config::Config( QObject* parent )
void
Config::retranslate()
{
m_genericWelcomeMessage = genericWelcomeMessage().arg( *Calamares::Branding::VersionedName );
m_genericWelcomeMessage = genericWelcomeMessage().arg( Calamares::Branding::instance()->versionedName() );
emit genericWelcomeMessageChanged( m_genericWelcomeMessage );
if ( !m_requirementsModel->satisfiedRequirements() )
@ -72,13 +72,13 @@ Config::retranslate()
"might be disabled." );
}
m_warningMessage = message.arg( *Calamares::Branding::ShortVersionedName );
m_warningMessage = message.arg( Calamares::Branding::instance()->shortVersionedName() );
}
else
{
m_warningMessage = tr( "This program will ask you some questions and "
"set up %2 on your computer." )
.arg( *Calamares::Branding::ProductName );
.arg( Calamares::Branding::instance()->productName() );
}
emit warningMessageChanged( m_warningMessage );
@ -103,7 +103,7 @@ Config::initLanguages()
QLocale defaultLocale = QLocale( QLocale::system().name() );
cDebug() << "Matching locale" << defaultLocale;
int matchedLocaleIndex = m_languages->find( [&]( const QLocale& x ) {
int matchedLocaleIndex = m_languages->find( [ & ]( const QLocale& x ) {
return x.language() == defaultLocale.language() && x.country() == defaultLocale.country();
} );
@ -112,7 +112,7 @@ Config::initLanguages()
cDebug() << Logger::SubEntry << "Matching approximate locale" << defaultLocale.language();
matchedLocaleIndex
= m_languages->find( [&]( const QLocale& x ) { return x.language() == defaultLocale.language(); } );
= m_languages->find( [ & ]( const QLocale& x ) { return x.language() == defaultLocale.language(); } );
}
if ( matchedLocaleIndex < 0 )

@ -56,9 +56,7 @@ WelcomePage::WelcomePage( Config* conf, QWidget* parent )
const int defaultFontHeight = CalamaresUtils::defaultFontHeight();
ui->setupUi( this );
ui->aboutButton->setIcon( CalamaresUtils::defaultPixmap(
CalamaresUtils::Information,
CalamaresUtils::Original,
2 * QSize( defaultFontHeight, defaultFontHeight ) ) );
CalamaresUtils::Information, CalamaresUtils::Original, 2 * QSize( defaultFontHeight, defaultFontHeight ) ) );
// insert system-check widget below welcome text
const int welcome_text_idx = ui->verticalLayout->indexOf( ui->mainText );
@ -85,8 +83,6 @@ WelcomePage::WelcomePage( Config* conf, QWidget* parent )
initLanguages();
cDebug() << "Welcome string" << Calamares::Branding::instance()->welcomeStyleCalamares()
<< *Calamares::Branding::VersionedName;
CALAMARES_RETRANSLATE_SLOT( &WelcomePage::retranslate )
connect( ui->aboutButton, &QPushButton::clicked, this, &WelcomePage::showAboutBox );
@ -177,7 +173,7 @@ WelcomePage::setupButton( Button role, const QString& url )
{
auto size = 2 * QSize( CalamaresUtils::defaultFontHeight(), CalamaresUtils::defaultFontHeight() );
button->setIcon( CalamaresUtils::defaultPixmap( icon, CalamaresUtils::Original, size ) );
connect( button, &QPushButton::clicked, [u]() { QDesktopServices::openUrl( u ); } );
connect( button, &QPushButton::clicked, [ u ]() { QDesktopServices::openUrl( u ); } );
}
else
{
@ -235,9 +231,9 @@ WelcomePage::retranslate()
: tr( "<h1>Welcome to the %1 installer.</h1>" );
}
ui->mainText->setText( message.arg( *Calamares::Branding::VersionedName ) );
ui->mainText->setText( message.arg( Calamares::Branding::instance()->versionedName() ) );
ui->retranslateUi( this );
ui->supportButton->setText( tr( "%1 support" ).arg( *Calamares::Branding::ShortProductName ) );
ui->supportButton->setText( tr( "%1 support" ).arg( Calamares::Branding::instance()->shortProductName() ) );
}
void
@ -261,7 +257,7 @@ WelcomePage::showAboutBox()
"Liberating Software." )
.arg( CALAMARES_APPLICATION_NAME )
.arg( CALAMARES_VERSION )
.arg( *Calamares::Branding::VersionedName ),
.arg( Calamares::Branding::instance()->versionedName() ),
QMessageBox::Ok,
this );
mb.setIconPixmap( CalamaresUtils::defaultPixmap(

@ -129,7 +129,7 @@ jobOrBrandingSetting( Calamares::Branding::StringEntry e, const QVariantMap& map
auto v = map.value( key );
if ( v.type() == QVariant::Bool )
{
return v.toBool() ? ( *e ) : QString();
return v.toBool() ? ( Calamares::Branding::instance()->string( e ) ) : QString();
}
if ( v.type() == QVariant::String )
{
@ -174,7 +174,7 @@ WelcomeViewStep::setConfigurationMap( const QVariantMap& configurationMap )
if ( handler->type() != CalamaresUtils::GeoIP::Handler::Type::None )
{
auto* future = new FWString();
connect( future, &FWString::finished, [view = this, f = future, h = handler]() {
connect( future, &FWString::finished, [ view = this, f = future, h = handler ]() {
QString countryResult = f->future().result();
cDebug() << "GeoIP result for welcome=" << countryResult;
view->setCountry( countryResult, h );

@ -278,13 +278,13 @@ ResultsListWidget::retranslate()
"Installation can continue, but some features "
"might be disabled." );
}
m_explanation->setText( message.arg( *Calamares::Branding::ShortVersionedName ) );
m_explanation->setText( message.arg( Calamares::Branding::instance()->shortVersionedName() ) );
}
else
{
m_explanation->setText( tr( "This program will ask you some questions and "
"set up %2 on your computer." )
.arg( *Calamares::Branding::ProductName ) );
.arg( Calamares::Branding::instance()->productName() ) );
}
}

@ -120,7 +120,7 @@ jobOrBrandingSetting( Calamares::Branding::StringEntry e, const QVariantMap& map
auto v = map.value( key );
if ( v.type() == QVariant::Bool )
{
return v.toBool() ? ( *e ) : QString();
return v.toBool() ? ( Calamares::Branding::instance()->string( e ) ) : QString();
}
if ( v.type() == QVariant::String )
{

Loading…
Cancel
Save