2020-08-25 16:05:56 +02:00
|
|
|
/* === This file is part of Calamares - <https://calamares.io> ===
|
2016-04-22 16:00:19 +02:00
|
|
|
*
|
2020-08-22 01:19:58 +02:00
|
|
|
* SPDX-FileCopyrightText: 2016 Teo Mrnjavac <teo@kde.org>
|
|
|
|
* SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2016-04-22 16:00:19 +02:00
|
|
|
*
|
2020-08-25 16:05:56 +02:00
|
|
|
* Calamares is Free Software: see the License-Identifier above.
|
2016-04-22 16:00:19 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef ENCRYPTWIDGET_H
|
|
|
|
#define ENCRYPTWIDGET_H
|
|
|
|
|
2020-03-10 03:20:03 +01:00
|
|
|
#include <QWidget>
|
2016-04-22 16:00:19 +02:00
|
|
|
|
2020-03-10 03:20:03 +01:00
|
|
|
namespace Ui
|
|
|
|
{
|
2020-08-22 01:19:58 +02:00
|
|
|
class EncryptWidget;
|
2020-03-10 03:20:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
class EncryptWidget : public QWidget
|
2016-04-22 16:00:19 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2020-03-10 03:20:03 +01:00
|
|
|
enum class Encryption : unsigned short
|
2016-04-22 16:00:19 +02:00
|
|
|
{
|
2020-03-10 03:20:03 +01:00
|
|
|
Disabled = 0,
|
|
|
|
Unconfirmed,
|
|
|
|
Confirmed
|
2016-04-22 16:00:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
explicit EncryptWidget( QWidget* parent = nullptr );
|
|
|
|
|
2016-06-10 14:40:49 +02:00
|
|
|
void reset();
|
|
|
|
|
2020-03-10 03:20:03 +01:00
|
|
|
Encryption state() const;
|
2016-06-10 14:40:49 +02:00
|
|
|
void setText( const QString& text );
|
2016-04-22 16:00:19 +02:00
|
|
|
|
|
|
|
QString passphrase() const;
|
|
|
|
|
2020-03-10 03:20:03 +01:00
|
|
|
void retranslate();
|
2016-04-22 16:00:19 +02:00
|
|
|
|
2020-03-10 03:20:03 +01:00
|
|
|
signals:
|
|
|
|
void stateChanged( Encryption );
|
2016-04-22 16:00:19 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
void updateState();
|
|
|
|
void onPassphraseEdited();
|
2020-03-10 03:20:03 +01:00
|
|
|
void onCheckBoxStateChanged( int checked );
|
2016-04-22 16:00:19 +02:00
|
|
|
|
2020-03-10 03:20:03 +01:00
|
|
|
Ui::EncryptWidget* m_ui;
|
|
|
|
Encryption m_state;
|
2016-04-22 16:00:19 +02:00
|
|
|
};
|
|
|
|
|
2020-03-10 03:20:03 +01:00
|
|
|
#endif // ENCRYPTWIDGET_H
|