mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 18:05:36 -04:00
Use asynchronous device revert.
This commit is contained in:
parent
dbef198bac
commit
cd8b7619d0
1 changed files with 17 additions and 12 deletions
|
@ -273,7 +273,6 @@ ChoicePage::setupChoices()
|
|||
if ( currd )
|
||||
{
|
||||
applyActionChoice( currentChoice() );
|
||||
updateActionChoicePreview( currentChoice() );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
@ -437,12 +436,8 @@ ChoicePage::applyActionChoice( ChoicePage::Choice choice )
|
|||
connect( m_beforePartitionBarsView->selectionModel(), &QItemSelectionModel::currentRowChanged,
|
||||
this, [ this ]( const QModelIndex& current, const QModelIndex& previous )
|
||||
{
|
||||
if ( m_core->isDirty() )
|
||||
auto doReplace = [=]
|
||||
{
|
||||
m_core->revertDevice( selectedDevice() );
|
||||
m_core->clearJobs();
|
||||
}
|
||||
|
||||
// We can't use the PartitionPtrRole because we need to make changes to the
|
||||
// main DeviceModel, not the immutable copy.
|
||||
QString partPath = current.data( PartitionModel::PartitionPathRole ).toString();
|
||||
|
@ -452,12 +447,22 @@ ChoicePage::applyActionChoice( ChoicePage::Choice choice )
|
|||
PartitionActions::doReplacePartition( m_core,
|
||||
selectedDevice(),
|
||||
partition );
|
||||
};
|
||||
|
||||
if ( m_core->isDirty() )
|
||||
{
|
||||
m_core->asyncRevertDevice( selectedDevice(), doReplace );
|
||||
m_core->clearJobs();
|
||||
}
|
||||
else
|
||||
doReplace();
|
||||
} );
|
||||
break;
|
||||
case NoChoice:
|
||||
case Manual:
|
||||
break;
|
||||
}
|
||||
updateActionChoicePreview( currentChoice() );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue