From b792ea0216abfb2b4b55eb646196d4a2999fdc7f Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Thu, 5 May 2016 12:26:28 +0200 Subject: [PATCH] Rebuild autopartition proposal when encryption choice changes. --- src/modules/partition/gui/ChoicePage.cpp | 20 +++++++++++++++++--- src/modules/partition/gui/ChoicePage.h | 1 + 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp index 8dfb1a80a..418239ae3 100644 --- a/src/modules/partition/gui/ChoicePage.cpp +++ b/src/modules/partition/gui/ChoicePage.cpp @@ -159,7 +159,7 @@ ChoicePage::init( PartitionCoreModule* core ) this, &ChoicePage::applyDeviceChoice ); connect( m_encryptWidget, &EncryptWidget::stateChanged, - this, &ChoicePage::updateNextEnabled ); + this, &ChoicePage::onEncryptWidgetStateChanged ); ChoicePage::applyDeviceChoice(); } @@ -368,14 +368,14 @@ ChoicePage::applyActionChoice( ChoicePage::Choice choice ) } ), [ = ] { - PartitionActions::doAutopartition( m_core, selectedDevice() ); + PartitionActions::doAutopartition( m_core, selectedDevice(), m_encryptWidget->passphrase() ); emit deviceChosen(); }, this ); } else { - PartitionActions::doAutopartition( m_core, selectedDevice() ); + PartitionActions::doAutopartition( m_core, selectedDevice(), m_encryptWidget->passphrase() ); emit deviceChosen(); } @@ -474,6 +474,20 @@ ChoicePage::doAlongsideSetupSplitter( const QModelIndex& current, } +void +ChoicePage::onEncryptWidgetStateChanged() +{ + EncryptWidget::State state = m_encryptWidget->state(); + if ( m_choice == Erase ) + { + if ( state == EncryptWidget::EncryptionConfirmed || + state == EncryptWidget::EncryptionDisabled ) + applyActionChoice( m_choice ); + } + updateNextEnabled(); +} + + void ChoicePage::onLeave() { diff --git a/src/modules/partition/gui/ChoicePage.h b/src/modules/partition/gui/ChoicePage.h index 1f09da101..bd32e1be1 100644 --- a/src/modules/partition/gui/ChoicePage.h +++ b/src/modules/partition/gui/ChoicePage.h @@ -74,6 +74,7 @@ signals: private slots: void doReplaceSelectedPartition( const QModelIndex& current, const QModelIndex& previous ); void doAlongsideSetupSplitter( const QModelIndex& current, const QModelIndex& previous ); + void onEncryptWidgetStateChanged(); private: void updateNextEnabled();