Merge pull request #1749 from LordTermor/calamares

[partition] Disable delete button for extended partition
This commit is contained in:
Adriaan de Groot 2021-08-26 17:18:09 +02:00 committed by GitHub
commit ad9306d7bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -139,6 +139,11 @@ PartitionPage::updateButtons()
bool isFree = CalamaresUtils::Partition::isPartitionFreeSpace( partition ); bool isFree = CalamaresUtils::Partition::isPartitionFreeSpace( partition );
bool isExtended = partition->roles().has( PartitionRole::Extended ); bool isExtended = partition->roles().has( PartitionRole::Extended );
bool hasChildren = isExtended
&& ( partition->children().length() > 1
|| ( partition->children().length() == 1
&& !CalamaresUtils::Partition::isPartitionFreeSpace( partition->children().at( 0 ) ) ) );
bool isInVG = m_core->isInVG( partition ); bool isInVG = m_core->isInVG( partition );
create = isFree; create = isFree;
@ -151,7 +156,7 @@ PartitionPage::updateButtons()
// order. // order.
// TODO: See if LVM PVs can be edited in Calamares // TODO: See if LVM PVs can be edited in Calamares
edit = !isFree && !isExtended; edit = !isFree && !isExtended;
del = !isFree && !isInVG; del = !isFree && !isInVG && !hasChildren;
} }
if ( m_ui->deviceComboBox->currentIndex() >= 0 ) if ( m_ui->deviceComboBox->currentIndex() >= 0 )