mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
GUI: TransactionRecord: When time/index/etc match, sort fee, issuance, send, then receive
This commit is contained in:
parent
51e789722f
commit
4ea8f88274
2 changed files with 24 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue