2017-11-09 19:34:51 +01:00
|
|
|
/*
|
|
|
|
|
* This file is part of the Flowee project
|
|
|
|
|
* Copyright (C) 2011-2015 The Bitcoin Core developers
|
|
|
|
|
*
|
|
|
|
|
* 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 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* 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/>.
|
|
|
|
|
*/
|
2013-11-04 16:20:43 +01:00
|
|
|
|
2018-01-16 10:47:52 +00:00
|
|
|
#ifndef FLOWEE_QT_ASKPASSPHRASEDIALOG_H
|
|
|
|
|
#define FLOWEE_QT_ASKPASSPHRASEDIALOG_H
|
2011-08-24 22:07:26 +02:00
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
|
2013-04-13 00:13:08 -05:00
|
|
|
class WalletModel;
|
|
|
|
|
|
2011-08-24 22:07:26 +02:00
|
|
|
namespace Ui {
|
|
|
|
|
class AskPassphraseDialog;
|
|
|
|
|
}
|
|
|
|
|
|
2011-11-13 13:19:52 +01:00
|
|
|
/** Multifunctional dialog to ask for passphrases. Used for encryption, unlocking, and changing the passphrase.
|
|
|
|
|
*/
|
2011-08-24 22:07:26 +02:00
|
|
|
class AskPassphraseDialog : public QDialog
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
enum Mode {
|
2011-11-13 13:19:52 +01:00
|
|
|
Encrypt, /**< Ask passphrase twice and encrypt */
|
|
|
|
|
Unlock, /**< Ask passphrase and unlock */
|
|
|
|
|
ChangePass, /**< Ask old passphrase + new passphrase twice */
|
|
|
|
|
Decrypt /**< Ask passphrase and decrypt wallet */
|
2011-08-24 22:07:26 +02:00
|
|
|
};
|
|
|
|
|
|
2013-11-14 19:47:45 +01:00
|
|
|
explicit AskPassphraseDialog(Mode mode, QWidget *parent);
|
2011-08-24 22:07:26 +02:00
|
|
|
~AskPassphraseDialog();
|
|
|
|
|
|
|
|
|
|
void accept();
|
|
|
|
|
|
|
|
|
|
void setModel(WalletModel *model);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Ui::AskPassphraseDialog *ui;
|
|
|
|
|
Mode mode;
|
|
|
|
|
WalletModel *model;
|
2011-10-15 20:56:06 +02:00
|
|
|
bool fCapsLock;
|
2011-08-24 22:07:26 +02:00
|
|
|
|
2015-07-14 13:59:05 +02:00
|
|
|
private Q_SLOTS:
|
2011-08-24 22:07:26 +02:00
|
|
|
void textChanged();
|
2013-11-05 19:18:40 +01:00
|
|
|
|
|
|
|
|
protected:
|
2011-10-15 20:56:06 +02:00
|
|
|
bool event(QEvent *event);
|
2012-10-25 11:52:34 +02:00
|
|
|
bool eventFilter(QObject *object, QEvent *event);
|
2011-08-24 22:07:26 +02:00
|
|
|
};
|
|
|
|
|
|
2018-01-16 10:47:52 +00:00
|
|
|
#endif
|