diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-10-28 19:52:21 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-10-28 21:20:55 +0100 |
commit | 023e63df78b847812040bf6958c97476606dfbfd (patch) | |
tree | 047396bfc6c1490db1a3bcfc95e8f4db03c26780 /src/qt/transactiontablemodel.h | |
parent | cd9114e5136ecc1f60baa43fffeeb632782f2353 (diff) |
qt: Move transaction notification to transaction table model
Move transaction new/update notification to TransactionTableModel.
This moves the concerns to where they're actually handled.
No need to bounce this through wallet model.
- Do wallet transaction preprocessing on signal handler side;
avoids locking cs_main/cs_wallet on notification in GUI thread
(except for new transactions)
Diffstat (limited to 'src/qt/transactiontablemodel.h')
-rw-r--r-- | src/qt/transactiontablemodel.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/qt/transactiontablemodel.h b/src/qt/transactiontablemodel.h index 413f3f9bf1..bb517a969c 100644 --- a/src/qt/transactiontablemodel.h +++ b/src/qt/transactiontablemodel.h @@ -72,12 +72,17 @@ public: QVariant data(const QModelIndex &index, int role) const; QVariant headerData(int section, Qt::Orientation orientation, int role) const; QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const; + bool processingQueuedTransactions() { return fProcessingQueuedTransactions; } private: CWallet* wallet; WalletModel *walletModel; QStringList columns; TransactionTablePriv *priv; + bool fProcessingQueuedTransactions; + + void subscribeToCoreSignals(); + void unsubscribeFromCoreSignals(); QString lookupAddress(const std::string &address, bool tooltip) const; QVariant addressColor(const TransactionRecord *wtx) const; @@ -92,11 +97,14 @@ private: QVariant txAddressDecoration(const TransactionRecord *wtx) const; public slots: - void updateTransaction(const QString &hash, int status); + /* New transaction, or transaction changed status */ + void updateTransaction(const QString &hash, int status, bool showTransaction); void updateConfirmations(); void updateDisplayUnit(); /** Updates the column title to "Amount (DisplayUnit)" and emits headerDataChanged() signal for table headers to react. */ void updateAmountColumnTitle(); + /* Needed to update fProcessingQueuedTransactions through a QueuedConnection */ + void setProcessingQueuedTransactions(bool value) { fProcessingQueuedTransactions = value; } friend class TransactionTablePriv; }; |