Disable newPartitionTableButton for LVM device.
This commit is contained in:
parent
652ffaedd5
commit
2a785bdf89
@ -119,7 +119,7 @@ PartitionPage::~PartitionPage()
|
||||
void
|
||||
PartitionPage::updateButtons()
|
||||
{
|
||||
bool create = false, edit = false, del = false;
|
||||
bool create = false, createTable = false, edit = false, del = false;
|
||||
|
||||
QModelIndex index = m_ui->partitionTreeView->currentIndex();
|
||||
if ( index.isValid() )
|
||||
@ -141,11 +141,18 @@ PartitionPage::updateButtons()
|
||||
edit = !isFree && !isExtended;
|
||||
del = !isFree;
|
||||
}
|
||||
|
||||
if ( m_ui->deviceComboBox->currentIndex() >= 0 )
|
||||
{
|
||||
QModelIndex deviceIndex = m_core->deviceModel()->index( m_ui->deviceComboBox->currentIndex(), 0 );
|
||||
if ( m_core->deviceModel()->deviceForIndex( deviceIndex )->type() != Device::LVM_Device )
|
||||
createTable = true;
|
||||
}
|
||||
|
||||
m_ui->createButton->setEnabled( create );
|
||||
m_ui->editButton->setEnabled( edit );
|
||||
m_ui->deleteButton->setEnabled( del );
|
||||
|
||||
m_ui->newPartitionTableButton->setEnabled( m_ui->deviceComboBox->currentIndex() >= 0 );
|
||||
m_ui->newPartitionTableButton->setEnabled( createTable );
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user