2012-01-13 17:52:37 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2012 Felix Geyer <debfx@fobos.de>
|
|
|
|
*
|
|
|
|
* This program 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 2 or (at your option)
|
|
|
|
* version 3 of the License.
|
|
|
|
*
|
|
|
|
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KEEPASSX_CHANGEMASTERKEYWIDGET_H
|
|
|
|
#define KEEPASSX_CHANGEMASTERKEYWIDGET_H
|
|
|
|
|
2013-10-03 15:18:16 +02:00
|
|
|
#include <QScopedPointer>
|
2012-01-13 17:52:37 +01:00
|
|
|
|
2012-04-24 13:23:09 +02:00
|
|
|
#include "gui/DialogyWidget.h"
|
2012-01-13 17:52:37 +01:00
|
|
|
#include "keys/CompositeKey.h"
|
|
|
|
|
|
|
|
class QLabel;
|
|
|
|
namespace Ui {
|
|
|
|
class ChangeMasterKeyWidget;
|
|
|
|
}
|
|
|
|
|
2012-04-24 13:23:09 +02:00
|
|
|
class ChangeMasterKeyWidget : public DialogyWidget
|
2012-01-13 17:52:37 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2015-07-24 18:28:12 +02:00
|
|
|
explicit ChangeMasterKeyWidget(QWidget* parent = nullptr);
|
2012-01-13 17:52:37 +01:00
|
|
|
~ChangeMasterKeyWidget();
|
|
|
|
void clearForms();
|
|
|
|
CompositeKey newMasterKey();
|
|
|
|
QLabel* headlineLabel();
|
2017-02-21 01:28:50 +01:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void setOkEnabled();
|
2017-02-16 23:18:04 +01:00
|
|
|
void setCancelEnabled(bool enabled);
|
2012-01-13 17:52:37 +01:00
|
|
|
|
2017-02-21 01:28:50 +01:00
|
|
|
signals:
|
2012-01-13 17:52:37 +01:00
|
|
|
void editFinished(bool accepted);
|
|
|
|
|
2017-02-21 01:28:50 +01:00
|
|
|
private slots:
|
2012-01-13 17:52:37 +01:00
|
|
|
void generateKey();
|
|
|
|
void reject();
|
2012-06-10 17:26:35 +01:00
|
|
|
void createKeyFile();
|
2012-06-10 17:40:05 +01:00
|
|
|
void browseKeyFile();
|
2017-02-20 22:41:39 +01:00
|
|
|
void yubikeyDetected(int slot, bool blocking);
|
|
|
|
void noYubikeyFound();
|
|
|
|
void challengeResponseGroupToggled(bool checked);
|
|
|
|
void pollYubikey();
|
2012-01-13 17:52:37 +01:00
|
|
|
|
|
|
|
private:
|
2012-04-23 19:44:43 +02:00
|
|
|
const QScopedPointer<Ui::ChangeMasterKeyWidget> m_ui;
|
2012-01-13 17:52:37 +01:00
|
|
|
CompositeKey m_key;
|
|
|
|
|
|
|
|
Q_DISABLE_COPY(ChangeMasterKeyWidget)
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // KEEPASSX_CHANGEMASTERKEYWIDGET_H
|