Apply partitioning action choice separately from preview, and update.

main
Teo Mrnjavac 9 years ago
parent e59418e880
commit 368d3fe747

@ -258,12 +258,6 @@ ChoicePage::setupChoices()
if ( checked )
{
m_choice = Erase;
if ( m_core->isDirty() )
m_core->clearJobs();
PartitionActions::doAutopartition( m_core, selectedDevice() );
setNextEnabled( true );
emit actionChosen();
}
@ -301,6 +295,7 @@ ChoicePage::setupChoices()
Device* currd = selectedDevice();
if ( currd )
{
applyActionChoice( currd, currentChoice() );
updateActionChoicePreview( currd, currentChoice() );
}
} );
@ -352,6 +347,9 @@ ChoicePage::applyDeviceChoice()
{
Device* currd = selectedDevice();
if ( m_core->isDirty() )
m_core->clearJobs();
// The device should only be nullptr immediately after a PCM reset.
// applyDeviceChoice() will be called again momentarily as soon as we handle the
// PartitionCoreModule::reverted signal.
@ -367,6 +365,27 @@ ChoicePage::applyDeviceChoice()
m_lastSelectedDeviceIndex = drivesCombo->currentIndex();
else
m_lastSelectedDeviceIndex = drivesList->selectionModel()->currentIndex().row();
emit actionChosen();
}
void
ChoicePage::applyActionChoice( Device* currentDevice, ChoicePage::Choice choice )
{
switch ( choice )
{
case Erase:
if ( m_core->isDirty() )
m_core->clearJobs();
PartitionActions::doAutopartition( m_core, selectedDevice() );
break;
case Replace:
case NoChoice:
case Manual:
break;
}
}

@ -70,6 +70,7 @@ private:
Device* selectedDevice();
void applyDeviceChoice();
void updateDeviceStatePreview( Device* currentDevice );
void applyActionChoice( Device* currentDevice, ChoicePage::Choice choice );
void updateActionChoicePreview( Device* currentDevice, ChoicePage::Choice choice );
void setupActions( Device* currentDevice );

Loading…
Cancel
Save