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.5KB

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