Fabcoin Core  0.16.2
P2P Digital Currency
Public Types | Public Slots | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
TransactionTableModel Class Reference

UI model for the transaction table of a wallet. More...

#include <transactiontablemodel.h>

Inheritance diagram for TransactionTableModel:
[legend]
Collaboration diagram for TransactionTableModel:
[legend]

Public Types

enum  ColumnIndex {
  Status = 0, Watchonly = 1, Date = 2, Type = 3,
  ToAddress = 4, Amount = 5
}
 
enum  RoleIndex {
  TypeRole = Qt::UserRole, DateRole, WatchonlyRole, WatchonlyDecorationRole,
  LongDescriptionRole, AddressRole, LabelRole, AmountRole,
  TxIDRole, TxHashRole, TxHexRole, TxPlainTextRole,
  ConfirmedRole, FormattedAmountRole, StatusRole, RawDecorationRole
}
 Roles to get specific information from a transaction row. More...
 

Public Slots

void updateTransaction (const QString &hash, int status, bool showTransaction)
 
void updateConfirmations ()
 
void updateDisplayUnit ()
 
void updateAmountColumnTitle ()
 Updates the column title to "Amount (DisplayUnit)" and emits headerDataChanged() signal for table headers to react. More...
 
void setProcessingQueuedTransactions (bool value)
 

Public Member Functions

 TransactionTableModel (const PlatformStyle *platformStyle, 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
 
bool processingQueuedTransactions ()
 

Private Member Functions

void subscribeToCoreSignals ()
 
void unsubscribeFromCoreSignals ()
 
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, FabcoinUnits::SeparatorStyle separators=FabcoinUnits::separatorStandard) const
 
QString formatTooltip (const TransactionRecord *rec) const
 
QVariant txStatusDecoration (const TransactionRecord *wtx) const
 
QVariant txWatchonlyDecoration (const TransactionRecord *wtx) const
 
QVariant txAddressDecoration (const TransactionRecord *wtx) const
 

Private Attributes

CWalletwallet
 
WalletModelwalletModel
 
QStringList columns
 
TransactionTablePrivpriv
 
bool fProcessingQueuedTransactions
 
const PlatformStyleplatformStyle
 

Friends

class TransactionTablePriv
 

Detailed Description

UI model for the transaction table of a wallet.

Definition at line 22 of file transactiontablemodel.h.

Member Enumeration Documentation

Enumerator
Status 
Watchonly 
Date 
Type 
ToAddress 
Amount 

Definition at line 30 of file transactiontablemodel.h.

Roles to get specific information from a transaction row.

These are independent of column.

Enumerator
TypeRole 

Type of transaction.

DateRole 

Date and time this transaction was created.

WatchonlyRole 

Watch-only boolean.

WatchonlyDecorationRole 

Watch-only icon.

LongDescriptionRole 

Long description (HTML format)

AddressRole 

Address of transaction.

LabelRole 

Label of address related to transaction.

AmountRole 

Net amount of transaction.

TxIDRole 

Unique identifier.

TxHashRole 

Transaction hash.

TxHexRole 

Transaction data, hex-encoded.

TxPlainTextRole 

Whole transaction as plain text.

ConfirmedRole 

Is transaction confirmed?

FormattedAmountRole 

Formatted amount, without brackets when unconfirmed.

StatusRole 

Transaction status (TransactionRecord::Status)

RawDecorationRole 

Unprocessed icon.

Definition at line 42 of file transactiontablemodel.h.

Constructor & Destructor Documentation

TransactionTableModel::TransactionTableModel ( const PlatformStyle platformStyle,
CWallet wallet,
WalletModel parent = 0 
)
explicit

Definition at line 240 of file transactiontablemodel.cpp.

Here is the call graph for this function:

TransactionTableModel::~TransactionTableModel ( )

Definition at line 256 of file transactiontablemodel.cpp.

Here is the call graph for this function:

Member Function Documentation

QVariant TransactionTableModel::addressColor ( const TransactionRecord wtx) const
private

Definition at line 441 of file transactiontablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int TransactionTableModel::columnCount ( const QModelIndex &  parent) const

Definition at line 293 of file transactiontablemodel.cpp.

