2013-11-04 12:20:43 -03:00
|
|
|
// Copyright (c) 2011-2013 The Bitcoin developers
|
|
|
|
// Distributed under the MIT/X11 software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2011-08-24 17:07:26 -03:00
|
|
|
#ifndef ASKPASSPHRASEDIALOG_H
|
|
|
|
#define ASKPASSPHRASEDIALOG_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
2013-04-13 02:13:08 -03:00
|
|
|
class WalletModel;
|
|
|
|
|
2011-08-24 17:07:26 -03:00
|
|
|
namespace Ui {
|
|
|
|
class AskPassphraseDialog;
|
|
|
|
}
|
|
|
|
|
2011-11-13 09:19:52 -03:00
|
|
|
/** Multifunctional dialog to ask for passphrases. Used for encryption, unlocking, and changing the passphrase.
|
|
|
|
*/
|
2011-08-24 17:07:26 -03:00
|
|
|
class AskPassphraseDialog : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
enum Mode {
|
2011-11-13 09:19:52 -03: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 17:07:26 -03:00
|
|
|
};
|
|
|
|
|
2013-11-14 15:47:45 -03:00
|
|
|
explicit AskPassphraseDialog(Mode mode, QWidget *parent);
|
2011-08-24 17:07:26 -03:00
|
|
|
~AskPassphraseDialog();
|
|
|
|
|
|
|
|
void accept();
|
|
|
|
|
|
|
|
void setModel(WalletModel *model);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::AskPassphraseDialog *ui;
|
|
|
|
Mode mode;
|
|
|
|
WalletModel *model;
|
2011-10-15 15:56:06 -03:00
|
|
|
bool fCapsLock;
|
2011-08-24 17:07:26 -03:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void textChanged();
|
2013-11-05 15:18:40 -03:00
|
|
|
|
|
|
|
protected:
|
2011-10-15 15:56:06 -03:00
|
|
|
bool event(QEvent *event);
|
2012-10-25 06:52:34 -03:00
|
|
|
bool eventFilter(QObject *object, QEvent *event);
|
2011-08-24 17:07:26 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ASKPASSPHRASEDIALOG_H
|