Merge branch 'remove-star'

Branding API too clever by half. Make it simpler.
main
Adriaan de Groot 5 years ago
commit e023adc9b2

@ -277,9 +277,10 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
setWindowFlag( Qt::WindowCloseButtonHint, false ); setWindowFlag( Qt::WindowCloseButtonHint, false );
} }
CALAMARES_RETRANSLATE( setWindowTitle( Calamares::Settings::instance()->isSetupMode() CALAMARES_RETRANSLATE( const auto* branding = Calamares::Branding::instance();
? tr( "%1 Setup Program" ).arg( *Calamares::Branding::ProductName ) setWindowTitle( Calamares::Settings::instance()->isSetupMode()
: tr( "%1 Installer" ).arg( *Calamares::Branding::ProductName ) ); ) ? tr( "%1 Setup Program" ).arg( branding->productName() )
: tr( "%1 Installer" ).arg( branding->productName() ) ); )
const Calamares::Branding* const branding = Calamares::Branding::instance(); const Calamares::Branding* const branding = Calamares::Branding::instance();
using ImageEntry = Calamares::Branding::ImageEntry; using ImageEntry = Calamares::Branding::ImageEntry;

@ -209,6 +209,11 @@ public:
public slots: public slots:
QString string( StringEntry stringEntry ) const; QString string( StringEntry stringEntry ) const;
QString versionedName() const { return string( VersionedName ); }
QString productName() const { return string( ProductName ); }
QString shortProductName() const { return string( ShortProductName ); }
QString shortVersionedName() const { return string( ShortVersionedName ); }
QString styleString( StyleEntry styleEntry ) const; QString styleString( StyleEntry styleEntry ) const;
QString imagePath( ImageEntry imageEntry ) const; QString imagePath( ImageEntry imageEntry ) const;
@ -249,13 +254,6 @@ private:
PanelSide m_navigationSide = PanelSide::Bottom; PanelSide m_navigationSide = PanelSide::Bottom;
}; };
template < typename U >
inline QString
operator*( U e )
{
return Branding::instance()->string( e );
}
} // namespace Calamares } // namespace Calamares
#endif // BRANDING_H #endif // BRANDING_H

