diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp index a89dd1edb..c69768f70 100644 --- a/src/modules/partition/gui/ChoicePage.cpp +++ b/src/modules/partition/gui/ChoicePage.cpp @@ -832,7 +832,7 @@ ChoicePage::doReplaceSelectedPartition( const QModelIndex& current ) if ( !homePartitionPath->isEmpty() ) m_reuseHomeCheckBox->setText( tr( "Reuse %1 as home partition for %2." ) .arg( *homePartitionPath ) - .arg( *Calamares::Branding::ShortProductName ) ); + .arg( Calamares::Branding::instance()->shortProductName() ) ); delete homePartitionPath; if ( m_isEfi ) @@ -975,7 +975,7 @@ ChoicePage::updateActionChoicePreview( ChoicePage::InstallChoice choice ) .arg( m_beforePartitionBarsView->selectionModel()->currentIndex().data().toString() ) .arg( CalamaresUtils::BytesToMiB( size ) ) .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_afterPartitionLabelsView = new PartitionLabelsView( m_previewAfterFrame ); 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() ); @@ -1135,7 +1135,7 @@ ChoicePage::setupEfiSystemPartitionSelector() tr( "An EFI system partition cannot be found anywhere " "on this system. Please go back and use manual " "partitioning to set up %1." ) - .arg( *Calamares::Branding::ShortProductName ) ); + .arg( Calamares::Branding::instance()->shortProductName() ) ); updateNextEnabled(); } 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 " "starting %2." ) .arg( efiSystemPartitions.first()->partitionPath() ) - .arg( *Calamares::Branding::ShortProductName ) ); + .arg( Calamares::Branding::instance()->shortProductName() ) ); } else { @@ -1278,11 +1278,11 @@ ChoicePage::setupActions() m_alongsideButton->setText( tr( "Install alongside
" "The installer will shrink a partition to make room for %1." ) - .arg( *Calamares::Branding::ShortVersionedName ) ); + .arg( Calamares::Branding::instance()->shortVersionedName() ) ); m_replaceButton->setText( tr( "Replace a partition
" "Replaces a partition with %1." ) - .arg( *Calamares::Branding::ShortVersionedName ) ); + .arg( Calamares::Branding::instance()->shortVersionedName() ) ); ) m_replaceButton->hide(); @@ -1308,7 +1308,7 @@ ChoicePage::setupActions() m_alongsideButton->setText( tr( "Install alongside
" "The installer will shrink a partition to make room for %1." ) - .arg( *Calamares::Branding::ShortVersionedName ) ); + .arg( Calamares::Branding::instance()->shortVersionedName() ) ); m_eraseButton->setText( tr( "Erase disk
" "This will delete all data " @@ -1317,7 +1317,7 @@ ChoicePage::setupActions() m_replaceButton->setText( tr( "Replace a partition
" "Replaces a partition with %1." ) - .arg( *Calamares::Branding::ShortVersionedName ) ); + .arg( Calamares::Branding::instance()->shortVersionedName() ) ); ) } else @@ -1331,7 +1331,7 @@ ChoicePage::setupActions() m_alongsideButton->setText( tr( "Install alongside
" "The installer will shrink a partition to make room for %1." ) - .arg( *Calamares::Branding::ShortVersionedName ) ); + .arg( Calamares::Branding::instance()->shortVersionedName() ) ); m_eraseButton->setText( tr( "Erase disk
" "This will delete all data " @@ -1339,7 +1339,7 @@ ChoicePage::setupActions() m_replaceButton->setText( tr( "Replace a partition
" "Replaces a partition with %1." ) - .arg( *Calamares::Branding::ShortVersionedName ) ); + .arg( Calamares::Branding::instance()->shortVersionedName() ) ); ) } } @@ -1357,7 +1357,7 @@ ChoicePage::setupActions() m_alongsideButton->setText( tr( "Install alongside
" "The installer will shrink a partition to make room for %1." ) - .arg( *Calamares::Branding::ShortVersionedName ) ); + .arg( Calamares::Branding::instance()->shortVersionedName() ) ); m_eraseButton->setText( tr( "Erase disk
" "This will delete all data " @@ -1365,7 +1365,7 @@ ChoicePage::setupActions() m_replaceButton->setText( tr( "Replace a partition
" "Replaces a partition with %1." ) - .arg( *Calamares::Branding::ShortVersionedName ) ); + .arg( Calamares::Branding::instance()->shortVersionedName() ) ); ) } diff --git a/src/modules/partition/gui/PartitionViewStep.cpp b/src/modules/partition/gui/PartitionViewStep.cpp index c9bdd03f9..a583a4b96 100644 --- a/src/modules/partition/gui/PartitionViewStep.cpp +++ b/src/modules/partition/gui/PartitionViewStep.cpp @@ -154,6 +154,7 @@ PartitionViewStep::createSummaryWidget() const formLayout->setContentsMargins( MARGIN, 0, MARGIN, MARGIN ); mainLayout->addLayout( formLayout ); + const auto* branding = Calamares::Branding::instance(); QList< PartitionCoreModule::SummaryInfo > list = m_core->createSummaryInfo(); if ( list.length() > 1 ) // There are changes on more than one disk { @@ -166,15 +167,15 @@ PartitionViewStep::createSummaryWidget() const { case ChoicePage::Alongside: modeText = tr( "Install %1 alongside another operating system." ) - .arg( *Calamares::Branding::ShortVersionedName ); + .arg( branding->shortVersionedName() ); break; case ChoicePage::Erase: modeText - = tr( "Erase disk and install %1." ).arg( *Calamares::Branding::ShortVersionedName ); + = tr( "Erase disk and install %1." ).arg( branding->shortVersionedName() ); break; case ChoicePage::Replace: modeText - = tr( "Replace a partition with %1." ).arg( *Calamares::Branding::ShortVersionedName ); + = tr( "Replace a partition with %1." ).arg( branding->shortVersionedName() ); break; case ChoicePage::NoChoice: case ChoicePage::Manual: @@ -193,19 +194,19 @@ PartitionViewStep::createSummaryWidget() const case ChoicePage::Alongside: modeText = tr( "Install %1 alongside another operating system on disk " "%2 (%3)." ) - .arg( *Calamares::Branding::ShortVersionedName ) + .arg( branding->shortVersionedName() ) .arg( info.deviceNode ) .arg( info.deviceName ); break; case ChoicePage::Erase: modeText = tr( "Erase disk %2 (%3) and install %1." ) - .arg( *Calamares::Branding::ShortVersionedName ) + .arg( branding->shortVersionedName() ) .arg( info.deviceNode ) .arg( info.deviceName ); break; case ChoicePage::Replace: modeText = tr( "Replace a partition on disk %2 (%3) with %1." ) - .arg( *Calamares::Branding::ShortVersionedName ) + .arg( branding->shortVersionedName() ) .arg( info.deviceNode ) .arg( info.deviceName ); break; @@ -256,7 +257,7 @@ PartitionViewStep::createSummaryWidget() const previewLabels->setModel( info.partitionModelAfter ); preview->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 ); field = new QVBoxLayout; CalamaresUtils::unmarginLayout( field ); @@ -411,6 +412,7 @@ PartitionViewStep::onLeave() return; } + const auto* branding = Calamares::Branding::instance(); if ( m_widget->currentWidget() == m_manualPartitionPage ) { if ( PartUtils::isEfiSystem() ) @@ -438,7 +440,7 @@ PartitionViewStep::onLeave() "%2.

