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.

walletframe.h 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. // Copyright (c) 2011-2016 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_WALLETFRAME_H
  5. #define STARWELS_QT_WALLETFRAME_H
  6. #include <QFrame>
  7. #include <QMap>
  8. class StarwelsGUI;
  9. class ClientModel;
  10. class PlatformStyle;
  11. class SendCoinsRecipient;
  12. class WalletModel;
  13. class WalletView;
  14. QT_BEGIN_NAMESPACE
  15. class QStackedWidget;
  16. QT_END_NAMESPACE
  17. /**
  18. * A container for embedding all wallet-related
  19. * controls into StarwelsGUI. The purpose of this class is to allow future
  20. * refinements of the wallet controls with minimal need for further
  21. * modifications to StarwelsGUI, thus greatly simplifying merges while
  22. * reducing the risk of breaking top-level stuff.
  23. */
  24. class WalletFrame : public QFrame
  25. {
  26. Q_OBJECT
  27. public:
  28. explicit WalletFrame(const PlatformStyle *platformStyle, StarwelsGUI *_gui = 0);
  29. ~WalletFrame();
  30. void setClientModel(ClientModel *clientModel);
  31. bool addWallet(const QString& name, WalletModel *walletModel);
  32. bool setCurrentWallet(const QString& name);
  33. bool removeWallet(const QString &name);
  34. void removeAllWallets();
  35. bool handlePaymentRequest(const SendCoinsRecipient& recipient);
  36. void showOutOfSyncWarning(bool fShow);
  37. Q_SIGNALS:
  38. /** Notify that the user has requested more information about the out-of-sync warning */
  39. void requestedSyncWarningInfo();
  40. private:
  41. QStackedWidget *walletStack;
  42. StarwelsGUI *gui;
  43. ClientModel *clientModel;
  44. QMap<QString, WalletView*> mapWalletViews;
  45. bool bOutOfSync;
  46. const PlatformStyle *platformStyle;
  47. WalletView *currentWalletView();
  48. public Q_SLOTS:
  49. /** Switch to overview (home) page */
  50. void gotoOverviewPage();
  51. /** Switch to history (transactions) page */
  52. void gotoHistoryPage();
  53. /** Switch to receive coins page */
  54. void gotoReceiveCoinsPage();
  55. /** Switch to send coins page */
  56. void gotoSendCoinsPage(QString addr = "");
  57. /** Show Sign/Verify Message dialog and switch to sign message tab */
  58. void gotoSignMessageTab(QString addr = "");
  59. /** Show Sign/Verify Message dialog and switch to verify message tab */
  60. void gotoVerifyMessageTab(QString addr = "");
  61. /** Encrypt the wallet */
  62. void encryptWallet(bool status);
  63. /** Backup the wallet */
  64. void backupWallet();
  65. /** Change encrypted wallet passphrase */
  66. void changePassphrase();
  67. /** Ask for passphrase to unlock wallet temporarily */
  68. void unlockWallet();
  69. /** Show used sending addresses */
  70. void usedSendingAddresses();
  71. /** Show used receiving addresses */
  72. void usedReceivingAddresses();
  73. /** Pass on signal over requested out-of-sync-warning information */
  74. void outOfSyncWarningClicked();
  75. };
  76. #endif // STARWELS_QT_WALLETFRAME_H