@ -226,7 +226,9 @@ ViewManager::onInitFailed( const QStringList& modules )
detailString = details.join( QString() ); detailString = details.join( QString() );
} }
insertViewStep( 0, new BlankViewStep( title, description.arg( *Calamares::Branding::ProductName ), detailString ) ); insertViewStep(
0,
new BlankViewStep( title, description.arg( Calamares::Branding::instance()->productName() ), detailString ) );
} }
void void
@ -335,10 +337,11 @@ ViewManager::next()
"to undo these changes.</strong>" ); "to undo these changes.</strong>" );
QString confirm = settings->isSetupMode() ? tr( "&Set up now" ) : tr( "&Install now" ); QString confirm = settings->isSetupMode() ? tr( "&Set up now" ) : tr( "&Install now" );
int reply = QMessageBox::question( const auto* branding = Calamares::Branding::instance();
m_widget, int reply
= QMessageBox::question( m_widget,
title, title,
question.arg( *Calamares::Branding::ShortProductName, *Calamares::Branding::ShortVersionedName ), question.arg( branding->shortProductName(), branding->shortVersionedName() ),
confirm, confirm,
tr( "Go &back" ), tr( "Go &back" ),
QString(), QString(),

@ -20,12 +20,12 @@
#include "FinishedPage.h" #include "FinishedPage.h"
#include "ui_FinishedPage.h"
#include "CalamaresVersion.h" #include "CalamaresVersion.h"
#include "utils/Logger.h" #include "ViewManager.h"
#include "ui_FinishedPage.h"
#include "utils/CalamaresUtilsGui.h" #include "utils/CalamaresUtilsGui.h"
#include "utils/Logger.h"
#include "utils/Retranslator.h" #include "utils/Retranslator.h"
#include "ViewManager.h"
#include <QApplication> #include <QApplication>
#include <QBoxLayout> #include <QBoxLayout>
@ -48,33 +48,29 @@ FinishedPage::FinishedPage( QWidget* parent )
ui->mainText->setOpenExternalLinks( true ); ui->mainText->setOpenExternalLinks( true );
CALAMARES_RETRANSLATE( CALAMARES_RETRANSLATE(
ui->retranslateUi( this ); const auto* branding = Calamares::Branding::instance(); ui->retranslateUi( this );
if ( Calamares::Settings::instance()->isSetupMode() ) if ( Calamares::Settings::instance()->isSetupMode() ) {
{
ui->mainText->setText( tr( "<h1>All done.</h1><br/>" ui->mainText->setText( tr( "<h1>All done.</h1><br/>"
"%1 has been set up on your computer.<br/>" "%1 has been set up on your computer.<br/>"
"You may now start using your new system." ) "You may now start using your new system." )
.arg( *Calamares::Branding::VersionedName ) ); .arg( branding->versionedName() ) );
ui->restartCheckBox->setToolTip( tr ( "<html><head/><body>" ui->restartCheckBox->setToolTip( tr( "<html><head/><body>"
"<p>When this box is checked, your system will " "<p>When this box is checked, your system will "
"restart immediately when you click on " "restart immediately when you click on "
"<span style=\"font-style:italic;\">Done</span> " "<span style=\"font-style:italic;\">Done</span> "
"or close the setup program.</p></body></html>" ) ); "or close the setup program.</p></body></html>" ) );
} } else {
else
{
ui->mainText->setText( tr( "<h1>All done.</h1><br/>" ui->mainText->setText( tr( "<h1>All done.</h1><br/>"
"%1 has been installed on your computer.<br/>" "%1 has been installed on your computer.<br/>"
"You may now restart into your new system, or continue " "You may now restart into your new system, or continue "
"using the %2 Live environment." ) "using the %2 Live environment." )
.arg( *Calamares::Branding::VersionedName, *Calamares::Branding::ProductName ) ); .arg( branding->versionedName(), branding->productName() ) );
ui->restartCheckBox->setToolTip( tr ( "<html><head/><body>" ui->restartCheckBox->setToolTip( tr( "<html><head/><body>"
"<p>When this box is checked, your system will " "<p>When this box is checked, your system will "
"restart immediately when you click on " "restart immediately when you click on "
"<span style=\"font-style:italic;\">Done</span> " "<span style=\"font-style:italic;\">Done</span> "
"or close the installer.</p></body></html>" ) ); "or close the installer.</p></body></html>" ) );
} } )
)
} }
@ -102,20 +98,15 @@ void
FinishedPage::setUpRestart() FinishedPage::setUpRestart()
{ {
cDebug() << "FinishedPage::setUpRestart(), Quit button" cDebug() << "FinishedPage::setUpRestart(), Quit button"
<< "setup=" << FinishedViewStep::modeName( m_mode ) << "setup=" << FinishedViewStep::modeName( m_mode ) << "command=" << m_restartNowCommand;
<< "command=" << m_restartNowCommand;
connect( qApp, &QApplication::aboutToQuit, connect( qApp, &QApplication::aboutToQuit, [ this ]() {
[this]() if ( ui->restartCheckBox->isVisible() && ui->restartCheckBox->isChecked() )
{
if ( ui->restartCheckBox->isVisible() &&
ui->restartCheckBox->isChecked() )
{ {
cDebug() << "Running restart command" << m_restartNowCommand; cDebug() << "Running restart command" << m_restartNowCommand;
QProcess::execute( "/bin/sh", { "-c", m_restartNowCommand } ); QProcess::execute( "/bin/sh", { "-c", m_restartNowCommand } );
} }
} } );
);
} }
@ -128,18 +119,19 @@ FinishedPage::focusInEvent( QFocusEvent* e )
void void
FinishedPage::onInstallationFailed( const QString& message, const QString& details ) FinishedPage::onInstallationFailed( const QString& message, const QString& details )
{ {
const auto* branding = Calamares::Branding::instance();
Q_UNUSED( details ) Q_UNUSED( details )
if ( Calamares::Settings::instance()->isSetupMode() ) if ( Calamares::Settings::instance()->isSetupMode() )
ui->mainText->setText( tr( "<h1>Setup Failed</h1><br/>" ui->mainText->setText( tr( "<h1>Setup Failed</h1><br/>"
"%1 has not been set up on your computer.<br/>" "%1 has not been set up on your computer.<br/>"
"The error message was: %2." ) "The error message was: %2." )
.arg( *Calamares::Branding::VersionedName ) .arg( branding->versionedName() )
.arg( message ) ); .arg( message ) );
else else
ui->mainText->setText( tr( "<h1>Installation Failed</h1><br/>" ui->mainText->setText( tr( "<h1>Installation Failed</h1><br/>"
"%1 has not been installed on your computer.<br/>" "%1 has not been installed on your computer.<br/>"
"The error message was: %2." ) "The error message was: %2." )
.arg( *Calamares::Branding::VersionedName ) .arg( branding->versionedName() )
.arg( message ) ); .arg( message ) );
setRestart( FinishedViewStep::RestartMode::Never ); setRestart( FinishedViewStep::RestartMode::Never );
} }