QVariant TransactionTableModel::data ( const QModelIndex &  index,
int  role 
) const

Definition at line 531 of file transactiontablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QString TransactionTableModel::formatTooltip ( const TransactionRecord rec) const
private

Definition at line 520 of file transactiontablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QString TransactionTableModel::formatTxAmount ( const TransactionRecord wtx,
bool  showUnconfirmed = true,
FabcoinUnits::SeparatorStyle  separators = FabcoinUnits::separatorStandard 
) const
private

Definition at line 464 of file transactiontablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QString TransactionTableModel::formatTxDate ( const TransactionRecord wtx) const
private

Definition at line 343 of file transactiontablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QString TransactionTableModel::formatTxStatus ( const TransactionRecord wtx) const
private

Definition at line 299 of file transactiontablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QString TransactionTableModel::formatTxToAddress ( const TransactionRecord wtx,
bool  tooltip 
) const
private

Definition at line 415 of file transactiontablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QString TransactionTableModel::formatTxType ( const TransactionRecord wtx) const
private

Definition at line 370 of file transactiontablemodel.cpp.

Here is the caller graph for this function:

QVariant TransactionTableModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const

Definition at line 670 of file transactiontablemodel.cpp.

QModelIndex TransactionTableModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const

Definition at line 703 of file transactiontablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QString TransactionTableModel::lookupAddress ( const std::string &  address,
bool  tooltip 
) const
private

Definition at line 355 of file transactiontablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool TransactionTableModel::processingQueuedTransactions ( )
inline

Definition at line 82 of file transactiontablemodel.h.

Here is the caller graph for this function:

int TransactionTableModel::rowCount ( const QModelIndex &  parent) const

Definition at line 287 of file transactiontablemodel.cpp.

Here is the call graph for this function:

void TransactionTableModel::setProcessingQueuedTransactions ( bool  value)
inlineslot

Definition at line 115 of file transactiontablemodel.h.

void TransactionTableModel::subscribeToCoreSignals ( )
private

Definition at line 786 of file transactiontablemodel.cpp.

Here is the caller graph for this function:

QVariant TransactionTableModel::txAddressDecoration ( const TransactionRecord wtx) const
private

Definition at line 394 of file transactiontablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QVariant TransactionTableModel::txStatusDecoration ( const TransactionRecord wtx) const
private

Definition at line 477 of file transactiontablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QVariant TransactionTableModel::txWatchonlyDecoration ( const TransactionRecord wtx) const
private

Definition at line 512 of file transactiontablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void TransactionTableModel::unsubscribeFromCoreSignals ( )
private

Definition at line 793 of file transactiontablemodel.cpp.

Here is the caller graph for this function:

void TransactionTableModel::updateAmountColumnTitle ( )
slot

Updates the column title to "Amount (DisplayUnit)" and emits headerDataChanged() signal for table headers to react.

Definition at line 263 of file transactiontablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void TransactionTableModel::updateConfirmations ( )
slot

Definition at line 277 of file transactiontablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void TransactionTableModel::updateDisplayUnit ( )
slot

Definition at line 714 of file transactiontablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void TransactionTableModel::updateTransaction ( const QString &  hash,
int  status,
bool  showTransaction 
)
slot

Definition at line 269 of file transactiontablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class TransactionTablePriv
friend

Definition at line 117 of file transactiontablemodel.h.

Member Data Documentation

QStringList TransactionTableModel::columns
private

Definition at line 87 of file transactiontablemodel.h.

bool TransactionTableModel::fProcessingQueuedTransactions
private

Definition at line 89 of file transactiontablemodel.h.

const PlatformStyle* TransactionTableModel::platformStyle
private

Definition at line 90 of file transactiontablemodel.h.

TransactionTablePriv* TransactionTableModel::priv
private

Definition at line 88 of file transactiontablemodel.h.

CWallet* TransactionTableModel::wallet
private

Definition at line 85 of file transactiontablemodel.h.

WalletModel* TransactionTableModel::walletModel
private

Definition at line 86 of file transactiontablemodel.h.


The documentation for this class was generated from the following files: