Show incoming memos properly
This commit is contained in:
@@ -377,10 +377,15 @@ void Controller::refreshTransactions() {
|
|||||||
address = (it["address"].is_null() ? "" : QString::fromStdString(it["address"]));
|
address = (it["address"].is_null() ? "" : QString::fromStdString(it["address"]));
|
||||||
model->markAddressUsed(address);
|
model->markAddressUsed(address);
|
||||||
|
|
||||||
|
QString memo;
|
||||||
|
if (!it["memo"].is_null()) {
|
||||||
|
memo = QString::fromStdString(it["memo"]);
|
||||||
|
}
|
||||||
|
|
||||||
items.push_back(TransactionItemDetail{
|
items.push_back(TransactionItemDetail{
|
||||||
address,
|
address,
|
||||||
CAmount::fromqint64(it["amount"].get<json::number_integer_t>()),
|
CAmount::fromqint64(it["amount"].get<json::number_integer_t>()),
|
||||||
""
|
memo
|
||||||
});
|
});
|
||||||
|
|
||||||
TransactionItem tx{
|
TransactionItem tx{
|
||||||
|
|||||||
@@ -150,14 +150,14 @@ bool TxTableModel::exportToCsv(QString fileName) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (role == Qt::DecorationRole && index.column() == 0) {
|
if (role == Qt::DecorationRole && index.column() == 0) {
|
||||||
bool hasMemo = false;
|
bool hasMemo = false;
|
||||||
for (int i=0; i < dat.items.length(); i++) {
|
for (int i=0; i < dat.items.length(); i++) {
|
||||||
if (!dat.items[i].memo.isEmpty()) {
|
if (!dat.items[i].memo.isEmpty()) {
|
||||||
hasMemo = true;
|
hasMemo = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the memo is a Payment URI, then show a payment request icon
|
// If the memo is a Payment URI, then show a payment request icon
|
||||||
if (dat.items.length() == 1 && dat.items[0].memo.startsWith("zcash:")) {
|
if (dat.items.length() == 1 && dat.items[0].memo.startsWith("zcash:")) {
|
||||||
QIcon icon(":/icons/res/paymentreq.gif");
|
QIcon icon(":/icons/res/paymentreq.gif");
|
||||||
|
|||||||
Reference in New Issue
Block a user