@ -29,22 +29,20 @@
#include "utils/NamedEnum.h" #include "utils/NamedEnum.h"
#include "utils/Variant.h" #include "utils/Variant.h"
#include <QVariantMap>
#include <QtDBus/QDBusConnection> #include <QtDBus/QDBusConnection>
#include <QtDBus/QDBusInterface> #include <QtDBus/QDBusInterface>
#include <QtDBus/QDBusReply> #include <QtDBus/QDBusReply>
#include <QVariantMap>
static const NamedEnumTable< FinishedViewStep::RestartMode >& static const NamedEnumTable< FinishedViewStep::RestartMode >&
modeNames() modeNames()
{ {
using Mode = FinishedViewStep::RestartMode; using Mode = FinishedViewStep::RestartMode;
static const NamedEnumTable< Mode > names{ static const NamedEnumTable< Mode > names { { QStringLiteral( "never" ), Mode::Never },
{ QStringLiteral( "never" ), Mode::Never },
{ QStringLiteral( "user-unchecked" ), Mode::UserUnchecked }, { QStringLiteral( "user-unchecked" ), Mode::UserUnchecked },
{ QStringLiteral( "user-checked" ), Mode::UserChecked }, { QStringLiteral( "user-checked" ), Mode::UserChecked },
{ QStringLiteral( "always" ), Mode::Always } { QStringLiteral( "always" ), Mode::Always } };
} ;
return names; return names;
} }
@ -56,10 +54,8 @@ FinishedViewStep::FinishedViewStep( QObject* parent )
, m_notifyOnFinished( false ) , m_notifyOnFinished( false )
{ {
auto jq = Calamares::JobQueue::instance(); auto jq = Calamares::JobQueue::instance();
connect( jq, &Calamares::JobQueue::failed, connect( jq, &Calamares::JobQueue::failed, m_widget, &FinishedPage::onInstallationFailed );
m_widget, &FinishedPage::onInstallationFailed ); connect( jq, &Calamares::JobQueue::failed, this, &FinishedViewStep::onInstallationFailed );
connect( jq, &Calamares::JobQueue::failed,
this, &FinishedViewStep::onInstallationFailed );
emit nextStatusChanged( true ); emit nextStatusChanged( true );
} }
@ -68,7 +64,9 @@ FinishedViewStep::FinishedViewStep( QObject* parent )
FinishedViewStep::~FinishedViewStep() FinishedViewStep::~FinishedViewStep()
{ {
if ( m_widget && m_widget->parent() == nullptr ) if ( m_widget && m_widget->parent() == nullptr )
{
m_widget->deleteLater(); m_widget->deleteLater();
}
} }
@ -119,30 +117,36 @@ FinishedViewStep::sendNotification()
// If the installation failed, don't send notification popup; // If the installation failed, don't send notification popup;
// there's a (modal) dialog popped up with the failure notice. // there's a (modal) dialog popped up with the failure notice.
if ( installFailed ) if ( installFailed )
{
return; return;
}
QDBusInterface notify( "org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications" ); QDBusInterface notify(
"org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications" );
if ( notify.isValid() ) if ( notify.isValid() )
{ {
QDBusReply<uint> r = notify.call( "Notify", const auto* branding = Calamares::Branding::instance();
QDBusReply< uint > r = notify.call(
"Notify",
QString( "Calamares" ), QString( "Calamares" ),
QVariant( 0U ), QVariant( 0U ),
QString( "calamares" ), QString( "calamares" ),
Calamares::Settings::instance()->isSetupMode() ? tr( "Setup Complete" ) : tr( "Installation Complete" ),
Calamares::Settings::instance()->isSetupMode() Calamares::Settings::instance()->isSetupMode()
? tr( "Setup Complete" ) ? tr( "The setup of %1 is complete." ).arg( branding->versionedName() )
: tr( "Installation Complete" ), : tr( "The installation of %1 is complete." ).arg( branding->versionedName() ),
Calamares::Settings::instance()->isSetupMode()
? tr( "The setup of %1 is complete." ).arg( *Calamares::Branding::VersionedName )
: tr( "The installation of %1 is complete." ).arg( *Calamares::Branding::VersionedName ),
QStringList(), QStringList(),
QVariantMap(), QVariantMap(),
QVariant( 0 ) QVariant( 0 ) );
);
if ( !r.isValid() ) if ( !r.isValid() )
{
cWarning() << "Could not call org.freedesktop.Notifications.Notify at end of installation." << r.error(); cWarning() << "Could not call org.freedesktop.Notifications.Notify at end of installation." << r.error();
} }
}
else else
{
cWarning() << "Could not get dbus interface for notifications at end of installation." << notify.lastError(); cWarning() << "Could not get dbus interface for notifications at end of installation." << notify.lastError();
}
} }
@ -152,7 +156,9 @@ FinishedViewStep::onActivate()
m_widget->setUpRestart(); m_widget->setUpRestart();
if ( m_notifyOnFinished ) if ( m_notifyOnFinished )
{
sendNotification(); sendNotification();
}
} }
@ -179,23 +185,31 @@ FinishedViewStep::setConfigurationMap( const QVariantMap& configurationMap )
if ( restartMode.isEmpty() ) if ( restartMode.isEmpty() )
{ {
if ( configurationMap.contains( "restartNowEnabled" ) ) if ( configurationMap.contains( "restartNowEnabled" ) )
{
cWarning() << "Configuring the finished module with deprecated restartNowEnabled settings"; cWarning() << "Configuring the finished module with deprecated restartNowEnabled settings";
}
bool restartNowEnabled = CalamaresUtils::getBool( configurationMap, "restartNowEnabled", false ); bool restartNowEnabled = CalamaresUtils::getBool( configurationMap, "restartNowEnabled", false );
bool restartNowChecked = CalamaresUtils::getBool( configurationMap, "restartNowChecked", false ); bool restartNowChecked = CalamaresUtils::getBool( configurationMap, "restartNowChecked", false );
if ( !restartNowEnabled ) if ( !restartNowEnabled )
{
mode = RestartMode::Never; mode = RestartMode::Never;
}
else else
{
mode = restartNowChecked ? RestartMode::UserChecked : RestartMode::UserUnchecked; mode = restartNowChecked ? RestartMode::UserChecked : RestartMode::UserUnchecked;
} }
}
else else
{ {
bool ok = false; bool ok = false;
mode = modeNames().find( restartMode, ok ); mode = modeNames().find( restartMode, ok );
if ( !ok ) if ( !ok )
{
cWarning() << "Configuring the finished module with bad restartNowMode" << restartMode; cWarning() << "Configuring the finished module with bad restartNowMode" << restartMode;
} }
}
m_widget->setRestart( mode ); m_widget->setRestart( mode );
@ -203,18 +217,21 @@ FinishedViewStep::setConfigurationMap( const QVariantMap& configurationMap )
{ {
QString restartNowCommand = CalamaresUtils::getString( configurationMap, "restartNowCommand" ); QString restartNowCommand = CalamaresUtils::getString( configurationMap, "restartNowCommand" );
if ( restartNowCommand.isEmpty() ) if ( restartNowCommand.isEmpty() )
{
restartNowCommand = QStringLiteral( "shutdown -r now" ); restartNowCommand = QStringLiteral( "shutdown -r now" );
}
m_widget->setRestartNowCommand( restartNowCommand ); m_widget->setRestartNowCommand( restartNowCommand );
} }
m_notifyOnFinished = CalamaresUtils::getBool( configurationMap, "notifyOnFinished", false ); m_notifyOnFinished = CalamaresUtils::getBool( configurationMap, "notifyOnFinished", false );
} }
QString FinishedViewStep::modeName(FinishedViewStep::RestartMode m) QString
FinishedViewStep::modeName( FinishedViewStep::RestartMode m )
{ {
bool ok = false; bool ok = false;
return modeNames().find( m, ok ); // May be QString() return modeNames().find( m, ok ); // May be QString()
} }
CALAMARES_PLUGIN_FACTORY_DEFINITION( FinishedViewStepFactory, registerPlugin<FinishedViewStep>(); ) CALAMARES_PLUGIN_FACTORY_DEFINITION( FinishedViewStepFactory, registerPlugin< FinishedViewStep >(); )

