7 class AddressTableModel;
8 class TransactionTableModel;
16 /** Model for Bitcoin network client. */
17 class ClientModel : public QObject
21 explicit ClientModel(OptionsModel *optionsModel, QObject *parent = 0);
24 OptionsModel *getOptionsModel();
26 int getNumConnections() const;
27 int getNumBlocks() const;
28 int getNumBlocksAtStartup();
30 QDateTime getLastBlockDate() const;
32 //! Return true if client connected to testnet
33 bool isTestNet() const;
34 //! Return true if core is doing initial block download
35 bool inInitialBlockDownload() const;
36 //! Return conservative estimate of total number of blocks, or 0 if unknown
37 int getNumBlocksOfPeers() const;
38 //! Return warnings to be displayed in status bar
39 QString getStatusBarWarnings() const;
41 QString formatFullVersion() const;
42 QString formatBuildDate() const;
43 QString clientName() const;
44 QString formatClientStartupTime() const;
47 OptionsModel *optionsModel;
50 int cachedNumBlocksOfPeers;
52 int numBlocksAtStartup;
56 void subscribeToCoreSignals();
57 void unsubscribeFromCoreSignals();
59 void numConnectionsChanged(int count);
60 void numBlocksChanged(int count, int countOfPeers);
62 //! Asynchronous error notification
63 void error(const QString &title, const QString &message, bool modal);
67 void updateNumConnections(int numConnections);
68 void updateAlert(const QString &hash, int status);
71 #endif // CLIENTMODEL_H