2011-08-24 22:07:26 +02:00
|
|
|
#ifndef ASKPASSPHRASEDIALOG_H
|
|
|
|
#define ASKPASSPHRASEDIALOG_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class AskPassphraseDialog;
|
|
|
|
}
|
|
|
|
|
|
|
|
class WalletModel;
|
|
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
explicit AskPassphraseDialog(Mode mode, QWidget *parent = 0);
|
|
|
|
~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
|
|
|
|
|
|
|
private slots:
|
|
|
|
void textChanged();
|
2011-10-15 20:56:06 +02:00
|
|
|
bool event(QEvent *event);
|
|
|
|
bool eventFilter(QObject *, QEvent *event);
|
2011-08-24 22:07:26 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ASKPASSPHRASEDIALOG_H
|