Skip to content

Commit 5ff4065

Browse files
committed
Merge pull request #5833
721cb55 GUI: Display label rather than address on popups (Luke Dashjr) e96028c GUI: Clarify terminology; use "Label" heading for labels row, and "Node/Service" rather than [IP] "Address" (Luke Dashjr)
2 parents 8289b1f + 721cb55 commit 5ff4065

File tree

6 files changed

+19
-17
lines changed

6 files changed

+19
-17
lines changed

src/qt/bitcoingui.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -859,18 +859,18 @@ void BitcoinGUI::closeEvent(QCloseEvent *event)
859859
}
860860

861861
#ifdef ENABLE_WALLET
862-
void BitcoinGUI::incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address)
862+
void BitcoinGUI::incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address, const QString& label)
863863
{
864864
// On new transaction, make an info balloon
865+
QString msg = tr("Date: %1\n").arg(date) +
866+
tr("Amount: %1\n").arg(BitcoinUnits::formatWithUnit(unit, amount, true)) +
867+
tr("Type: %1\n").arg(type);
868+
if (!label.isEmpty())
869+
msg += tr("Label: %1\n").arg(label);
870+
else if (!address.isEmpty())
871+
msg += tr("Address: %1\n").arg(address);
865872
message((amount)<0 ? tr("Sent transaction") : tr("Incoming transaction"),
866-
tr("Date: %1\n"
867-
"Amount: %2\n"
868-
"Type: %3\n"
869-
"Address: %4\n")
870-
.arg(date)
871-
.arg(BitcoinUnits::formatWithUnit(unit, amount, true))
872-
.arg(type)
873-
.arg(address), CClientUIInterface::MSG_INFORMATION);
873+
msg, CClientUIInterface::MSG_INFORMATION);
874874
}
875875
#endif // ENABLE_WALLET
876876

src/qt/bitcoingui.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public slots:
165165
bool handlePaymentRequest(const SendCoinsRecipient& recipient);
166166

167167
/** Show incoming transaction notification for new transactions. */
168-
void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address);
168+
void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address, const QString& label);
169169
#endif // ENABLE_WALLET
170170

171171
private slots:

src/qt/peertablemodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ PeerTableModel::PeerTableModel(ClientModel *parent) :
115115
clientModel(parent),
116116
timer(0)
117117
{
118-
columns << tr("Address/Hostname") << tr("User Agent") << tr("Ping Time");
118+
columns << tr("Node/Service") << tr("User Agent") << tr("Ping Time");
119119
priv = new PeerTablePriv();
120120
// default to unsorted
121121
priv->sortColumn = -1;

src/qt/transactiontablemodel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ TransactionTableModel::TransactionTableModel(CWallet* wallet, WalletModel *paren
227227
priv(new TransactionTablePriv(wallet, this)),
228228
fProcessingQueuedTransactions(false)
229229
{
230-
columns << QString() << QString() << tr("Date") << tr("Type") << tr("Address") << BitcoinUnits::getAmountColumnTitle(walletModel->getOptionsModel()->getDisplayUnit());
230+
columns << QString() << QString() << tr("Date") << tr("Type") << tr("Label") << BitcoinUnits::getAmountColumnTitle(walletModel->getOptionsModel()->getDisplayUnit());
231231
priv->refreshWallet();
232232

233233
connect(walletModel->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
@@ -626,7 +626,7 @@ QVariant TransactionTableModel::headerData(int section, Qt::Orientation orientat
626626
case Watchonly:
627627
return tr("Whether or not a watch-only address is involved in this transaction.");
628628
case ToAddress:
629-
return tr("Destination address of transaction.");
629+
return tr("User-defined intent/purpose of the transaction.");
630630
case Amount:
631631
return tr("Amount removed from or added to balance.");
632632
}

src/qt/walletview.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void WalletView::setBitcoinGUI(BitcoinGUI *gui)
9393
connect(this, SIGNAL(encryptionStatusChanged(int)), gui, SLOT(setEncryptionStatus(int)));
9494

9595
// Pass through transaction notifications
96-
connect(this, SIGNAL(incomingTransaction(QString,int,CAmount,QString,QString)), gui, SLOT(incomingTransaction(QString,int,CAmount,QString,QString)));
96+
connect(this, SIGNAL(incomingTransaction(QString,int,CAmount,QString,QString,QString)), gui, SLOT(incomingTransaction(QString,int,CAmount,QString,QString,QString)));
9797
}
9898
}
9999

@@ -149,9 +149,11 @@ void WalletView::processNewTransaction(const QModelIndex& parent, int start, int
149149
QString date = ttm->index(start, TransactionTableModel::Date, parent).data().toString();
150150
qint64 amount = ttm->index(start, TransactionTableModel::Amount, parent).data(Qt::EditRole).toULongLong();
151151
QString type = ttm->index(start, TransactionTableModel::Type, parent).data().toString();
152-
QString address = ttm->index(start, TransactionTableModel::ToAddress, parent).data().toString();
152+
QModelIndex index = ttm->index(start, 0, parent);
153+
QString address = ttm->data(index, TransactionTableModel::AddressRole).toString();
154+
QString label = ttm->data(index, TransactionTableModel::LabelRole).toString();
153155

154-
emit incomingTransaction(date, walletModel->getOptionsModel()->getDisplayUnit(), amount, type, address);
156+
emit incomingTransaction(date, walletModel->getOptionsModel()->getDisplayUnit(), amount, type, address, label);
155157
}
156158

157159
void WalletView::gotoOverviewPage()

src/qt/walletview.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public slots:
113113
/** Encryption status of wallet changed */
114114
void encryptionStatusChanged(int status);
115115
/** Notify that a new transaction appeared */
116-
void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address);
116+
void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address, const QString& label);
117117
};
118118

119119
#endif // BITCOIN_QT_WALLETVIEW_H

0 commit comments

Comments
 (0)