[Qt] minor watch-only changes
- use watch-only, not watchonly - add back a tooltip hint when hovering addresses and attach "(watch-only)" at the end
This commit is contained in:
parent
3ed668dbe2
commit
fbe0fcae76
@ -172,7 +172,7 @@ void OverviewPage::setBalance(qint64 balance, qint64 unconfirmedBalance, qint64
|
|||||||
// for symmetry reasons also show immature label when the watch-only one is shown
|
// for symmetry reasons also show immature label when the watch-only one is shown
|
||||||
ui->labelImmature->setVisible(showImmature || showWatchOnlyImmature);
|
ui->labelImmature->setVisible(showImmature || showWatchOnlyImmature);
|
||||||
ui->labelImmatureText->setVisible(showImmature || showWatchOnlyImmature);
|
ui->labelImmatureText->setVisible(showImmature || showWatchOnlyImmature);
|
||||||
ui->labelWatchImmature->setVisible(showWatchOnlyImmature); // show watch-only immature balance
|
ui->labelWatchImmature->setVisible(showWatchOnlyImmature); // show watch-only immature balance
|
||||||
}
|
}
|
||||||
|
|
||||||
// show/hide watch-only labels
|
// show/hide watch-only labels
|
||||||
|
@ -394,19 +394,25 @@ QVariant TransactionTableModel::txAddressDecoration(const TransactionRecord *wtx
|
|||||||
|
|
||||||
QString TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx, bool tooltip) const
|
QString TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx, bool tooltip) const
|
||||||
{
|
{
|
||||||
|
QString watchAddress;
|
||||||
|
if (tooltip) {
|
||||||
|
// Mark transactions involving watch-only addresses by adding " (watch-only)"
|
||||||
|
watchAddress = wtx->involvesWatchAddress ? QString(" (") + tr("watch-only") + QString(")") : "";
|
||||||
|
}
|
||||||
|
|
||||||
switch(wtx->type)
|
switch(wtx->type)
|
||||||
{
|
{
|
||||||
case TransactionRecord::RecvFromOther:
|
case TransactionRecord::RecvFromOther:
|
||||||
return QString::fromStdString(wtx->address);
|
return QString::fromStdString(wtx->address) + watchAddress;
|
||||||
case TransactionRecord::RecvWithAddress:
|
case TransactionRecord::RecvWithAddress:
|
||||||
case TransactionRecord::SendToAddress:
|
case TransactionRecord::SendToAddress:
|
||||||
case TransactionRecord::Generated:
|
case TransactionRecord::Generated:
|
||||||
return lookupAddress(wtx->address, tooltip);
|
return lookupAddress(wtx->address, tooltip) + watchAddress;
|
||||||
case TransactionRecord::SendToOther:
|
case TransactionRecord::SendToOther:
|
||||||
return QString::fromStdString(wtx->address);
|
return QString::fromStdString(wtx->address) + watchAddress;
|
||||||
case TransactionRecord::SendToSelf:
|
case TransactionRecord::SendToSelf:
|
||||||
default:
|
default:
|
||||||
return tr("(n/a)");
|
return tr("(n/a)") + watchAddress;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -331,7 +331,7 @@ void TransactionView::exportClicked()
|
|||||||
writer.setModel(transactionProxyModel);
|
writer.setModel(transactionProxyModel);
|
||||||
writer.addColumn(tr("Confirmed"), 0, TransactionTableModel::ConfirmedRole);
|
writer.addColumn(tr("Confirmed"), 0, TransactionTableModel::ConfirmedRole);
|
||||||
if (model && model->haveWatchOnly())
|
if (model && model->haveWatchOnly())
|
||||||
writer.addColumn(tr("Watchonly"), TransactionTableModel::Watchonly);
|
writer.addColumn(tr("Watch-only"), TransactionTableModel::Watchonly);
|
||||||
writer.addColumn(tr("Date"), 0, TransactionTableModel::DateRole);
|
writer.addColumn(tr("Date"), 0, TransactionTableModel::DateRole);
|
||||||
writer.addColumn(tr("Type"), TransactionTableModel::Type, Qt::EditRole);
|
writer.addColumn(tr("Type"), TransactionTableModel::Type, Qt::EditRole);
|
||||||
writer.addColumn(tr("Label"), 0, TransactionTableModel::LabelRole);
|
writer.addColumn(tr("Label"), 0, TransactionTableModel::LabelRole);
|
||||||
|
@ -256,7 +256,7 @@ public slots:
|
|||||||
void updateTransaction(const QString &hash, int status);
|
void updateTransaction(const QString &hash, int status);
|
||||||
/* New, updated or removed address book entry */
|
/* New, updated or removed address book entry */
|
||||||
void updateAddressBook(const QString &address, const QString &label, bool isMine, const QString &purpose, int status);
|
void updateAddressBook(const QString &address, const QString &label, bool isMine, const QString &purpose, int status);
|
||||||
/* Watchonly added */
|
/* Watch-only added */
|
||||||
void updateWatchOnlyFlag(bool fHaveWatchonly);
|
void updateWatchOnlyFlag(bool fHaveWatchonly);
|
||||||
/* Current, immature or unconfirmed balance might have changed - emit 'balanceChanged' if so */
|
/* Current, immature or unconfirmed balance might have changed - emit 'balanceChanged' if so */
|
||||||
void pollBalanceChanged();
|
void pollBalanceChanged();
|
||||||
|
Loading…
Reference in New Issue
Block a user