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.

bitcoingui.h 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. #ifndef BITCOINGUI_H
  2. #define BITCOINGUI_H
  3. #include <QMainWindow>
  4. #include <QSystemTrayIcon>
  5. class TransactionTableModel;
  6. class ClientModel;
  7. class WalletModel;
  8. class TransactionView;
  9. class OverviewPage;
  10. class AddressBookPage;
  11. class SendCoinsDialog;
  12. QT_BEGIN_NAMESPACE
  13. class QLabel;
  14. class QLineEdit;
  15. class QTableView;
  16. class QAbstractItemModel;
  17. class QModelIndex;
  18. class QProgressBar;
  19. class QStackedWidget;
  20. class QUrl;
  21. QT_END_NAMESPACE
  22. class BitcoinGUI : public QMainWindow
  23. {
  24. Q_OBJECT
  25. public:
  26. explicit BitcoinGUI(QWidget *parent = 0);
  27. void setClientModel(ClientModel *clientModel);
  28. void setWalletModel(WalletModel *walletModel);
  29. /* Transaction table tab indices */
  30. enum {
  31. AllTransactions = 0,
  32. SentReceived = 1,
  33. Sent = 2,
  34. Received = 3
  35. } TabIndex;
  36. protected:
  37. void changeEvent(QEvent *e);
  38. void closeEvent(QCloseEvent *event);
  39. void dragEnterEvent(QDragEnterEvent *event);
  40. void dropEvent(QDropEvent *event);
  41. private:
  42. ClientModel *clientModel;
  43. WalletModel *walletModel;
  44. QStackedWidget *centralWidget;
  45. OverviewPage *overviewPage;
  46. QWidget *transactionsPage;
  47. AddressBookPage *addressBookPage;
  48. AddressBookPage *receiveCoinsPage;
  49. SendCoinsDialog *sendCoinsPage;
  50. QLabel *labelEncryptionIcon;
  51. QLabel *labelConnectionsIcon;
  52. QLabel *labelBlocksIcon;
  53. QLabel *progressBarLabel;
  54. QProgressBar *progressBar;
  55. QAction *overviewAction;
  56. QAction *historyAction;
  57. QAction *quitAction;
  58. QAction *sendCoinsAction;
  59. QAction *addressBookAction;
  60. QAction *aboutAction;
  61. QAction *receiveCoinsAction;
  62. QAction *optionsAction;
  63. QAction *openBitcoinAction;
  64. QAction *exportAction;
  65. QSystemTrayIcon *trayIcon;
  66. TransactionView *transactionView;
  67. QMovie *syncIconMovie;
  68. void createActions();
  69. QWidget *createTabs();
  70. void createTrayIcon();
  71. public slots:
  72. void setNumConnections(int count);
  73. void setNumBlocks(int count);
  74. void setEncryptionStatus(int status);
  75. void error(const QString &title, const QString &message);
  76. /* It is currently not possible to pass a return value to another thread through
  77. BlockingQueuedConnection, so use an indirected pointer.
  78. http://bugreports.qt.nokia.com/browse/QTBUG-10440
  79. */
  80. void askFee(qint64 nFeeRequired, bool *payFee);
  81. private slots:
  82. // UI pages
  83. void gotoOverviewPage();
  84. void gotoHistoryPage();
  85. void gotoAddressBookPage();
  86. void gotoReceiveCoinsPage();
  87. void gotoSendCoinsPage();
  88. // Misc actions
  89. void optionsClicked();
  90. void aboutClicked();
  91. void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
  92. void incomingTransaction(const QModelIndex & parent, int start, int end);
  93. };
  94. #endif