mirror of
https://github.com/wownero/wowlet.git
synced 2026-10-17 15:21:30 +02:00
txinfo: warn if integrated address is missing
This commit is contained in:
+1
-1
Submodule monero updated: 16e051c8a8...d50ba728d7
@@ -70,10 +70,14 @@ TxInfoDialog::TxInfoDialog(Wallet *wallet, TransactionRow *txInfo, QWidget *pare
|
|||||||
ui->frameInputs->hide();
|
ui->frameInputs->hide();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
ui->frame_destinationsWarning->hide();
|
||||||
|
|
||||||
QTextCursor cursor = ui->outputs->textCursor();
|
QTextCursor cursor = ui->outputs->textCursor();
|
||||||
|
|
||||||
auto transfers = txInfo->transfers();
|
auto transfers = txInfo->transfers();
|
||||||
if (!transfers.isEmpty()) {
|
if (!transfers.isEmpty()) {
|
||||||
|
bool hasIntegrated = false;
|
||||||
|
|
||||||
for (const auto& transfer : transfers) {
|
for (const auto& transfer : transfers) {
|
||||||
auto address = transfer->address();
|
auto address = transfer->address();
|
||||||
auto amount = WalletManager::displayAmount(transfer->amount());
|
auto amount = WalletManager::displayAmount(transfer->amount());
|
||||||
@@ -81,9 +85,21 @@ TxInfoDialog::TxInfoDialog(Wallet *wallet, TransactionRow *txInfo, QWidget *pare
|
|||||||
cursor.insertText(address, Utils::addressTextFormat(index, transfer->amount()));
|
cursor.insertText(address, Utils::addressTextFormat(index, transfer->amount()));
|
||||||
cursor.insertText(QString(" %1").arg(amount), QTextCharFormat());
|
cursor.insertText(QString(" %1").arg(amount), QTextCharFormat());
|
||||||
cursor.insertBlock();
|
cursor.insertBlock();
|
||||||
|
|
||||||
|
if (WalletManager::baseAddressFromIntegratedAddress(transfer->address(), constants::networkType) != transfer->address()) {
|
||||||
|
hasIntegrated = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ui->label_outputs->setText(QString("Destinations (%2)").arg(QString::number(transfers.size())));
|
ui->label_outputs->setText(QString("Destinations (%2)").arg(QString::number(transfers.size())));
|
||||||
this->adjustHeight(ui->outputs, transfers.size());
|
this->adjustHeight(ui->outputs, transfers.size());
|
||||||
|
|
||||||
|
// Trezor saves a mangled payment ID.
|
||||||
|
if (m_wallet->isTrezor() && !hasIntegrated && txInfo->hasPaymentId()) {
|
||||||
|
ui->frame_destinationsWarning->setInfo(icons()->icon("warning"), "The address displayed here does not contain a payment ID. "
|
||||||
|
"If you are making a repeat payment to a service, "
|
||||||
|
"do not copy the address from here to prevent a loss of funds.");
|
||||||
|
ui->frame_destinationsWarning->show();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ui->frameOutputs->hide();
|
ui->frameOutputs->hide();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>929</width>
|
<width>929</width>
|
||||||
<height>715</height>
|
<height>723</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@@ -184,6 +184,16 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="InfoFrame" name="frame_destinationsWarning">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTextEdit" name="outputs">
|
<widget class="QTextEdit" name="outputs">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@@ -287,6 +297,14 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>InfoFrame</class>
|
||||||
|
<extends>QFrame</extends>
|
||||||
|
<header>components.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -75,10 +75,10 @@ void TransactionHistory::refresh()
|
|||||||
clearRows();
|
clearRows();
|
||||||
|
|
||||||
quint64 lastTxHeight = 0;
|
quint64 lastTxHeight = 0;
|
||||||
|
bool hasFakePaymentId = m_wallet->isTrezor();
|
||||||
m_locked = false;
|
m_locked = false;
|
||||||
m_minutesToUnlock = 0;
|
m_minutesToUnlock = 0;
|
||||||
|
|
||||||
|
|
||||||
uint64_t min_height = 0;
|
uint64_t min_height = 0;
|
||||||
uint64_t max_height = (uint64_t)-1;
|
uint64_t max_height = (uint64_t)-1;
|
||||||
uint64_t wallet_height = m_wallet->blockChainHeight();
|
uint64_t wallet_height = m_wallet->blockChainHeight();
|
||||||
@@ -176,7 +176,7 @@ void TransactionHistory::refresh()
|
|||||||
// single output transaction might contain multiple transfers
|
// single output transaction might contain multiple transfers
|
||||||
for (auto const &d: pd.m_dests)
|
for (auto const &d: pd.m_dests)
|
||||||
{
|
{
|
||||||
Transfer *transfer = new Transfer(d.amount, QString::fromStdString(d.address(m_wallet2->nettype(), pd.m_payment_id)), this);
|
Transfer *transfer = new Transfer(d.amount, QString::fromStdString(d.address(m_wallet2->nettype(), pd.m_payment_id, !hasFakePaymentId)), this);
|
||||||
t->m_transfers.append(transfer);
|
t->m_transfers.append(transfer);
|
||||||
}
|
}
|
||||||
for (auto const &r: pd.m_rings)
|
for (auto const &r: pd.m_rings)
|
||||||
@@ -229,7 +229,7 @@ void TransactionHistory::refresh()
|
|||||||
|
|
||||||
for (auto const &d: pd.m_dests)
|
for (auto const &d: pd.m_dests)
|
||||||
{
|
{
|
||||||
Transfer *transfer = new Transfer(d.amount, QString::fromStdString(d.address(m_wallet2->nettype(), pd.m_payment_id)), this);
|
Transfer *transfer = new Transfer(d.amount, QString::fromStdString(d.address(m_wallet2->nettype(), pd.m_payment_id, !hasFakePaymentId)), this);
|
||||||
t->m_transfers.append(transfer);
|
t->m_transfers.append(transfer);
|
||||||
}
|
}
|
||||||
for (auto const &r: pd.m_rings)
|
for (auto const &r: pd.m_rings)
|
||||||
|
|||||||
@@ -167,6 +167,10 @@ QString TransactionRow::rings_formatted() const
|
|||||||
return rings;
|
return rings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TransactionRow::hasPaymentId() const {
|
||||||
|
return m_paymentId != "0000000000000000";
|
||||||
|
}
|
||||||
|
|
||||||
TransactionRow::~TransactionRow()
|
TransactionRow::~TransactionRow()
|
||||||
{
|
{
|
||||||
qDeleteAll(m_transfers);
|
qDeleteAll(m_transfers);
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ public:
|
|||||||
QList<QString> destinations() const;
|
QList<QString> destinations() const;
|
||||||
QList<Transfer*> transfers() const;
|
QList<Transfer*> transfers() const;
|
||||||
QString rings_formatted() const;
|
QString rings_formatted() const;
|
||||||
|
bool hasPaymentId() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit TransactionRow(QObject *parent);
|
explicit TransactionRow(QObject *parent);
|
||||||
|
|||||||
Reference in New Issue
Block a user