Skip to content

Commit

Permalink
Add RecvWithShieldedAddressMemo enum to TransactionRecord
Browse files Browse the repository at this point in the history
Add new icon for memo and add to qrc/makefile

Remove CSS from RecvWithShieldedAddressMemo

Add css

Adjust CSS
  • Loading branch information
Liquid369 committed May 16, 2023
1 parent aca81a1 commit 2543f6b
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,9 @@ RES_ICONS = \
qt/pivx/res/img/ic-check-tor.svg \
qt/pivx/res/img/ic-label.svg \
qt/pivx/res/img/ic-transaction-received.svg \
qt/pivx/res/img/ic-transaction-received-memo.svg \
qt/pivx/res/img/dark/ic-transaction-received.svg \
qt/pivx/res/img/dark/ic-transaction-received-memo.svg \
qt/pivx/res/img/dark/ic-transaction-warning.svg \
qt/pivx/res/img/dark/ic-transaction-mint.svg \
qt/pivx/res/img/dark/ic-transaction-mint-inactive.svg \
Expand Down
2 changes: 2 additions & 0 deletions src/qt/pivx.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,12 @@
<file alias="ic-transaction-warning">pivx/res/img/ic-transaction-warning.svg</file>
<file alias="ic-transaction-mint">pivx/res/img/ic-transaction-mint.svg</file>
<file alias="ic-transaction-received">pivx/res/img/ic-transaction-received.svg</file>
<file alias="ic-transaction-received-memo">pivx/res/img/ic-transaction-received-memo.svg</file>
<file alias="ic-transaction-sent">pivx/res/img/ic-transaction-sent.svg</file>
<file alias="ic-transaction-staked">pivx/res/img/ic-transaction-staked.svg</file>
<file alias="ic-transaction-mint-dark">pivx/res/img/dark/ic-transaction-mint.svg</file>
<file alias="ic-transaction-received-dark">pivx/res/img/dark/ic-transaction-received.svg</file>
<file alias="ic-transaction-received-memo-dark">pivx/res/img/dark/ic-transaction-received-memo.svg</file>
<file alias="ic-transaction-sent-dark">pivx/res/img/dark/ic-transaction-sent.svg</file>
<file alias="ic-transaction-staked-dark">pivx/res/img/dark/ic-transaction-staked.svg</file>
<file alias="ic-transaction-mint-inactive">pivx/res/img/ic-transaction-mint-inactive.svg</file>
Expand Down
4 changes: 3 additions & 1 deletion src/qt/pivx/qtutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,16 @@ void setSortTxTypeFilter(QComboBox* filter, SortEdit* lineEditType)
filter->addItem(QObject::tr("Received"),
TransactionFilterProxy::TYPE(TransactionRecord::RecvWithAddress) |
TransactionFilterProxy::TYPE(TransactionRecord::RecvFromOther) |
TransactionFilterProxy::TYPE(TransactionRecord::RecvWithShieldedAddress));
TransactionFilterProxy::TYPE(TransactionRecord::RecvWithShieldedAddress) |
TransactionFilterProxy::TYPE(TransactionRecord::RecvWithShieldedAddressMemo));
filter->addItem(QObject::tr("Sent"),
TransactionFilterProxy::TYPE(TransactionRecord::SendToAddress) |
TransactionFilterProxy::TYPE(TransactionRecord::SendToOther) |
TransactionFilterProxy::TYPE(TransactionRecord::SendToShielded) |
TransactionFilterProxy::TYPE(TransactionRecord::SendToNobody));
filter->addItem(QObject::tr("Shield"),
TransactionFilterProxy::TYPE(TransactionRecord::RecvWithShieldedAddress) |
TransactionFilterProxy::TYPE(TransactionRecord::RecvWithShieldedAddressMemo) |
TransactionFilterProxy::TYPE(TransactionRecord::SendToShielded) |
TransactionFilterProxy::TYPE(TransactionRecord::SendToSelfShieldToShieldChangeAddress) |
TransactionFilterProxy::TYPE(TransactionRecord::SendToSelfShieldToTransparent) |
Expand Down
4 changes: 4 additions & 0 deletions src/qt/pivx/res/img/dark/ic-transaction-received-memo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/qt/pivx/res/img/ic-transaction-received-memo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/qt/pivx/txrow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ void TxRow::setType(bool isLightTheme, int type, bool isConfirmed)
path = "://ic-transaction-received";
css = "text-list-amount-receive";
break;
case TransactionRecord::RecvWithShieldedAddressMemo:
path = "://ic-transaction-received-memo";
css = "text-list-amount-receive";
break;
case TransactionRecord::SendToAddress:
case TransactionRecord::SendToOther:
case TransactionRecord::ZerocoinSpend:
Expand Down
3 changes: 3 additions & 0 deletions src/qt/transactionrecord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ bool TransactionRecord::decomposeCreditTransaction(const CWallet* wallet, const
sub.type = TransactionRecord::RecvWithShieldedAddress;
sub.credit = sspkm->GetOutPointValue(wtx, out);
sub.memo = sspkm->GetOutPointMemo(wtx, out);
if (!sub.memo->empty()) {
sub.type = TransactionRecord::RecvWithShieldedAddressMemo;
}
sub.idx = i;
parts.append(sub);
}
Expand Down
1 change: 1 addition & 0 deletions src/qt/transactionrecord.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class TransactionRecord
P2CSUnlockStaker, // Staker watching the owner spent the delegated utxo
SendToShielded, // Shielded send
RecvWithShieldedAddress, // Shielded receive
RecvWithShieldedAddressMemo, // Shielded recieve with memo
SendToSelfShieldedAddress, // Shielded send to self
SendToSelfShieldToTransparent, // Unshield coins to self
SendToSelfShieldToShieldChangeAddress, // Changing coins from one shielded address to another inside the wallet.
Expand Down
4 changes: 4 additions & 0 deletions src/qt/transactiontablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,8 @@ QString TransactionTableModel::formatTxType(const TransactionRecord* wtx) const
return tr("Converted z%1 to %1").arg(CURRENCY_UNIT.c_str());
case TransactionRecord::RecvWithShieldedAddress:
return tr("Received with shielded");
case TransactionRecord::RecvWithShieldedAddressMemo:
return tr("Received shielded memo");
case TransactionRecord::SendToShielded:
return tr("Shielded send to");
case TransactionRecord::SendToNobody:
Expand Down Expand Up @@ -532,6 +534,7 @@ QString TransactionTableModel::formatTxToAddress(const TransactionRecord* wtx, b
case TransactionRecord::RecvFromZerocoinSpend:
return lookupAddress(wtx->address, tooltip);
case TransactionRecord::RecvWithShieldedAddress:
case TransactionRecord::RecvWithShieldedAddressMemo:
case TransactionRecord::SendToShielded:
// todo: add addressbook support for shielded addresses.
return QString::fromStdString(wtx->address);
Expand Down Expand Up @@ -708,6 +711,7 @@ QVariant TransactionTableModel::data(const QModelIndex& index, int role) const
return COLOR_ORPHAN;
else
return COLOR_STAKE;

}
// Conflicted tx
if (rec->status.status == TransactionStatus::Conflicted || rec->status.status == TransactionStatus::NotAccepted) {
Expand Down

0 comments on commit 2543f6b

Please sign in to comment.