diff --git a/src/modules/partition/gui/PartitionPage.cpp b/src/modules/partition/gui/PartitionPage.cpp index 62e7a97a1..88b03ec72 100644 --- a/src/modules/partition/gui/PartitionPage.cpp +++ b/src/modules/partition/gui/PartitionPage.cpp @@ -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