@ -36,7 +36,7 @@ class PLUGINDLLEXPORT FinishedViewStep : public Calamares::ViewStep
public: public:
enum class RestartMode enum class RestartMode
{ {
Never=0, ///< @brief Don't show button, just exit Never = 0, ///< @brief Don't show button, just exit
UserUnchecked, ///< @brief Show button, starts unchecked UserUnchecked, ///< @brief Show button, starts unchecked
UserChecked, ///< @brief Show button, starts checked UserChecked, ///< @brief Show button, starts checked
Always ///< @brief Show button, can't change, checked Always ///< @brief Show button, can't change, checked

@ -832,7 +832,7 @@ ChoicePage::doReplaceSelectedPartition( const QModelIndex& current )
if ( !homePartitionPath->isEmpty() ) if ( !homePartitionPath->isEmpty() )
m_reuseHomeCheckBox->setText( tr( "Reuse %1 as home partition for %2." ) m_reuseHomeCheckBox->setText( tr( "Reuse %1 as home partition for %2." )
.arg( *homePartitionPath ) .arg( *homePartitionPath )
.arg( *Calamares::Branding::ShortProductName ) ); .arg( Calamares::Branding::instance()->shortProductName() ) );
delete homePartitionPath; delete homePartitionPath;
if ( m_isEfi ) if ( m_isEfi )
@ -975,7 +975,7 @@ ChoicePage::updateActionChoicePreview( ChoicePage::InstallChoice choice )
.arg( m_beforePartitionBarsView->selectionModel()->currentIndex().data().toString() ) .arg( m_beforePartitionBarsView->selectionModel()->currentIndex().data().toString() )
.arg( CalamaresUtils::BytesToMiB( size ) ) .arg( CalamaresUtils::BytesToMiB( size ) )
.arg( CalamaresUtils::BytesToMiB( sizeNext ) ) .arg( CalamaresUtils::BytesToMiB( sizeNext ) )
.arg( *Calamares::Branding::ShortProductName ) ); .arg( Calamares::Branding::instance()->shortProductName() ) );
} }
); );
@ -1004,7 +1004,7 @@ ChoicePage::updateActionChoicePreview( ChoicePage::InstallChoice choice )
m_afterPartitionBarsView->setNestedPartitionsMode( mode ); m_afterPartitionBarsView->setNestedPartitionsMode( mode );
m_afterPartitionLabelsView = new PartitionLabelsView( m_previewAfterFrame ); m_afterPartitionLabelsView = new PartitionLabelsView( m_previewAfterFrame );
m_afterPartitionLabelsView->setExtendedPartitionHidden( mode == PartitionBarsView::NoNestedPartitions ); m_afterPartitionLabelsView->setExtendedPartitionHidden( mode == PartitionBarsView::NoNestedPartitions );
m_afterPartitionLabelsView->setCustomNewRootLabel( *Calamares::Branding::BootloaderEntryName ); m_afterPartitionLabelsView->setCustomNewRootLabel( Calamares::Branding::instance()->string(Calamares::Branding::BootloaderEntryName) );
PartitionModel* model = m_core->partitionModelForDevice( selectedDevice() ); PartitionModel* model = m_core->partitionModelForDevice( selectedDevice() );
@ -1135,7 +1135,7 @@ ChoicePage::setupEfiSystemPartitionSelector()
tr( "An EFI system partition cannot be found anywhere " tr( "An EFI system partition cannot be found anywhere "
"on this system. Please go back and use manual " "on this system. Please go back and use manual "
"partitioning to set up %1." ) "partitioning to set up %1." )
.arg( *Calamares::Branding::ShortProductName ) ); .arg( Calamares::Branding::instance()->shortProductName() ) );
updateNextEnabled(); updateNextEnabled();
} }
else if ( efiSystemPartitions.count() == 1 ) //probably most usual situation else if ( efiSystemPartitions.count() == 1 ) //probably most usual situation
@ -1144,7 +1144,7 @@ ChoicePage::setupEfiSystemPartitionSelector()
tr( "The EFI system partition at %1 will be used for " tr( "The EFI system partition at %1 will be used for "
"starting %2." ) "starting %2." )
.arg( efiSystemPartitions.first()->partitionPath() ) .arg( efiSystemPartitions.first()->partitionPath() )
.arg( *Calamares::Branding::ShortProductName ) ); .arg( Calamares::Branding::instance()->shortProductName() ) );
} }
else else
{ {
@ -1278,11 +1278,11 @@ ChoicePage::setupActions()
m_alongsideButton->setText( tr( "<strong>Install alongside</strong><br/>" m_alongsideButton->setText( tr( "<strong>Install alongside</strong><br/>"
"The installer will shrink a partition to make room for %1." ) "The installer will shrink a partition to make room for %1." )
.arg( *Calamares::Branding::ShortVersionedName ) ); .arg( Calamares::Branding::instance()->shortVersionedName() ) );
m_replaceButton->setText( tr( "<strong>Replace a partition</strong><br/>" m_replaceButton->setText( tr( "<strong>Replace a partition</strong><br/>"
"Replaces a partition with %1." ) "Replaces a partition with %1." )
.arg( *Calamares::Branding::ShortVersionedName ) ); .arg( Calamares::Branding::instance()->shortVersionedName() ) );
) )
m_replaceButton->hide(); m_replaceButton->hide();
@ -1308,7 +1308,7 @@ ChoicePage::setupActions()
m_alongsideButton->setText( tr( "<strong>Install alongside</strong><br/>" m_alongsideButton->setText( tr( "<strong>Install alongside</strong><br/>"
"The installer will shrink a partition to make room for %1." ) "The installer will shrink a partition to make room for %1." )
.arg( *Calamares::Branding::ShortVersionedName ) ); .arg( Calamares::Branding::instance()->shortVersionedName() ) );
m_eraseButton->setText( tr( "<strong>Erase disk</strong><br/>" m_eraseButton->setText( tr( "<strong>Erase disk</strong><br/>"
"This will <font color=\"red\">delete</font> all data " "This will <font color=\"red\">delete</font> all data "
@ -1317,7 +1317,7 @@ ChoicePage::setupActions()
m_replaceButton->setText( tr( "<strong>Replace a partition</strong><br/>" m_replaceButton->setText( tr( "<strong>Replace a partition</strong><br/>"
"Replaces a partition with %1." ) "Replaces a partition with %1." )
.arg( *Calamares::Branding::ShortVersionedName ) ); .arg( Calamares::Branding::instance()->shortVersionedName() ) );
) )
} }
else else
@ -1331,7 +1331,7 @@ ChoicePage::setupActions()
m_alongsideButton->setText( tr( "<strong>Install alongside</strong><br/>" m_alongsideButton->setText( tr( "<strong>Install alongside</strong><br/>"
"The installer will shrink a partition to make room for %1." ) "The installer will shrink a partition to make room for %1." )
.arg( *Calamares::Branding::ShortVersionedName ) ); .arg( Calamares::Branding::instance()->shortVersionedName() ) );
m_eraseButton->setText( tr( "<strong>Erase disk</strong><br/>" m_eraseButton->setText( tr( "<strong>Erase disk</strong><br/>"
"This will <font color=\"red\">delete</font> all data " "This will <font color=\"red\">delete</font> all data "
@ -1339,7 +1339,7 @@ ChoicePage::setupActions()
m_replaceButton->setText( tr( "<strong>Replace a partition</strong><br/>" m_replaceButton->setText( tr( "<strong>Replace a partition</strong><br/>"
"Replaces a partition with %1." ) "Replaces a partition with %1." )
.arg( *Calamares::Branding::ShortVersionedName ) ); .arg( Calamares::Branding::instance()->shortVersionedName() ) );
) )
} }
} }
@ -1357,7 +1357,7 @@ ChoicePage::setupActions()
m_alongsideButton->setText( tr( "<strong>Install alongside</strong><br/>" m_alongsideButton->setText( tr( "<strong>Install alongside</strong><br/>"
"The installer will shrink a partition to make room for %1." ) "The installer will shrink a partition to make room for %1." )
.arg( *Calamares::Branding::ShortVersionedName ) ); .arg( Calamares::Branding::instance()->shortVersionedName() ) );
m_eraseButton->setText( tr( "<strong>Erase disk</strong><br/>" m_eraseButton->setText( tr( "<strong>Erase disk</strong><br/>"
"This will <font color=\"red\">delete</font> all data " "This will <font color=\"red\">delete</font> all data "
@ -1365,7 +1365,7 @@ ChoicePage::setupActions()
m_replaceButton->setText( tr( "<strong>Replace a partition</strong><br/>" m_replaceButton->setText( tr( "<strong>Replace a partition</strong><br/>"
"Replaces a partition with %1." ) "Replaces a partition with %1." )
.arg( *Calamares::Branding::ShortVersionedName ) ); .arg( Calamares::Branding::instance()->shortVersionedName() ) );
) )
} }

