You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

askpassphrasedialog.h 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright (c) 2011-2015 The Starwels developers
  2. // Distributed under the MIT software license, see the accompanying
  3. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  4. #ifndef STARWELS_QT_ASKPASSPHRASEDIALOG_H
  5. #define STARWELS_QT_ASKPASSPHRASEDIALOG_H
  6. #include <QDialog>
  7. class WalletModel;
  8. namespace Ui {
  9. class AskPassphraseDialog;
  10. }
  11. /** Multifunctional dialog to ask for passphrases. Used for encryption, unlocking, and changing the passphrase.
  12. */
  13. class AskPassphraseDialog : public QDialog
  14. {
  15. Q_OBJECT
  16. public:
  17. enum Mode {
  18. Encrypt, /**< Ask passphrase twice and encrypt */
  19. Unlock, /**< Ask passphrase and unlock */
  20. ChangePass, /**< Ask old passphrase + new passphrase twice */
  21. Decrypt /**< Ask passphrase and decrypt wallet */
  22. };
  23. explicit AskPassphraseDialog(Mode mode, QWidget *parent);
  24. ~AskPassphraseDialog();
  25. void accept();
  26. void setModel(WalletModel *model);
  27. private:
  28. Ui::AskPassphraseDialog *ui;
  29. Mode mode;
  30. WalletModel *model;
  31. bool fCapsLock;
  32. private Q_SLOTS:
  33. void textChanged();
  34. void secureClearPassFields();
  35. protected:
  36. bool event(QEvent *event);
  37. bool eventFilter(QObject *object, QEvent *event);
  38. };
  39. #endif // STARWELS_QT_ASKPASSPHRASEDIALOG_H