diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-07-07 14:27:16 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-07-07 14:27:16 +0200 |
commit | fbaee7a8533b23d846ee16837320f709c4e83d47 (patch) | |
tree | f867d31077177c79d27a2c475fb19b566c5010bf /src/qt/transactiontablemodel.cpp | |
parent | d52a0f3bca2c8df8360308b062185d803e34f0d9 (diff) |
Export functionality for transaction list
Diffstat (limited to 'src/qt/transactiontablemodel.cpp')
-rw-r--r-- | src/qt/transactiontablemodel.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 70dbd0ffec..52c9b0ce84 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -394,12 +394,15 @@ QVariant TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx) return QVariant(description); } -QVariant TransactionTableModel::formatTxAmount(const TransactionRecord *wtx) const +QVariant TransactionTableModel::formatTxAmount(const TransactionRecord *wtx, bool showUnconfirmed) const { QString str = QString::fromStdString(FormatMoney(wtx->credit + wtx->debit)); - if(!wtx->status.confirmed || wtx->status.maturity != TransactionStatus::Mature) + if(showUnconfirmed) { - str = QString("[") + str + QString("]"); + if(!wtx->status.confirmed || wtx->status.maturity != TransactionStatus::Mature) + { + str = QString("[") + str + QString("]"); + } } return QVariant(str); } @@ -541,6 +544,18 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const { return llabs(rec->credit + rec->debit); } + else if (role == TxIDRole) + { + return QString::fromStdString(rec->getTxID()); + } + else if (role == ConfirmedRole) + { + return rec->status.status == TransactionStatus::HaveConfirmations; + } + else if (role == FormattedAmountRole) + { + return formatTxAmount(rec, false); + } return QVariant(); } |