@ -154,6 +154,7 @@ PartitionViewStep::createSummaryWidget() const
formLayout->setContentsMargins( MARGIN, 0, MARGIN, MARGIN ); formLayout->setContentsMargins( MARGIN, 0, MARGIN, MARGIN );
mainLayout->addLayout( formLayout ); mainLayout->addLayout( formLayout );
const auto* branding = Calamares::Branding::instance();
QList< PartitionCoreModule::SummaryInfo > list = m_core->createSummaryInfo(); QList< PartitionCoreModule::SummaryInfo > list = m_core->createSummaryInfo();
if ( list.length() > 1 ) // There are changes on more than one disk if ( list.length() > 1 ) // There are changes on more than one disk
{ {
@ -166,15 +167,15 @@ PartitionViewStep::createSummaryWidget() const
{ {
case ChoicePage::Alongside: case ChoicePage::Alongside:
modeText = tr( "Install %1 <strong>alongside</strong> another operating system." ) modeText = tr( "Install %1 <strong>alongside</strong> another operating system." )
.arg( *Calamares::Branding::ShortVersionedName ); .arg( branding->shortVersionedName() );
break; break;
case ChoicePage::Erase: case ChoicePage::Erase:
modeText modeText
= tr( "<strong>Erase</strong> disk and install %1." ).arg( *Calamares::Branding::ShortVersionedName ); = tr( "<strong>Erase</strong> disk and install %1." ).arg( branding->shortVersionedName() );
break; break;
case ChoicePage::Replace: case ChoicePage::Replace:
modeText modeText
= tr( "<strong>Replace</strong> a partition with %1." ).arg( *Calamares::Branding::ShortVersionedName ); = tr( "<strong>Replace</strong> a partition with %1." ).arg( branding->shortVersionedName() );
break; break;
case ChoicePage::NoChoice: case ChoicePage::NoChoice:
case ChoicePage::Manual: case ChoicePage::Manual:
@ -193,19 +194,19 @@ PartitionViewStep::createSummaryWidget() const
case ChoicePage::Alongside: case ChoicePage::Alongside:
modeText = tr( "Install %1 <strong>alongside</strong> another operating system on disk " modeText = tr( "Install %1 <strong>alongside</strong> another operating system on disk "
"<strong>%2</strong> (%3)." ) "<strong>%2</strong> (%3)." )
.arg( *Calamares::Branding::ShortVersionedName ) .arg( branding->shortVersionedName() )
.arg( info.deviceNode ) .arg( info.deviceNode )
.arg( info.deviceName ); .arg( info.deviceName );
break; break;
case ChoicePage::Erase: case ChoicePage::Erase:
modeText = tr( "<strong>Erase</strong> disk <strong>%2</strong> (%3) and install %1." ) modeText = tr( "<strong>Erase</strong> disk <strong>%2</strong> (%3) and install %1." )
.arg( *Calamares::Branding::ShortVersionedName ) .arg( branding->shortVersionedName() )
.arg( info.deviceNode ) .arg( info.deviceNode )
.arg( info.deviceName ); .arg( info.deviceName );
break; break;
case ChoicePage::Replace: case ChoicePage::Replace:
modeText = tr( "<strong>Replace</strong> a partition on disk <strong>%2</strong> (%3) with %1." ) modeText = tr( "<strong>Replace</strong> a partition on disk <strong>%2</strong> (%3) with %1." )
.arg( *Calamares::Branding::ShortVersionedName ) .arg( branding->shortVersionedName() )
.arg( info.deviceNode ) .arg( info.deviceNode )
.arg( info.deviceName ); .arg( info.deviceName );
break; break;
@ -256,7 +257,7 @@ PartitionViewStep::createSummaryWidget() const
previewLabels->setModel( info.partitionModelAfter ); previewLabels->setModel( info.partitionModelAfter );
preview->setSelectionMode( QAbstractItemView::NoSelection ); preview->setSelectionMode( QAbstractItemView::NoSelection );
previewLabels->setSelectionMode( QAbstractItemView::NoSelection ); previewLabels->setSelectionMode( QAbstractItemView::NoSelection );
previewLabels->setCustomNewRootLabel( *Calamares::Branding::BootloaderEntryName ); previewLabels->setCustomNewRootLabel( Calamares::Branding::instance()->string( Calamares::Branding::BootloaderEntryName ));
info.partitionModelAfter->setParent( widget ); info.partitionModelAfter->setParent( widget );
field = new QVBoxLayout; field = new QVBoxLayout;
CalamaresUtils::unmarginLayout( field ); CalamaresUtils::unmarginLayout( field );
@ -411,6 +412,7 @@ PartitionViewStep::onLeave()
return; return;
} }
const auto* branding = Calamares::Branding::instance();
if ( m_widget->currentWidget() == m_manualPartitionPage ) if ( m_widget->currentWidget() == m_manualPartitionPage )
{ {
if ( PartUtils::isEfiSystem() ) if ( PartUtils::isEfiSystem() )
@ -438,7 +440,7 @@ PartitionViewStep::onLeave()
"<strong>%2</strong>.<br/><br/>" "<strong>%2</strong>.<br/><br/>"
"You can continue without setting up an EFI system " "You can continue without setting up an EFI system "
"partition but your system may fail to start." ) "partition but your system may fail to start." )
.arg( *Calamares::Branding::ShortProductName ) .arg( branding->shortProductName() )
.arg( espMountPoint, espFlagName ); .arg( espMountPoint, espFlagName );
} }
else if ( esp && !PartUtils::isEfiBootable( esp ) ) else if ( esp && !PartUtils::isEfiBootable( esp ) )
@ -453,7 +455,7 @@ PartitionViewStep::onLeave()
"<br/><br/>" "<br/><br/>"
"You can continue without setting the flag but your " "You can continue without setting the flag but your "
"system may fail to start." ) "system may fail to start." )
.arg( *Calamares::Branding::ShortProductName ) .arg( branding->shortProductName() )
.arg( espMountPoint, espFlagName ); .arg( espMountPoint, espFlagName );
} }
@ -482,7 +484,7 @@ PartitionViewStep::onLeave()
"<strong>bios_grub</strong> flag enabled.<br/><br/>" "<strong>bios_grub</strong> flag enabled.<br/><br/>"
"An unformatted 8 MB partition is necessary " "An unformatted 8 MB partition is necessary "
"to start %1 on a BIOS system with GPT." ) "to start %1 on a BIOS system with GPT." )
.arg( *Calamares::Branding::ShortProductName ); .arg( branding->shortProductName() );
QMessageBox::information( m_manualPartitionPage, message, description ); QMessageBox::information( m_manualPartitionPage, message, description );
} }

