feat: improve query categorisation in Qt App

This commit is contained in:
Konstantin Akimov 2024-08-05 17:15:17 +07:00 committed by pasta
parent c863473286
commit 21f174aff1
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984

View File

@ -431,6 +431,8 @@ QString TransactionTableModel::formatTxType(const TransactionRecord *wtx) const
return tr("Payment to yourself"); return tr("Payment to yourself");
case TransactionRecord::Generated: case TransactionRecord::Generated:
return tr("Mined"); return tr("Mined");
case TransactionRecord::PlatformTransfer:
return tr("Platform Transfer");
case TransactionRecord::CoinJoinMixing: case TransactionRecord::CoinJoinMixing:
return tr("%1 Mixing").arg(QString::fromStdString(gCoinJoinName)); return tr("%1 Mixing").arg(QString::fromStdString(gCoinJoinName));
@ -443,9 +445,10 @@ QString TransactionTableModel::formatTxType(const TransactionRecord *wtx) const
case TransactionRecord::CoinJoinSend: case TransactionRecord::CoinJoinSend:
return tr("%1 Send").arg(QString::fromStdString(gCoinJoinName)); return tr("%1 Send").arg(QString::fromStdString(gCoinJoinName));
default: case TransactionRecord::Other:
return QString(); break; // use fail-over here
} } // no default case, so the compiler can warn about missing cases
return QString();
} }
QVariant TransactionTableModel::txAddressDecoration(const TransactionRecord *wtx) const QVariant TransactionTableModel::txAddressDecoration(const TransactionRecord *wtx) const
@ -473,14 +476,20 @@ QString TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx, b
case TransactionRecord::SendToAddress: case TransactionRecord::SendToAddress:
case TransactionRecord::Generated: case TransactionRecord::Generated:
case TransactionRecord::CoinJoinSend: case TransactionRecord::CoinJoinSend:
case TransactionRecord::PlatformTransfer:
return formatAddressLabel(wtx->strAddress, wtx->label, tooltip) + watchAddress; return formatAddressLabel(wtx->strAddress, wtx->label, tooltip) + watchAddress;
case TransactionRecord::SendToOther: case TransactionRecord::SendToOther:
return QString::fromStdString(wtx->strAddress) + watchAddress; return QString::fromStdString(wtx->strAddress) + watchAddress;
case TransactionRecord::SendToSelf: case TransactionRecord::SendToSelf:
return formatAddressLabel(wtx->strAddress, wtx->label, tooltip) + watchAddress; return formatAddressLabel(wtx->strAddress, wtx->label, tooltip) + watchAddress;
default: case TransactionRecord::CoinJoinMixing:
return tr("(n/a)") + watchAddress; case TransactionRecord::CoinJoinCollateralPayment:
} case TransactionRecord::CoinJoinMakeCollaterals:
case TransactionRecord::CoinJoinCreateDenominations:
case TransactionRecord::Other:
break; // use fail-over here
} // no default case, so the compiler can warn about missing cases
return tr("(n/a)") + watchAddress;
} }
QVariant TransactionTableModel::addressColor(const TransactionRecord *wtx) const QVariant TransactionTableModel::addressColor(const TransactionRecord *wtx) const
@ -491,6 +500,7 @@ QVariant TransactionTableModel::addressColor(const TransactionRecord *wtx) const
case TransactionRecord::RecvWithAddress: case TransactionRecord::RecvWithAddress:
case TransactionRecord::SendToAddress: case TransactionRecord::SendToAddress:
case TransactionRecord::Generated: case TransactionRecord::Generated:
case TransactionRecord::PlatformTransfer:
case TransactionRecord::CoinJoinSend: case TransactionRecord::CoinJoinSend:
case TransactionRecord::RecvWithCoinJoin: case TransactionRecord::RecvWithCoinJoin:
{ {
@ -504,9 +514,11 @@ QVariant TransactionTableModel::addressColor(const TransactionRecord *wtx) const
case TransactionRecord::CoinJoinMakeCollaterals: case TransactionRecord::CoinJoinMakeCollaterals:
case TransactionRecord::CoinJoinCollateralPayment: case TransactionRecord::CoinJoinCollateralPayment:
return GUIUtil::getThemedQColor(GUIUtil::ThemedColor::BAREADDRESS); return GUIUtil::getThemedQColor(GUIUtil::ThemedColor::BAREADDRESS);
default: case TransactionRecord::SendToOther:
case TransactionRecord::RecvFromOther:
case TransactionRecord::Other:
break; break;
} } // no default case, so the compiler can warn about missing cases
return GUIUtil::getThemedQColor(GUIUtil::ThemedColor::DEFAULT); return GUIUtil::getThemedQColor(GUIUtil::ThemedColor::DEFAULT);
} }