![]() |
Master Core
v0.0.9 - 49a5c0d97abf09ef2911ddfe8d9551df59f9efd3-dirty
|
UI model for the transaction table of a wallet. More...
#include <transactiontablemodel.h>
Public Types | |
enum | ColumnIndex { Status = 0, Date = 1, Type = 2, ToAddress = 3, Amount = 4 } |
enum | RoleIndex { TypeRole = Qt::UserRole, DateRole, LongDescriptionRole, AddressRole, LabelRole, AmountRole, TxIDRole, TxHashRole, ConfirmedRole, FormattedAmountRole, StatusRole } |
Roles to get specific information from a transaction row. More... | |
Public Slots | |
void | updateTransaction (const QString &hash, int status) |
void | updateConfirmations () |
void | updateDisplayUnit () |
Public Member Functions | |
TransactionTableModel (CWallet *wallet, WalletModel *parent=0) | |
~TransactionTableModel () | |
int | rowCount (const QModelIndex &parent) const |
int | columnCount (const QModelIndex &parent) const |
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 |
Private Member Functions | |
QString | lookupAddress (const std::string &address, bool tooltip) const |
QVariant | addressColor (const TransactionRecord *wtx) const |
QString | formatTxStatus (const TransactionRecord *wtx) const |
QString | formatTxDate (const TransactionRecord *wtx) const |
QString | formatTxType (const TransactionRecord *wtx) const |
QString | formatTxToAddress (const TransactionRecord *wtx, bool tooltip) const |
QString | formatTxAmount (const TransactionRecord *wtx, bool showUnconfirmed=true) const |
QString | formatTooltip (const TransactionRecord *rec) const |
QVariant | txStatusDecoration (const TransactionRecord *wtx) const |
QVariant | txAddressDecoration (const TransactionRecord *wtx) const |
Private Attributes | |
CWallet * | wallet |
WalletModel * | walletModel |
QStringList | columns |
TransactionTablePriv * | priv |
Friends | |
class | TransactionTablePriv |
UI model for the transaction table of a wallet.
Definition at line 21 of file transactiontablemodel.h.
Enumerator | |
---|---|
Status | |
Date | |
Type | |
ToAddress | |
Amount |
Definition at line 29 of file transactiontablemodel.h.
Roles to get specific information from a transaction row.
These are independent of column.
Definition at line 40 of file transactiontablemodel.h.
|
explicit |
Definition at line 277 of file transactiontablemodel.cpp.
References columns, WalletModel::getOptionsModel(), priv, TransactionTablePriv::refreshWallet(), updateDisplayUnit(), and walletModel.
TransactionTableModel::~TransactionTableModel | ( | ) |
Definition at line 290 of file transactiontablemodel.cpp.
References priv.
|
private |
Definition at line 452 of file transactiontablemodel.cpp.
References TransactionRecord::address, COLOR_BAREADDRESS, TransactionRecord::Generated, WalletModel::getAddressTableModel(), AddressTableModel::labelForAddress(), TransactionRecord::RecvWithAddress, TransactionRecord::SendToAddress, TransactionRecord::SendToSelf, TransactionRecord::type, and walletModel.
Referenced by data().
int TransactionTableModel::columnCount | ( | const QModelIndex & | parent | ) | const |
Definition at line 319 of file transactiontablemodel.cpp.
References columns.
QVariant TransactionTableModel::data | ( | const QModelIndex & | index, |
int | role | ||
) | const |
Definition at line 533 of file transactiontablemodel.cpp.
References TransactionRecord::address, addressColor(), AddressRole, Amount, AmountRole, COLOR_NEGATIVE, COLOR_UNCONFIRMED, ConfirmedRole, TransactionStatus::countsForBalance, TransactionRecord::credit, Date, DateRole, TransactionRecord::debit, TransactionTablePriv::describe(), FormattedAmountRole, formatTooltip(), formatTxAmount(), formatTxDate(), formatTxToAddress(), formatTxType(), WalletModel::getAddressTableModel(), OptionsModel::getDisplayUnit(), WalletModel::getOptionsModel(), TransactionRecord::getTxID(), TransactionRecord::hash, TransactionStatus::Immature, AddressTableModel::labelForAddress(), LabelRole, LongDescriptionRole, priv, TransactionStatus::sortKey, Status, TransactionStatus::status, TransactionRecord::status, StatusRole, TransactionRecord::time, ToAddress, base_uint< BITS >::ToString(), txAddressDecoration(), TxHashRole, TxIDRole, txStatusDecoration(), Type, TransactionRecord::type, TypeRole, and walletModel.
Referenced by index().
|
private |
Definition at line 522 of file transactiontablemodel.cpp.
References formatTxStatus(), formatTxToAddress(), formatTxType(), TransactionRecord::RecvFromOther, TransactionRecord::RecvWithAddress, TransactionRecord::SendToAddress, TransactionRecord::SendToOther, and TransactionRecord::type.
Referenced by data().
|
private |
Definition at line 473 of file transactiontablemodel.cpp.
References TransactionStatus::countsForBalance, TransactionRecord::credit, TransactionRecord::debit, BitcoinUnits::format(), OptionsModel::getDisplayUnit(), WalletModel::getOptionsModel(), TransactionRecord::status, and walletModel.
Referenced by data().
|
private |
Definition at line 366 of file transactiontablemodel.cpp.
References GUIUtil::dateTimeStr(), and TransactionRecord::time.
Referenced by data().
|
private |
Definition at line 325 of file transactiontablemodel.cpp.
References TransactionStatus::Confirmed, TransactionStatus::Confirming, TransactionStatus::Conflicted, GUIUtil::dateTimeStr(), TransactionStatus::depth, TransactionStatus::Immature, TransactionStatus::matures_in, TransactionStatus::MaturesWarning, TransactionStatus::NotAccepted, TransactionStatus::Offline, TransactionStatus::open_for, TransactionStatus::OpenUntilBlock, TransactionStatus::OpenUntilDate, TransactionRecord::RecommendedNumConfirmations, TransactionStatus::status, TransactionRecord::status, and TransactionStatus::Unconfirmed.
Referenced by formatTooltip().
|
private |
Definition at line 434 of file transactiontablemodel.cpp.
References TransactionRecord::address, TransactionRecord::Generated, lookupAddress(), TransactionRecord::RecvFromOther, TransactionRecord::RecvWithAddress, TransactionRecord::SendToAddress, TransactionRecord::SendToOther, TransactionRecord::SendToSelf, and TransactionRecord::type.
Referenced by data(), and formatTooltip().
|
private |
Definition at line 396 of file transactiontablemodel.cpp.
References TransactionRecord::Generated, TransactionRecord::RecvFromOther, TransactionRecord::RecvWithAddress, TransactionRecord::SendToAddress, TransactionRecord::SendToOther, TransactionRecord::SendToSelf, and TransactionRecord::type.
Referenced by data(), and formatTooltip().
QModelIndex TransactionTableModel::index | ( | int | row, |
int | column, | ||
const QModelIndex & | parent = QModelIndex() |
||
) | const |
Definition at line 655 of file transactiontablemodel.cpp.
References data(), TransactionTablePriv::index(), and priv.
Referenced by WalletView::processNewTransaction(), updateConfirmations(), and updateDisplayUnit().
|
private |
Definition at line 381 of file transactiontablemodel.cpp.
References WalletModel::getAddressTableModel(), OptionsModel::getDisplayAddresses(), WalletModel::getOptionsModel(), AddressTableModel::labelForAddress(), and walletModel.
Referenced by formatTxToAddress().
int TransactionTableModel::rowCount | ( | const QModelIndex & | parent | ) | const |
Definition at line 313 of file transactiontablemodel.cpp.
References priv, and TransactionTablePriv::size().
|
private |
Definition at line 416 of file transactiontablemodel.cpp.
References TransactionRecord::Generated, TransactionRecord::RecvFromOther, TransactionRecord::RecvWithAddress, TransactionRecord::SendToAddress, TransactionRecord::SendToOther, and TransactionRecord::type.
Referenced by data().
|
private |
Definition at line 486 of file transactiontablemodel.cpp.
References TransactionStatus::Confirmed, TransactionStatus::Confirming, TransactionStatus::Conflicted, TransactionStatus::depth, TransactionStatus::Immature, TransactionStatus::matures_in, TransactionStatus::MaturesWarning, TransactionStatus::NotAccepted, TransactionStatus::Offline, TransactionStatus::OpenUntilBlock, TransactionStatus::OpenUntilDate, TransactionStatus::status, TransactionRecord::status, and TransactionStatus::Unconfirmed.
Referenced by data().
|
slot |
Definition at line 303 of file transactiontablemodel.cpp.
References index(), priv, TransactionTablePriv::size(), Status, and ToAddress.
Referenced by WalletModel::pollBalanceChanged().
|
slot |
Definition at line 669 of file transactiontablemodel.cpp.
References Amount, index(), priv, and TransactionTablePriv::size().
Referenced by TransactionTableModel().
|
slot |
Definition at line 295 of file transactiontablemodel.cpp.
References priv, base_uint< BITS >::SetHex(), and TransactionTablePriv::updateWallet().
Referenced by WalletModel::updateTransaction().
|
friend |
Definition at line 93 of file transactiontablemodel.h.
|
private |
Definition at line 74 of file transactiontablemodel.h.
Referenced by columnCount(), headerData(), and TransactionTableModel().
|
private |
Definition at line 75 of file transactiontablemodel.h.
Referenced by data(), index(), rowCount(), TransactionTableModel(), updateConfirmations(), updateDisplayUnit(), updateTransaction(), and ~TransactionTableModel().
|
private |
Definition at line 72 of file transactiontablemodel.h.
|
private |
Definition at line 73 of file transactiontablemodel.h.
Referenced by addressColor(), data(), formatTxAmount(), lookupAddress(), and TransactionTableModel().