@ -133,13 +133,14 @@ ReplaceWidget::onPartitionSelected()
if ( Calamares::JobQueue::instance()->globalStorage()->value( "firmwareType" ) == "efi" ) if ( Calamares::JobQueue::instance()->globalStorage()->value( "firmwareType" ) == "efi" )
m_isEfi = true; m_isEfi = true;
const auto* branding = Calamares::Branding::instance();
if ( m_ui->partitionTreeView->currentIndex() == QModelIndex() ) if ( m_ui->partitionTreeView->currentIndex() == QModelIndex() )
{ {
updateStatus( CalamaresUtils::PartitionPartition, updateStatus( CalamaresUtils::PartitionPartition,
tr( "Select where to install %1.<br/>" tr( "Select where to install %1.<br/>"
"<font color=\"red\">Warning: </font>this will delete all files " "<font color=\"red\">Warning: </font>this will delete all files "
"on the selected partition." ) "on the selected partition." )
.arg( *Calamares::Branding::VersionedName ) ); .arg( branding->versionedName() ) );
setNextEnabled( false ); setNextEnabled( false );
return; return;
} }
@ -172,7 +173,7 @@ ReplaceWidget::onPartitionSelected()
updateStatus( CalamaresUtils::Fail, updateStatus( CalamaresUtils::Fail,
tr( "%1 cannot be installed on empty space. Please select an " tr( "%1 cannot be installed on empty space. Please select an "
"existing partition." ) "existing partition." )
.arg( *Calamares::Branding::VersionedName ) ); .arg( branding->versionedName() ) );
setNextEnabled( false ); setNextEnabled( false );
return; return;
} }
@ -182,7 +183,7 @@ ReplaceWidget::onPartitionSelected()
updateStatus( CalamaresUtils::Fail, updateStatus( CalamaresUtils::Fail,
tr( "%1 cannot be installed on an extended partition. Please select an " tr( "%1 cannot be installed on an extended partition. Please select an "
"existing primary or logical partition." ) "existing primary or logical partition." )
.arg( *Calamares::Branding::VersionedName ) ); .arg( branding->versionedName() ) );
setNextEnabled( false ); setNextEnabled( false );
return; return;
} }
@ -191,7 +192,7 @@ ReplaceWidget::onPartitionSelected()
{ {
updateStatus( CalamaresUtils::Fail, updateStatus( CalamaresUtils::Fail,
tr( "%1 cannot be installed on this partition." ) tr( "%1 cannot be installed on this partition." )
.arg( *Calamares::Branding::VersionedName ) ); .arg( branding->versionedName() ) );
setNextEnabled( false ); setNextEnabled( false );
return; return;
} }
@ -233,7 +234,7 @@ ReplaceWidget::onPartitionSelected()
"The partition %1 is too small for %2. Please select a partition " "The partition %1 is too small for %2. Please select a partition "
"with capacity at least %3 GiB." ) "with capacity at least %3 GiB." )
.arg( partition->partitionPath() ) .arg( partition->partitionPath() )
.arg( *Calamares::Branding::VersionedName ) .arg( branding->versionedName() )
.arg( requiredSpaceB / ( 1024. * 1024. * 1024. ), .arg( requiredSpaceB / ( 1024. * 1024. * 1024. ),
0, 'f', 1 ) 0, 'f', 1 )
.arg( prettyName ) ); .arg( prettyName ) );
@ -256,7 +257,7 @@ ReplaceWidget::onPartitionSelected()
"An EFI system partition cannot be found anywhere " "An EFI system partition cannot be found anywhere "
"on this system. Please go back and use manual " "on this system. Please go back and use manual "
"partitioning to set up %1." ) "partitioning to set up %1." )
.arg( *Calamares::Branding::ShortProductName ) .arg( branding->shortProductName() )
.arg( prettyName ) ); .arg( prettyName ) );
setNextEnabled( false ); setNextEnabled( false );
} }
@ -267,14 +268,14 @@ ReplaceWidget::onPartitionSelected()
"%1 will be installed on %2.<br/>" "%1 will be installed on %2.<br/>"
"<font color=\"red\">Warning: </font>all data on partition " "<font color=\"red\">Warning: </font>all data on partition "
"%2 will be lost.") "%2 will be lost.")
.arg( *Calamares::Branding::VersionedName ) .arg( branding->versionedName() )
.arg( partition->partitionPath() ) .arg( partition->partitionPath() )
.arg( prettyName ) ); .arg( prettyName ) );
m_ui->bootStatusLabel->show(); m_ui->bootStatusLabel->show();
m_ui->bootStatusLabel->setText( m_ui->bootStatusLabel->setText(
tr( "The EFI system partition at %1 will be used for starting %2." ) tr( "The EFI system partition at %1 will be used for starting %2." )
.arg( efiSystemPartitions.first()->partitionPath() ) .arg( efiSystemPartitions.first()->partitionPath() )
.arg( *Calamares::Branding::ShortProductName ) ); .arg( branding->shortProductName() ) );
setNextEnabled( true ); setNextEnabled( true );
} }
else else
@ -284,7 +285,7 @@ ReplaceWidget::onPartitionSelected()
"%1 will be installed on %2.<br/>" "%1 will be installed on %2.<br/>"
"<font color=\"red\">Warning: </font>all data on partition " "<font color=\"red\">Warning: </font>all data on partition "
"%2 will be lost.") "%2 will be lost.")
.arg( *Calamares::Branding::VersionedName ) .arg( branding->versionedName() )
.arg( partition->partitionPath() ) .arg( partition->partitionPath() )
.arg( prettyName ) ); .arg( prettyName ) );
m_ui->bootStatusLabel->show(); m_ui->bootStatusLabel->show();
@ -308,7 +309,7 @@ ReplaceWidget::onPartitionSelected()
"%1 will be installed on %2.<br/>" "%1 will be installed on %2.<br/>"
"<font color=\"red\">Warning: </font>all data on partition " "<font color=\"red\">Warning: </font>all data on partition "
"%2 will be lost.") "%2 will be lost.")
.arg( *Calamares::Branding::VersionedName ) .arg( branding->versionedName() )
.arg( partition->partitionPath() ) .arg( partition->partitionPath() )
.arg( prettyName ) ); .arg( prettyName ) );
setNextEnabled( true ); setNextEnabled( true );