" "You can continue without setting up an EFI system " "partition but your system may fail to start." ) - .arg( *Calamares::Branding::ShortProductName ) + .arg( branding->shortProductName() ) .arg( espMountPoint, espFlagName ); } else if ( esp && !PartUtils::isEfiBootable( esp ) ) @@ -453,7 +455,7 @@ PartitionViewStep::onLeave() "

" "You can continue without setting the flag but your " "system may fail to start." ) - .arg( *Calamares::Branding::ShortProductName ) + .arg( branding->shortProductName() ) .arg( espMountPoint, espFlagName ); } @@ -482,7 +484,7 @@ PartitionViewStep::onLeave() "bios_grub flag enabled.

" "An unformatted 8 MB partition is necessary " "to start %1 on a BIOS system with GPT." ) - .arg( *Calamares::Branding::ShortProductName ); + .arg( branding->shortProductName() ); QMessageBox::information( m_manualPartitionPage, message, description ); } diff --git a/src/modules/partition/gui/ReplaceWidget.cpp b/src/modules/partition/gui/ReplaceWidget.cpp index 728b33c36..8594a3e15 100644 --- a/src/modules/partition/gui/ReplaceWidget.cpp +++ b/src/modules/partition/gui/ReplaceWidget.cpp @@ -133,13 +133,14 @@ ReplaceWidget::onPartitionSelected() if ( Calamares::JobQueue::instance()->globalStorage()->value( "firmwareType" ) == "efi" ) m_isEfi = true; + const auto* branding = Calamares::Branding::instance(); if ( m_ui->partitionTreeView->currentIndex() == QModelIndex() ) { updateStatus( CalamaresUtils::PartitionPartition, tr( "Select where to install %1.
" "Warning: this will delete all files " "on the selected partition." ) - .arg( *Calamares::Branding::VersionedName ) ); + .arg( branding->versionedName() ) ); setNextEnabled( false ); return; } @@ -172,7 +173,7 @@ ReplaceWidget::onPartitionSelected() updateStatus( CalamaresUtils::Fail, tr( "%1 cannot be installed on empty space. Please select an " "existing partition." ) - .arg( *Calamares::Branding::VersionedName ) ); + .arg( branding->versionedName() ) ); setNextEnabled( false ); return; } @@ -182,7 +183,7 @@ ReplaceWidget::onPartitionSelected() updateStatus( CalamaresUtils::Fail, tr( "%1 cannot be installed on an extended partition. Please select an " "existing primary or logical partition." ) - .arg( *Calamares::Branding::VersionedName ) ); + .arg( branding->versionedName() ) ); setNextEnabled( false ); return; } @@ -191,7 +192,7 @@ ReplaceWidget::onPartitionSelected() { updateStatus( CalamaresUtils::Fail, tr( "%1 cannot be installed on this partition." ) - .arg( *Calamares::Branding::VersionedName ) ); + .arg( branding->versionedName() ) ); setNextEnabled( false ); return; } @@ -233,7 +234,7 @@ ReplaceWidget::onPartitionSelected() "The partition %1 is too small for %2. Please select a partition " "with capacity at least %3 GiB." ) .arg( partition->partitionPath() ) - .arg( *Calamares::Branding::VersionedName ) + .arg( branding->versionedName() ) .arg( requiredSpaceB / ( 1024. * 1024. * 1024. ), 0, 'f', 1 ) .arg( prettyName ) ); @@ -256,7 +257,7 @@ ReplaceWidget::onPartitionSelected() "An EFI system partition cannot be found anywhere " "on this system. Please go back and use manual " "partitioning to set up %1." ) - .arg( *Calamares::Branding::ShortProductName ) + .arg( branding->shortProductName() ) .arg( prettyName ) ); setNextEnabled( false ); } @@ -267,14 +268,14 @@ ReplaceWidget::onPartitionSelected() "%1 will be installed on %2.
" "Warning: all data on partition " "%2 will be lost.") - .arg( *Calamares::Branding::VersionedName ) + .arg( branding->versionedName() ) .arg( partition->partitionPath() ) .arg( prettyName ) ); m_ui->bootStatusLabel->show(); m_ui->bootStatusLabel->setText( tr( "The EFI system partition at %1 will be used for starting %2." ) .arg( efiSystemPartitions.first()->partitionPath() ) - .arg( *Calamares::Branding::ShortProductName ) ); + .arg( branding->shortProductName() ) ); setNextEnabled( true ); } else @@ -284,7 +285,7 @@ ReplaceWidget::onPartitionSelected() "%1 will be installed on %2.
" "Warning: all data on partition " "%2 will be lost.") - .arg( *Calamares::Branding::VersionedName ) + .arg( branding->versionedName() ) .arg( partition->partitionPath() ) .arg( prettyName ) ); m_ui->bootStatusLabel->show(); @@ -308,7 +309,7 @@ ReplaceWidget::onPartitionSelected() "%1 will be installed on %2.
" "Warning: all data on partition " "%2 will be lost.") - .arg( *Calamares::Branding::VersionedName ) + .arg( branding->versionedName() ) .arg( partition->partitionPath() ) .arg( prettyName ) ); setNextEnabled( true ); diff --git a/src/modules/partition/jobs/FillGlobalStorageJob.cpp b/src/modules/partition/jobs/FillGlobalStorageJob.cpp index a302a3f31..07c856d44 100644 --- a/src/modules/partition/jobs/FillGlobalStorageJob.cpp +++ b/src/modules/partition/jobs/FillGlobalStorageJob.cpp @@ -163,7 +163,7 @@ FillGlobalStorageJob::prettyDescription() const if ( mountPoint == "/" ) { lines.append( tr( "Install %1 on new %2 system partition." ) - .arg( *Calamares::Branding::ShortProductName ) + .arg( Calamares::Branding::instance()->shortProductName() ) .arg( fsType ) ); } else @@ -180,7 +180,7 @@ FillGlobalStorageJob::prettyDescription() const { lines.append( tr( "Install %2 on %3 system partition %1." ) .arg( path ) - .arg( *Calamares::Branding::ShortProductName ) + .arg( Calamares::Branding::instance()->shortProductName() ) .arg( fsType ) ); } else