calamares/src/modules/partition/gui/EncryptWidget.h

67 lines
1.5 KiB
C
Raw Normal View History

/* === This file is part of Calamares - <https://github.com/calamares> ===
2016-04-22 16:00:19 +02:00
*
* Copyright 2016, Teo Mrnjavac <teo@kde.org>
* Copyright 2020, Adriaan de Groot <groot@kde.org>
2016-04-22 16:00:19 +02:00
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Calamares is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ENCRYPTWIDGET_H
#define ENCRYPTWIDGET_H
#include <QWidget>
2016-04-22 16:00:19 +02:00
namespace Ui
{
class EncryptWidget;
}
class EncryptWidget : public QWidget
2016-04-22 16:00:19 +02:00
{
Q_OBJECT
public:
enum class Encryption : unsigned short
2016-04-22 16:00:19 +02:00
{
Disabled = 0,
Unconfirmed,
Confirmed
2016-04-22 16:00:19 +02:00
};
explicit EncryptWidget( QWidget* parent = nullptr );
void reset();
Encryption state() const;
void setText( const QString& text );
2016-04-22 16:00:19 +02:00
QString passphrase() const;
void retranslate();
2016-04-22 16:00:19 +02:00
signals:
void stateChanged( Encryption );
2016-04-22 16:00:19 +02:00
private:
void updateState();
void onPassphraseEdited();
void onCheckBoxStateChanged( int checked );
2016-04-22 16:00:19 +02:00
Ui::EncryptWidget* m_ui;
Encryption m_state;
2016-04-22 16:00:19 +02:00
};
#endif // ENCRYPTWIDGET_H