@ -163,7 +163,7 @@ FillGlobalStorageJob::prettyDescription() const
if ( mountPoint == "/" ) if ( mountPoint == "/" )
{ {
lines.append( tr( "Install %1 on <strong>new</strong> %2 system partition." ) lines.append( tr( "Install %1 on <strong>new</strong> %2 system partition." )
.arg( *Calamares::Branding::ShortProductName ) .arg( Calamares::Branding::instance()->shortProductName() )
.arg( fsType ) ); .arg( fsType ) );
} }
else else
@ -180,7 +180,7 @@ FillGlobalStorageJob::prettyDescription() const
{ {
lines.append( tr( "Install %2 on %3 system partition <strong>%1</strong>." ) lines.append( tr( "Install %2 on %3 system partition <strong>%1</strong>." )
.arg( path ) .arg( path )
.arg( *Calamares::Branding::ShortProductName ) .arg( Calamares::Branding::instance()->shortProductName() )
.arg( fsType ) ); .arg( fsType ) );
} }
else else

@ -32,9 +32,7 @@ TrackingInstallJob::TrackingInstallJob( const QString& url )
{ {
} }
TrackingInstallJob::~TrackingInstallJob() TrackingInstallJob::~TrackingInstallJob() { }
{
}
QString QString
TrackingInstallJob::prettyName() const TrackingInstallJob::prettyName() const

