Skip to content

Commit 559e4f1

Browse files
committed
Merge #2865: [Qt] Add differentiation for Shielded Memos
2543f6b Add RecvWithShieldedAddressMemo enum to TransactionRecord (Liquid) Pull request description: This introduces a new TransactionRecord `RecvWithShieldedAddressMemo` and icon/image for the transaction. With the conversation in Issue #2786 , there is something we can do and that changes the icon and checking for memo to not be empty. ![@js](https://github.com/PIVX-Project/PIVX/assets/45834289/3adfd539-a589-4267-8037-ca9cf3953df9) Color for blue is not in this PR, but to make it easier to see is in the picture. I have also spoken with a few, where they feel more may still be warranted to make this stand out so open for options/feedback for us to update this more. Closes #2786 ACKs for top commit: Fuzzbawls: ACK 2543f6b panleone: tACK 2543f6b Tree-SHA512: fd50d8d2874f1c0ee2661585db408928c11b071176c737a4c04267c520ad2bdc14abc29e9ee7f2fb82e98e815a7795dc95330904b4eab6c1127f4a8f897804d6
2 parents 616cc48 + 2543f6b commit 559e4f1

File tree

9 files changed

+27
-1
lines changed

9 files changed

+27
-1
lines changed

src/Makefile.qt.include

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,9 @@ RES_ICONS = \
452452
qt/pivx/res/img/ic-check-tor.svg \
453453
qt/pivx/res/img/ic-label.svg \
454454
qt/pivx/res/img/ic-transaction-received.svg \
455+
qt/pivx/res/img/ic-transaction-received-memo.svg \
455456
qt/pivx/res/img/dark/ic-transaction-received.svg \
457+
qt/pivx/res/img/dark/ic-transaction-received-memo.svg \
456458
qt/pivx/res/img/dark/ic-transaction-warning.svg \
457459
qt/pivx/res/img/dark/ic-transaction-mint.svg \
458460
qt/pivx/res/img/dark/ic-transaction-mint-inactive.svg \

src/qt/pivx.qrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,12 @@
142142
<file alias="ic-transaction-warning">pivx/res/img/ic-transaction-warning.svg</file>
143143
<file alias="ic-transaction-mint">pivx/res/img/ic-transaction-mint.svg</file>
144144
<file alias="ic-transaction-received">pivx/res/img/ic-transaction-received.svg</file>
145+
<file alias="ic-transaction-received-memo">pivx/res/img/ic-transaction-received-memo.svg</file>
145146
<file alias="ic-transaction-sent">pivx/res/img/ic-transaction-sent.svg</file>
146147
<file alias="ic-transaction-staked">pivx/res/img/ic-transaction-staked.svg</file>
147148
<file alias="ic-transaction-mint-dark">pivx/res/img/dark/ic-transaction-mint.svg</file>
148149
<file alias="ic-transaction-received-dark">pivx/res/img/dark/ic-transaction-received.svg</file>
150+
<file alias="ic-transaction-received-memo-dark">pivx/res/img/dark/ic-transaction-received-memo.svg</file>
149151
<file alias="ic-transaction-sent-dark">pivx/res/img/dark/ic-transaction-sent.svg</file>
150152
<file alias="ic-transaction-staked-dark">pivx/res/img/dark/ic-transaction-staked.svg</file>
151153
<file alias="ic-transaction-mint-inactive">pivx/res/img/ic-transaction-mint-inactive.svg</file>

