[partition] Deal with deprecations in QCheckBox
This commit is contained in:
parent
20e6d1d66c
commit
b5533caece
@ -60,7 +60,8 @@ EncryptWidget::EncryptWidget( QWidget* parent )
|
||||
m_ui->m_encryptionUnsupportedLabel->show();
|
||||
}
|
||||
|
||||
connect( m_ui->m_encryptCheckBox, &QCheckBox::stateChanged, this, &EncryptWidget::onCheckBoxStateChanged );
|
||||
connect(
|
||||
m_ui->m_encryptCheckBox, Calamares::checkBoxStateChangedSignal, this, &EncryptWidget::onCheckBoxStateChanged );
|
||||
connect( m_ui->m_passphraseLineEdit, &QLineEdit::textEdited, this, &EncryptWidget::onPassphraseEdited );
|
||||
connect( m_ui->m_confirmLineEdit, &QLineEdit::textEdited, this, &EncryptWidget::onPassphraseEdited );
|
||||
|
||||
@ -203,12 +204,12 @@ EncryptWidget::onPassphraseEdited()
|
||||
}
|
||||
|
||||
void
|
||||
EncryptWidget::onCheckBoxStateChanged( int checked )
|
||||
EncryptWidget::onCheckBoxStateChanged( Calamares::checkBoxStateType checked )
|
||||
{
|
||||
// @p checked is a Qt::CheckState, 0 is "unchecked" and 2 is "checked"
|
||||
m_ui->m_passphraseLineEdit->setVisible( checked );
|
||||
m_ui->m_confirmLineEdit->setVisible( checked );
|
||||
m_ui->m_iconLabel->setVisible( checked );
|
||||
const bool visible = ( checked != Calamares::checkBoxUncheckedValue );
|
||||
m_ui->m_passphraseLineEdit->setVisible( visible );
|
||||
m_ui->m_confirmLineEdit->setVisible( visible );
|
||||
m_ui->m_iconLabel->setVisible( visible );
|
||||
m_ui->m_passphraseLineEdit->clear();
|
||||
m_ui->m_confirmLineEdit->clear();
|
||||
m_ui->m_iconLabel->clear();
|
||||
|
@ -13,6 +13,8 @@
|
||||
#ifndef ENCRYPTWIDGET_H
|
||||
#define ENCRYPTWIDGET_H
|
||||
|
||||
#include "compat/CheckBox.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include <kpmcore/fs/filesystem.h>
|
||||
@ -36,7 +38,7 @@ public:
|
||||
|
||||
explicit EncryptWidget( QWidget* parent = nullptr );
|
||||
|
||||
void setEncryptionCheckbox( bool preCheckEncrypt = false);
|
||||
void setEncryptionCheckbox( bool preCheckEncrypt = false );
|
||||
void reset( bool checkVisible = true );
|
||||
|
||||
bool isEncryptionCheckboxChecked();
|
||||
@ -59,7 +61,7 @@ signals:
|
||||
private:
|
||||
void updateState( const bool notify = true );
|
||||
void onPassphraseEdited();
|
||||
void onCheckBoxStateChanged( int checked );
|
||||
void onCheckBoxStateChanged( Calamares::checkBoxStateType checked );
|
||||
|
||||
Ui::EncryptWidget* m_ui;
|
||||
Encryption m_state;
|
||||
|
Loading…
Reference in New Issue
Block a user