@ -36,24 +36,23 @@ TrackingPage::TrackingPage( QWidget* parent )
: QWidget( parent ) : QWidget( parent )
, ui( new Ui::TrackingPage ) , ui( new Ui::TrackingPage )
{ {
using StringEntry = Calamares::Branding::StringEntry;
ui->setupUi( this ); ui->setupUi( this );
CALAMARES_RETRANSLATE( CALAMARES_RETRANSLATE(
ui->retranslateUi( this ); ui->generalExplanation->setText( QString product = Calamares::Branding::instance()->shortProductName(); ui->retranslateUi( this );
ui->generalExplanation->setText(
tr( "Install tracking helps %1 to see how many users they have, what hardware they install %1 to and (with " tr( "Install tracking helps %1 to see how many users they have, what hardware they install %1 to and (with "
"the last two options below), get continuous information about preferred applications. To see what " "the last two options below), get continuous information about preferred applications. To see what "
"will be sent, please click the help icon next to each area." ) "will be sent, please click the help icon next to each area." )
.arg( *StringEntry::ShortProductName ) ); .arg( product ) );
ui->installExplanation->setText( ui->installExplanation->setText(
tr( "By selecting this you will send information about your installation and hardware. This information " tr( "By selecting this you will send information about your installation and hardware. This information "
"will <b>only be sent once</b> after the installation finishes." ) ); "will <b>only be sent once</b> after the installation finishes." ) );
ui->machineExplanation->setText( tr( "By selecting this you will <b>periodically</b> send information about " ui->machineExplanation->setText( tr( "By selecting this you will <b>periodically</b> send information about "
"your installation, hardware and applications, to %1." ) "your installation, hardware and applications, to %1." )
.arg( *StringEntry::ShortProductName ) ); .arg( product ) );
ui->userExplanation->setText( tr( "By selecting this you will <b>regularly</b> send information about your " ui->userExplanation->setText( tr( "By selecting this you will <b>regularly</b> send information about your "
"installation, hardware, applications and usage patterns, to %1." ) "installation, hardware, applications and usage patterns, to %1." )
.arg( *StringEntry::ShortProductName ) ); ) .arg( product ) ); )
QButtonGroup* group = new QButtonGroup( this ); QButtonGroup* group = new QButtonGroup( this );
group->setExclusive( true ); group->setExclusive( true );
@ -147,7 +146,7 @@ TrackingPage::setTrackingPolicy( TrackingType t, QString url )
} }
else else
{ {
connect( button, &QToolButton::clicked, [url] { QDesktopServices::openUrl( url ); } ); connect( button, &QToolButton::clicked, [ url ] { QDesktopServices::openUrl( url ); } );
cDebug() << "Tracking policy" << int( t ) << "set to" << url; cDebug() << "Tracking policy" << int( t ) << "set to" << url;
} }
else else
@ -168,7 +167,7 @@ TrackingPage::setGeneralPolicy( QString url )
ui->generalPolicyLabel->show(); ui->generalPolicyLabel->show();
ui->generalPolicyLabel->setTextInteractionFlags( Qt::TextBrowserInteraction ); ui->generalPolicyLabel->setTextInteractionFlags( Qt::TextBrowserInteraction );
ui->generalPolicyLabel->show(); ui->generalPolicyLabel->show();
connect( ui->generalPolicyLabel, &QLabel::linkActivated, [url] { QDesktopServices::openUrl( url ); } ); connect( ui->generalPolicyLabel, &QLabel::linkActivated, [ url ] { QDesktopServices::openUrl( url ); } );
} }
} }

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

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

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

@ -278,13 +278,13 @@ ResultsListWidget::retranslate()
"Installation can continue, but some features " "Installation can continue, but some features "
"might be disabled." ); "might be disabled." );
} }
m_explanation->setText( message.arg( *Calamares::Branding::ShortVersionedName ) ); m_explanation->setText( message.arg( Calamares::Branding::instance()->shortVersionedName() ) );
} }
else else
{ {
m_explanation->setText( tr( "This program will ask you some questions and " m_explanation->setText( tr( "This program will ask you some questions and "
"set up %2 on your computer." ) "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 ); auto v = map.value( key );
if ( v.type() == QVariant::Bool ) if ( v.type() == QVariant::Bool )
{ {
return v.toBool() ? ( *e ) : QString(); return v.toBool() ? ( Calamares::Branding::instance()->string( e ) ) : QString();
} }
if ( v.type() == QVariant::String ) if ( v.type() == QVariant::String )
{ {

Loading…
Cancel
Save