mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-30 10:55:37 -04:00
[partition] Fix Delete button for extended
Extended partition can't be removed when contains children. This commit adds missing check.
This commit is contained in:
parent
9302ad1468
commit
74a3a2da78
1 changed files with 6 additions and 1 deletions
|
@ -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 )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue