2015-12-13 17:58:29 +01:00
|
|
|
// Copyright (c) 2011-2015 The Bitcoin Core developers
|
2014-12-13 05:09:33 +01:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
2013-11-04 16:20:43 +01:00
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2014-11-03 16:16:40 +01:00
|
|
|
#ifndef BITCOIN_QT_ASKPASSPHRASEDIALOG_H
|
|
|
|
#define BITCOIN_QT_ASKPASSPHRASEDIALOG_H
|
2011-08-24 22:07:26 +02:00
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
2013-04-13 07:13:08 +02: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
|
|
|
};
|
|
|
|
|
2014-11-03 16:16:40 +01:00
|
|
|
#endif // BITCOIN_QT_ASKPASSPHRASEDIALOG_H
|