[partition] Refactor slot for change in action

- Let's not go overboard on lambdas,
 - Needed for others that also want to update the partitioning preview
This commit is contained in:
Adriaan de Groot 2018-12-04 10:22:08 +01:00
parent b8595a1323
commit 0231619c7c
2 changed files with 15 additions and 8 deletions

View File

@ -305,14 +305,7 @@ ChoicePage::setupChoices()
m_rightLayout->setStretchFactor( m_previewAfterFrame, 0 );
connect( this, &ChoicePage::actionChosen,
this, [=]
{
Device* currd = selectedDevice();
if ( currd )
{
applyActionChoice( currentChoice() );
}
} );
this, &ChoicePage::onActionChanged );
CALAMARES_RETRANSLATE(
updateSwapChoicesTr( m_eraseSwapChoices );
@ -412,6 +405,17 @@ ChoicePage::continueApplyDeviceChoice()
}
void
ChoicePage::onActionChanged()
{
Device* currd = selectedDevice();
if ( currd )
{
applyActionChoice( currentChoice() );
}
}
void
ChoicePage::applyActionChoice( ChoicePage::InstallChoice choice )
{

View File

@ -109,6 +109,9 @@ private slots:
void onEncryptWidgetStateChanged();
void onHomeCheckBoxStateChanged();
/** @brief Calls applyActionChoice() as needed. */
void onActionChanged();
private:
void updateNextEnabled();
void setupChoices();