Fix Next button behviour for all combinations of

enableLuksAutomatedPartitioning and preCheckEncryption configure file
variables
This commit is contained in:
Penvern Vincent 2024-04-16 18:08:11 +02:00
parent 5ac23cd3d6
commit 8469fbd2e8
3 changed files with 14 additions and 15 deletions

View File

@ -185,7 +185,6 @@ ChoicePage::init( PartitionCoreModule* core )
setModelToComboBox( m_drivesCombo, core->deviceModel() ); setModelToComboBox( m_drivesCombo, core->deviceModel() );
connect( m_drivesCombo, qOverload< int >( &QComboBox::currentIndexChanged ), this, &ChoicePage::applyDeviceChoice ); connect( m_drivesCombo, qOverload< int >( &QComboBox::currentIndexChanged ), this, &ChoicePage::applyDeviceChoice );
connect( m_encryptWidget, &EncryptWidget::stateChanged, this, &ChoicePage::onEncryptWidgetStateChanged ); connect( m_encryptWidget, &EncryptWidget::stateChanged, this, &ChoicePage::onEncryptWidgetStateChanged );
connect( m_reuseHomeCheckBox, &QCheckBox::stateChanged, this, &ChoicePage::onHomeCheckBoxStateChanged ); connect( m_reuseHomeCheckBox, &QCheckBox::stateChanged, this, &ChoicePage::onHomeCheckBoxStateChanged );
@ -468,11 +467,8 @@ ChoicePage::onActionChanged()
{ {
m_encryptWidget->setFilesystem( FileSystem::typeForName( m_replaceFsTypesChoiceComboBox->currentText() ) ); m_encryptWidget->setFilesystem( FileSystem::typeForName( m_replaceFsTypesChoiceComboBox->currentText() ) );
} }
if ( m_config->preCheckEncryption() ) m_encryptWidget->setEncryptionCheckbox( m_config->preCheckEncryption() );
{
m_encryptWidget->setEncryptionCheckbox( m_config->preCheckEncryption() );
}
} }
Device* currd = selectedDevice(); Device* currd = selectedDevice();
@ -1580,7 +1576,9 @@ ChoicePage::calculateNextEnabled() const
} }
} }
if ( m_config->installChoice() != InstallChoice::Manual && m_encryptWidget->isVisible() ) if ( m_config->installChoice() != InstallChoice::Manual
&& (m_encryptWidget->isVisible() ||
m_encryptWidget->isEncryptionCheckboxChecked()))
{ {
switch ( m_encryptWidget->state() ) switch ( m_encryptWidget->state() )
{ {

View File

@ -70,6 +70,11 @@ EncryptWidget::EncryptWidget( QWidget* parent )
CALAMARES_RETRANSLATE_SLOT( &EncryptWidget::retranslate ); CALAMARES_RETRANSLATE_SLOT( &EncryptWidget::retranslate );
} }
bool EncryptWidget::isEncryptionCheckboxChecked()
{
return m_ui->m_encryptCheckBox->isChecked();
}
void EncryptWidget::setEncryptionCheckbox( bool preCheckEncrypt) void EncryptWidget::setEncryptionCheckbox( bool preCheckEncrypt)
{ {
m_ui->m_encryptCheckBox->setChecked( preCheckEncrypt ); m_ui->m_encryptCheckBox->setChecked( preCheckEncrypt );
@ -174,15 +179,10 @@ EncryptWidget::updateState( const bool notify )
} }
} }
Encryption newState = state(); m_state = state();
if ( notify )
if ( newState != m_state )
{ {
m_state = newState; Q_EMIT stateChanged( m_state );
if ( notify )
{
Q_EMIT stateChanged( m_state );
}
} }
} }

View File

@ -39,6 +39,7 @@ public:
void setEncryptionCheckbox( bool preCheckEncrypt = false); void setEncryptionCheckbox( bool preCheckEncrypt = false);
void reset( bool checkVisible = true ); void reset( bool checkVisible = true );
bool isEncryptionCheckboxChecked();
Encryption state() const; Encryption state() const;
void setText( const QString& text ); void setText( const QString& text );