X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fqt%2Fclientmodel.h;h=c8d30f620562bacd5b35e97b470a8d6da48962b3;hb=aff47bd084ec500155c7ce37f831d260dc6fd8e8;hp=3dfbcecc027918e87038bd6823150403fd2cb918;hpb=98e61758744ed34e8b7f59b37edb6d09b33d5517;p=novacoin.git diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h index 3dfbcec..c8d30f6 100644 --- a/src/qt/clientmodel.h +++ b/src/qt/clientmodel.h @@ -10,6 +10,7 @@ class CWallet; QT_BEGIN_NAMESPACE class QDateTime; +class QTimer; QT_END_NAMESPACE /** Model for Bitcoin network client. */ @@ -18,13 +19,20 @@ class ClientModel : public QObject Q_OBJECT public: explicit ClientModel(OptionsModel *optionsModel, QObject *parent = 0); + ~ClientModel(); OptionsModel *getOptionsModel(); + double getPoSKernelPS(); + double getDifficulty(bool fProofofStake); + int getNumConnections() const; int getNumBlocks() const; int getNumBlocksAtStartup(); + quint64 getTotalBytesRecv() const; + quint64 getTotalBytesSent() const; + QDateTime getLastBlockDate() const; //! Return true if client connected to testnet @@ -37,27 +45,34 @@ public: QString getStatusBarWarnings() const; QString formatFullVersion() const; + QString formatBuildDate() const; + QString clientName() const; + QString formatClientStartupTime() const; private: OptionsModel *optionsModel; - int cachedNumConnections; int cachedNumBlocks; - QString cachedStatusBar; + int cachedNumBlocksOfPeers; int numBlocksAtStartup; + QTimer *pollTimer; + + void subscribeToCoreSignals(); + void unsubscribeFromCoreSignals(); signals: void numConnectionsChanged(int count); - void numBlocksChanged(int count); + void numBlocksChanged(int count, int countOfPeers); + void bytesChanged(quint64 totalBytesIn, quint64 totalBytesOut); //! Asynchronous error notification - void error(const QString &title, const QString &message); + void error(const QString &title, const QString &message, bool modal); public slots: - -private slots: - void update(); + void updateTimer(); + void updateNumConnections(int numConnections); + void updateAlert(const QString &hash, int status); }; #endif // CLIENTMODEL_H