|
|
@ -162,7 +162,7 @@ void TxTableModel::updateAllData() { |
|
|
|
|
|
|
|
if (role == Qt::DecorationRole && index.column() == 0) { |
|
|
|
|
|
|
|
qDebug() << "TX Type = " + dat.type; |
|
|
|
//qDebug() << "TX Type = " + dat.type;
|
|
|
|
|
|
|
|
if (!dat.memo.isEmpty()) { |
|
|
|
// If the memo is a Payment URI, then show a payment request icon
|
|
|
@ -176,9 +176,29 @@ void TxTableModel::updateAllData() { |
|
|
|
} |
|
|
|
} else { |
|
|
|
// TODO: Add appropriate icons for types of txs instead of empty pixmap
|
|
|
|
//if(this->getType(index.row()) == "incoming"){}
|
|
|
|
//qDebug() << "Type = " +getType(index.row()) + "Address = " +getAddr(index.row()) + "From Address = " +getFromAddr(index.row());
|
|
|
|
|
|
|
|
// Empty pixmap to make it align
|
|
|
|
// Send
|
|
|
|
if(this->getType(index.row()) == "send"){ |
|
|
|
QIcon icon(":/icons/res/tx_output.png"); |
|
|
|
return QVariant(icon.pixmap(16, 16)); |
|
|
|
} |
|
|
|
|
|
|
|
// Send T->Z - Untested
|
|
|
|
if(this->getType(index.row()) == "send" && !this->getFromAddr(index.row()).startsWith("zs1")){ |
|
|
|
QIcon icon(":/icons/res/lock_closed.png"); |
|
|
|
return QVariant(icon.pixmap(16, 16)); |
|
|
|
} |
|
|
|
|
|
|
|
// Receive
|
|
|
|
if(this->getType(index.row()) == "receive"){ |
|
|
|
QIcon icon(":/icons/res/tx_input.png"); |
|
|
|
return QVariant(icon.pixmap(16, 16)); |
|
|
|
} |
|
|
|
|
|
|
|
// TODO: Maybe detect mining/coinbase reward and show mining icon
|
|
|
|
|
|
|
|
// Empty pixmap to make it align (old behavior)
|
|
|
|
QPixmap p(16, 16); |
|
|
|
p.fill(Qt::white); |
|
|
|
return QVariant(p); |
|
|
@ -222,6 +242,10 @@ QString TxTableModel::getAddr(int row) const { |
|
|
|
return modeldata->at(row).address.trimmed(); |
|
|
|
} |
|
|
|
|
|
|
|
QString TxTableModel::getFromAddr(int row) const { |
|
|
|
return modeldata->at(row).fromAddr.trimmed(); |
|
|
|
} |
|
|
|
|
|
|
|
qint64 TxTableModel::getDate(int row) const { |
|
|
|
return modeldata->at(row).datetime; |
|
|
|
} |
|
|
|