|
|
@ -149,10 +149,11 @@ PartitionPage::onEditClicked()
|
|
|
|
|
|
|
|
|
|
|
|
const PartitionModel* model = static_cast< const PartitionModel* >( index.model() );
|
|
|
|
const PartitionModel* model = static_cast< const PartitionModel* >( index.model() );
|
|
|
|
Partition* partition = model->partitionForIndex( index );
|
|
|
|
Partition* partition = model->partitionForIndex( index );
|
|
|
|
|
|
|
|
PartitionInfo* partitionInfo = model->partitionInfoForIndex( index );
|
|
|
|
Q_ASSERT( partition );
|
|
|
|
Q_ASSERT( partition );
|
|
|
|
|
|
|
|
|
|
|
|
if ( index.data( PartitionModel::IsNewPartitionRole ).toBool() )
|
|
|
|
if ( PMUtils::isPartitionNew( partitionInfo->partition ) )
|
|
|
|
updatePartitionToCreate( model->device(), partition );
|
|
|
|
updatePartitionToCreate( model->device(), partitionInfo );
|
|
|
|
else
|
|
|
|
else
|
|
|
|
editExistingPartition( partition );
|
|
|
|
editExistingPartition( partition );
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -171,12 +172,13 @@ PartitionPage::onDeleteClicked()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
PartitionPage::updatePartitionToCreate( Device* device, Partition* partition )
|
|
|
|
PartitionPage::updatePartitionToCreate( Device* device, PartitionInfo* partitionInfo )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
Partition* partition = partitionInfo->partition;
|
|
|
|
QPointer<CreatePartitionDialog> dlg = new CreatePartitionDialog( device, partition->parent(), this );
|
|
|
|
QPointer<CreatePartitionDialog> dlg = new CreatePartitionDialog( device, partition->parent(), this );
|
|
|
|
qint64 extraSectors = device->partitionTable()->freeSectorsAfter( *partition );
|
|
|
|
qint64 extraSectors = device->partitionTable()->freeSectorsAfter( *partition );
|
|
|
|
dlg->setSectorRange( partition->firstSector(), partition->lastSector() + extraSectors );
|
|
|
|
dlg->setSectorRange( partition->firstSector(), partition->lastSector() + extraSectors );
|
|
|
|
dlg->initFromPartition( partition );
|
|
|
|
dlg->initFromPartitionInfo( partitionInfo );
|
|
|
|
if ( dlg->exec() == QDialog::Accepted )
|
|
|
|
if ( dlg->exec() == QDialog::Accepted )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_core->deletePartition( device, partition );
|
|
|
|
m_core->deletePartition( device, partition );
|
|
|
|