#include "guiconstants.h"
#include "transactiondesc.h"
#include "walletmodel.h"
+#include "addresstablemodel.h"
#include "headers.h"
walletModel(parent),
priv(new TransactionTablePriv(wallet, this))
{
- columns << tr("Status") << tr("Date") << tr("Type") << tr("Address") << tr("Amount");
+ columns << QString() << tr("Date") << tr("Type") << tr("Address") << tr("Amount");
priv->refreshWallet();
status = tr("Offline (%1 confirmations)").arg(wtx->status.depth);
break;
case TransactionStatus::Unconfirmed:
- status = tr("Unconfirmed (%1/%2 confirmations)").arg(wtx->status.depth).arg(TransactionRecord::NumConfirmations);
+ status = tr("Unconfirmed (%1 of %2 confirmations required)").arg(wtx->status.depth).arg(TransactionRecord::NumConfirmations);
break;
case TransactionStatus::HaveConfirmations:
status = tr("Confirmed (%1 confirmations)").arg(wtx->status.depth);
}
if(wtx->type == TransactionRecord::Generated)
{
- status += "\n";
+ status += "\n\n";
switch(wtx->status.maturity)
{
case TransactionStatus::Immature:
- status += tr("Generation matures in %n more blocks", "",
+ status += tr("Mined balance will be available in %n more blocks", "",
wtx->status.matures_in);
break;
case TransactionStatus::Mature:
}
/* Look up address in address book, if found return
- address[0:12]... (label)
+ address (label)
otherwise just return address
*/
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())
{
}
else
{
- description = label + QString(" (") + QString::fromStdString(address.substr(0,12)) + QString("...)");
+ description = label + QString(" (") + QString::fromStdString(address) + QString(")");
}
return description;
}
description = tr("Payment to yourself");
break;
case TransactionRecord::Generated:
- description = tr("Generated");
+ description = tr("Mined");
break;
}
return QVariant(description);
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);
}
}
else if (role == LabelRole)
{
- return walletModel->labelForAddress(QString::fromStdString(rec->address));
+ return walletModel->getAddressTableModel()->labelForAddress(QString::fromStdString(rec->address));
}
else if (role == AbsoluteAmountRole)
{
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();
}