#include "guiconstants.h"
#include "transactiondesc.h"
#include "walletmodel.h"
+#include "optionsmodel.h"
+#include "addresstablemodel.h"
+#include "bitcoinunits.h"
#include "headers.h"
*/
QString TransactionTableModel::lookupAddress(const std::string &address) const
{
- QString label = walletModel->labelForAddress(QString::fromStdString(address));
+ QString label = walletModel->getAddressTableModel()->labelForAddress(QString::fromStdString(address));
QString description;
if(label.isEmpty())
{
QVariant TransactionTableModel::formatTxAmount(const TransactionRecord *wtx, bool showUnconfirmed) const
{
- QString str = QString::fromStdString(FormatMoney(wtx->credit + wtx->debit));
+ QString str = BitcoinUnits::format(walletModel->getOptionsModel()->getDisplayUnit(), wtx->credit + wtx->debit);
if(showUnconfirmed)
{
if(!wtx->status.confirmed || wtx->status.maturity != TransactionStatus::Mature)
/* Non-confirmed transactions are grey */
if(!rec->status.confirmed)
{
- return QColor(128, 128, 128);
+ return COLOR_UNCONFIRMED;
}
if(index.column() == Amount && (rec->credit+rec->debit) < 0)
{
- return QColor(255, 0, 0);
+ return COLOR_NEGATIVE;
}
}
else if (role == TypeRole)
}
else if (role == LabelRole)
{
- return walletModel->labelForAddress(QString::fromStdString(rec->address));
+ return walletModel->getAddressTableModel()->labelForAddress(QString::fromStdString(rec->address));
}
else if (role == AbsoluteAmountRole)
{