GUI: TransactionRecord: When time/index/etc match, sort fee, issuance, send, then receive

This commit is contained in:
Luke Dashjr 2018-12-15 22:49:26 +00:00 committed by Gregory Sanders
parent 51e789722f
commit 4ea8f88274
2 changed files with 24 additions and 3 deletions

View file

@ -189,11 +189,32 @@ void TransactionRecord::updateStatus(const interfaces::WalletTxStatus& wtx, int
// Determine transaction status
// Sort order, unrecorded transactions sort to the top
status.sortKey = strprintf("%010d-%01d-%010u-%03d",
int typesort;
switch (type) {
case Fee:
typesort = 0;
break;
case IssuedAsset:
typesort = 1;
break;
case SendToAddress:
case SendToOther:
case SendToSelf:
typesort = 2;
break;
case RecvWithAddress:
case RecvFromOther:
typesort = 3;
break;
default:
typesort = 10;
}
status.sortKey = strprintf("%010d-%01d-%010u-%03d-%d",
wtx.block_height,
wtx.is_coinbase ? 1 : 0,
wtx.time_received,
idx);
idx,
typesort);
status.countsForBalance = wtx.is_trusted && !(wtx.blocks_to_maturity > 0);
status.depth = wtx.depth_in_main_chain;
status.cur_num_blocks = numBlocks;

View file

@ -554,7 +554,7 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const
case Status:
return QString::fromStdString(rec->status.sortKey);
case Date:
return rec->time;
return QString::fromStdString(strprintf("%020-%s", rec->time, rec->status.sortKey));
case Type:
return formatTxType(rec);
case Watchonly: