icons test

This commit is contained in:
Wladimir J. van der Laan 2011-06-15 20:07:21 +02:00
parent b1ef1b24ce
commit cf450e1b4c
1 changed files with 6 additions and 5 deletions

View File

@ -10,6 +10,7 @@
#include <QList> #include <QList>
#include <QColor> #include <QColor>
#include <QTimer> #include <QTimer>
#include <QIcon>
#include <QtAlgorithms> #include <QtAlgorithms>
const QString TransactionTableModel::Sent = "s"; const QString TransactionTableModel::Sent = "s";
@ -112,7 +113,7 @@ struct TransactionTablePriv
if(inWallet && !inModel) if(inWallet && !inModel)
{ {
/* Added */ /* Added -- insert at the right position */
QList<TransactionRecord> toInsert = QList<TransactionRecord> toInsert =
TransactionRecord::decomposeTransaction(mi->second); TransactionRecord::decomposeTransaction(mi->second);
if(!toInsert.isEmpty()) /* only if something to insert */ if(!toInsert.isEmpty()) /* only if something to insert */
@ -129,7 +130,7 @@ struct TransactionTablePriv
} }
else if(!inWallet && inModel) else if(!inWallet && inModel)
{ {
/* Removed */ /* Removed -- remove entire transaction from table */
parent->beginRemoveRows(QModelIndex(), lowerIndex, upperIndex-1); parent->beginRemoveRows(QModelIndex(), lowerIndex, upperIndex-1);
cachedWallet.erase(lower, upper); cachedWallet.erase(lower, upper);
parent->endRemoveRows(); parent->endRemoveRows();
@ -413,14 +414,14 @@ QVariant TransactionTableModel::formatTxDecoration(const TransactionRecord *wtx)
case TransactionStatus::Unconfirmed: case TransactionStatus::Unconfirmed:
if(wtx->status.depth) if(wtx->status.depth)
{ {
return QColor(255,0,0); return QIcon(":/icons/bitcoin");
} }
else else
{ {
return QColor(192,192,192); return QIcon::fromTheme("stock_lock.png");
} }
case TransactionStatus::HaveConfirmations: case TransactionStatus::HaveConfirmations:
return QColor(0,255,0); return QIcon::fromTheme("stock_lock-ok.png");
} }
return QColor(0,0,0); return QColor(0,0,0);
} }