diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp
index 51c55e39c..5ab46e2f2 100644
--- a/src/modules/partition/gui/ChoicePage.cpp
+++ b/src/modules/partition/gui/ChoicePage.cpp
@@ -986,6 +986,19 @@ ChoicePage::setupActions()
}
}
+ bool atLeastOneCanBeReplaced = false;
+
+ for ( auto it = PartitionIterator::begin( currentDevice );
+ it != PartitionIterator::end( currentDevice ); ++it )
+ {
+ if ( PartUtils::canBeReplaced( *it ) )
+ {
+ atLeastOneCanBeReplaced = true;
+ break;
+ }
+ }
+
+
if ( osproberEntriesForCurrentDevice.count() == 0 )
{
CALAMARES_RETRANSLATE(
@@ -997,6 +1010,16 @@ ChoicePage::setupActions()
m_eraseButton->setText( tr( "Erase disk
"
"This will delete all data "
"currently present on the selected storage device." ) );
+
+ m_alongsideButton->setText( tr( "Install alongside
"
+ "The installer will shrink a partition to make room for %1." )
+ .arg( Calamares::Branding::instance()->
+ string( Calamares::Branding::ShortVersionedName ) ) );
+
+ m_replaceButton->setText( tr( "Replace a partition
"
+ "Replaces a partition with %1." )
+ .arg( Calamares::Branding::instance()->
+ string( Calamares::Branding::ShortVersionedName ) ) );
)
m_replaceButton->hide();
@@ -1109,6 +1132,26 @@ ChoicePage::setupActions()
}
}
+ if ( atLeastOneCanBeReplaced )
+ m_replaceButton->show();
+ else
+ {
+ m_replaceButton->hide();
+ m_grp->setExclusive( false );
+ m_replaceButton->buttonWidget()->setChecked( false );
+ m_grp->setExclusive( true );
+ }
+
+ if ( atLeastOneCanBeResized )
+ m_alongsideButton->show();
+ else
+ {
+ m_alongsideButton->hide();
+ m_grp->setExclusive( false );
+ m_alongsideButton->buttonWidget()->setChecked( false );
+ m_grp->setExclusive( true );
+ }
+
bool isEfi = QDir( "/sys/firmware/efi/efivars" ).exists();
bool efiSystemPartitionFound = !m_core->efiSystemPartitions().isEmpty();