From e6e46f1ebd26efdfd9fce04e4f0e162f5136c215 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 28 Apr 2024 23:07:56 +0200 Subject: [PATCH] [partition] Polishing, formatting --- src/modules/partition/Config.h | 8 ++++---- src/modules/partition/gui/ChoicePage.cpp | 7 ++++--- src/modules/partition/gui/EncryptWidget.cpp | 6 ++++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/modules/partition/Config.h b/src/modules/partition/Config.h index 199ddaf88..8ec139169 100644 --- a/src/modules/partition/Config.h +++ b/src/modules/partition/Config.h @@ -148,10 +148,10 @@ public: /// @brief Is manual partitioning allowed (not explicitly disabled in the config file)? bool allowManualPartitioning() const { return m_allowManualPartitioning; } - /** @brief pre check encryption checkbox. - * - * parameter is used if enableLuksAutomatedPartitioning is true. - * Default value is false + /** @brief Pre-check encryption checkbox. + * + * This is meaningful only if enableLuksAutomatedPartitioning is @c true. + * Default value is @c false */ bool preCheckEncryption() const { return m_preCheckEncryption; } diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp index 1d77fd75d..62cf0f6e1 100644 --- a/src/modules/partition/gui/ChoicePage.cpp +++ b/src/modules/partition/gui/ChoicePage.cpp @@ -1584,9 +1584,10 @@ ChoicePage::calculateNextEnabled() const } } - if ( m_config->installChoice() != InstallChoice::Manual - && (m_encryptWidget->isVisible() || - m_encryptWidget->isEncryptionCheckboxChecked())) + // You can have an invisible encryption checkbox, which is + // still checked -- then do the encryption. + if ( m_config->installChoice() != InstallChoice::Manual + && ( m_encryptWidget->isVisible() || m_encryptWidget->isEncryptionCheckboxChecked() ) ) { switch ( m_encryptWidget->state() ) { diff --git a/src/modules/partition/gui/EncryptWidget.cpp b/src/modules/partition/gui/EncryptWidget.cpp index 013018d25..8726df147 100644 --- a/src/modules/partition/gui/EncryptWidget.cpp +++ b/src/modules/partition/gui/EncryptWidget.cpp @@ -70,12 +70,14 @@ EncryptWidget::EncryptWidget( QWidget* parent ) CALAMARES_RETRANSLATE_SLOT( &EncryptWidget::retranslate ); } -bool EncryptWidget::isEncryptionCheckboxChecked() +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 ); }