src/qt/pivx/qtutils.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,16 @@ void setSortTxTypeFilter(QComboBox* filter, SortEdit* lineEditType)
159159
filter->addItem(QObject::tr("Received"),
160160
TransactionFilterProxy::TYPE(TransactionRecord::RecvWithAddress) |
161161
TransactionFilterProxy::TYPE(TransactionRecord::RecvFromOther) |
162-
TransactionFilterProxy::TYPE(TransactionRecord::RecvWithShieldedAddress));
162+
TransactionFilterProxy::TYPE(TransactionRecord::RecvWithShieldedAddress) |
163+
TransactionFilterProxy::TYPE(TransactionRecord::RecvWithShieldedAddressMemo));
163164
filter->addItem(QObject::tr("Sent"),
164165
TransactionFilterProxy::TYPE(TransactionRecord::SendToAddress) |
165166
TransactionFilterProxy::TYPE(TransactionRecord::SendToOther) |
166167
TransactionFilterProxy::TYPE(TransactionRecord::SendToShielded) |
167168
TransactionFilterProxy::TYPE(TransactionRecord::SendToNobody));
168169
filter->addItem(QObject::tr("Shield"),
169170
TransactionFilterProxy::TYPE(TransactionRecord::RecvWithShieldedAddress) |
171+
TransactionFilterProxy::TYPE(TransactionRecord::RecvWithShieldedAddressMemo) |
170172
TransactionFilterProxy::TYPE(TransactionRecord::SendToShielded) |
171173
TransactionFilterProxy::TYPE(TransactionRecord::SendToSelfShieldToShieldChangeAddress) |
172174
TransactionFilterProxy::TYPE(TransactionRecord::SendToSelfShieldToTransparent) |
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading

src/qt/pivx/txrow.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ void TxRow::setType(bool isLightTheme, int type, bool isConfirmed)
8989
path = "://ic-transaction-received";
9090
css = "text-list-amount-receive";
9191
break;
92+
case TransactionRecord::RecvWithShieldedAddressMemo:
93+
path = "://ic-transaction-received-memo";
94+
css = "text-list-amount-receive";
95+
break;
9296
case TransactionRecord::SendToAddress:
9397
case TransactionRecord::SendToOther:
9498
case TransactionRecord::ZerocoinSpend:

src/qt/transactionrecord.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ bool TransactionRecord::decomposeCreditTransaction(const CWallet* wallet, const
180180
sub.type = TransactionRecord::RecvWithShieldedAddress;
181181
sub.credit = sspkm->GetOutPointValue(wtx, out);
182182
sub.memo = sspkm->GetOutPointMemo(wtx, out);
183+
if (!sub.memo->empty()) {
184+
sub.type = TransactionRecord::RecvWithShieldedAddressMemo;
185+
}
183186
sub.idx = i;
184187
parts.append(sub);
185188
}

src/qt/transactionrecord.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ class TransactionRecord
9898
P2CSUnlockStaker, // Staker watching the owner spent the delegated utxo
9999
SendToShielded, // Shielded send
100100
RecvWithShieldedAddress, // Shielded receive
101+
RecvWithShieldedAddressMemo, // Shielded recieve with memo
101102
SendToSelfShieldedAddress, // Shielded send to self
102103
SendToSelfShieldToTransparent, // Unshield coins to self
103104
SendToSelfShieldToShieldChangeAddress, // Changing coins from one shielded address to another inside the wallet.

src/qt/transactiontablemodel.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,8 @@ QString TransactionTableModel::formatTxType(const TransactionRecord* wtx) const
479479
return tr("Converted z%1 to %1").arg(CURRENCY_UNIT.c_str());
480480
case TransactionRecord::RecvWithShieldedAddress:
481481
return tr("Received with shielded");
482+
case TransactionRecord::RecvWithShieldedAddressMemo:
483+
return tr("Received shielded memo");
482484
case TransactionRecord::SendToShielded:
483485
return tr("Shielded send to");
484486
case TransactionRecord::SendToNobody:
@@ -532,6 +534,7 @@ QString TransactionTableModel::formatTxToAddress(const TransactionRecord* wtx, b
532534
case TransactionRecord::RecvFromZerocoinSpend:
533535
return lookupAddress(wtx->address, tooltip);
534536
case TransactionRecord::RecvWithShieldedAddress:
537+
case TransactionRecord::RecvWithShieldedAddressMemo:
535538
case TransactionRecord::SendToShielded:
536539
// todo: add addressbook support for shielded addresses.
537540
return QString::fromStdString(wtx->address);
@@ -708,6 +711,7 @@ QVariant TransactionTableModel::data(const QModelIndex& index, int role) const
708711
return COLOR_ORPHAN;
709712
else
710713
return COLOR_STAKE;
714+
711715
}
712716
// Conflicted tx
713717
if (rec->status.status == TransactionStatus::Conflicted || rec->status.status == TransactionStatus::NotAccepted) {

0 commit comments

Comments
 (0)