Feathercoin  0.5.0
P2P Digital Currency
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
clientmodel.h
Go to the documentation of this file.
1 #ifndef CLIENTMODEL_H
2 #define CLIENTMODEL_H
3 
4 #include <QObject>
5 
6 class OptionsModel;
9 class CWallet;
10 
11 QT_BEGIN_NAMESPACE
12 class QDateTime;
13 class QTimer;
14 QT_END_NAMESPACE
15 
21 };
22 
24 class ClientModel : public QObject
25 {
26  Q_OBJECT
27 
28 public:
29  explicit ClientModel(OptionsModel *optionsModel, QObject *parent = 0);
30  ~ClientModel();
31 
33 
34  int getNumConnections() const;
35  int getNumBlocks() const;
37 
38  double getVerificationProgress() const;
39  QDateTime getLastBlockDate() const;
40 
42  bool isTestNet() const;
44  bool inInitialBlockDownload() const;
46  enum BlockSource getBlockSource() const;
48  int getNumBlocksOfPeers() const;
50  QString getStatusBarWarnings() const;
51 
52  QString formatFullVersion() const;
53  QString formatBuildDate() const;
54  bool isReleaseVersion() const;
55  QString clientName() const;
56  QString formatClientStartupTime() const;
57 
58 private:
60 
65 
67 
68  QTimer *pollTimer;
69 
72 
73 signals:
74  void numConnectionsChanged(int count);
75  void numBlocksChanged(int count, int countOfPeers);
76  void alertsChanged(const QString &warnings);
77 
79  void message(const QString &title, const QString &message, unsigned int style);
80 
81 public slots:
82  void updateTimer();
83  void updateNumConnections(int numConnections);
84  void updateAlert(const QString &hash, int status);
85 };
86 
87 #endif // CLIENTMODEL_H
void message(const QString &title, const QString &message, unsigned int style)
Asynchronous message notification.
OptionsModel * getOptionsModel()
QString formatClientStartupTime() const
int getNumBlocksOfPeers() const
Return conservative estimate of total number of blocks, or 0 if unknown.
QString getStatusBarWarnings() const
Return warnings to be displayed in status bar.
void numConnectionsChanged(int count)
bool isReleaseVersion() const
void numBlocksChanged(int count, int countOfPeers)
void alertsChanged(const QString &warnings)
bool inInitialBlockDownload() const
Return true if core is doing initial block download.
int getNumConnections() const
Definition: clientmodel.cpp:37
bool cachedImporting
Definition: clientmodel.h:64
double getVerificationProgress() const
Definition: clientmodel.cpp:63
QDateTime getLastBlockDate() const
Definition: clientmodel.cpp:53
BlockSource
Definition: clientmodel.h:16
void updateAlert(const QString &hash, int status)
Definition: clientmodel.cpp:94
void unsubscribeFromCoreSignals()
QString clientName() const
void subscribeToCoreSignals()
QString formatBuildDate() const
UI model for the transaction table of a wallet.
Model for Bitcoin network client.
Definition: clientmodel.h:24
int cachedNumBlocks
Definition: clientmodel.h:61
QTimer * pollTimer
Definition: clientmodel.h:68
Qt model of the address book in the core.
int getNumBlocks() const
Definition: clientmodel.cpp:42
int cachedNumBlocksOfPeers
Definition: clientmodel.h:62
int numBlocksAtStartup
Definition: clientmodel.h:66
bool cachedReindexing
Definition: clientmodel.h:63
ClientModel(OptionsModel *optionsModel, QObject *parent=0)
Definition: clientmodel.cpp:18
Interface from Qt to configuration data structure for Bitcoin client.
Definition: optionsmodel.h:12
void updateTimer()
Definition: clientmodel.cpp:68
bool isTestNet() const
Return true if client connected to testnet.
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
Definition: wallet.h:69
OptionsModel * optionsModel
Definition: clientmodel.h:59
int getNumBlocksAtStartup()
Definition: clientmodel.cpp:47
void updateNumConnections(int numConnections)
Definition: clientmodel.cpp:89
QString formatFullVersion() const
uint32_t hash
Definition: cache.cc:34
enum BlockSource getBlockSource() const
Return true if core is importing blocks.