mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Merge #12620: Remove TransactionTableModel::TxIDRole
3b26b6af7
qt: Remove TransactionTableModel::TxIDRole (João Barbosa)
Pull request description:
The role `TxIDRole` is a duplicate of `TxHashRole`. This change favours `TxHashRole`.
Tree-SHA512: ad35933eae1cb6b242b25b8940d662c2c79c766732d76fdd410c80230ec084969294a8e5a126794707992a566076ef4452b592050f7af6c4fa7742891090803d
This commit is contained in:
parent
e329fd562b
commit
5e5a0fbd7e
@ -255,7 +255,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco
|
||||
if (wtx.mapValue.count("comment") && !wtx.mapValue["comment"].empty())
|
||||
strHTML += "<br><b>" + tr("Comment") + ":</b><br>" + GUIUtil::HtmlEscape(wtx.mapValue["comment"], true) + "<br>";
|
||||
|
||||
strHTML += "<b>" + tr("Transaction ID") + ":</b> " + rec->getTxID() + "<br>";
|
||||
strHTML += "<b>" + tr("Transaction ID") + ":</b> " + rec->getTxHash() + "<br>";
|
||||
strHTML += "<b>" + tr("Output index") + ":</b> " + QString::number(rec->getOutputIndex()) + "<br>";
|
||||
strHTML += "<b>" + tr("Transaction total size") + ":</b> " + QString::number(wtx.tx->GetTotalSize()) + " bytes<br>";
|
||||
|
||||
|
@ -17,10 +17,9 @@ TransactionDescDialog::TransactionDescDialog(const QModelIndex &idx, QWidget *pa
|
||||
ui(new Ui::TransactionDescDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowTitle(tr("Details for %1").arg(idx.data(TransactionTableModel::TxIDRole).toString()));
|
||||
setWindowTitle(tr("Details for %1").arg(idx.data(TransactionTableModel::TxHashRole).toString()));
|
||||
/* Open CSS when configured */
|
||||
this->setStyleSheet(GUIUtil::loadStyleSheet());
|
||||
|
||||
QString desc = idx.data(TransactionTableModel::LongDescriptionRole).toString();
|
||||
ui->detailText->setHtml(desc);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ bool TransactionFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex &
|
||||
bool lockedByInstantSend = index.data(TransactionTableModel::InstantSendRole).toBool();
|
||||
QString address = index.data(TransactionTableModel::AddressRole).toString();
|
||||
QString label = index.data(TransactionTableModel::LabelRole).toString();
|
||||
QString txid = index.data(TransactionTableModel::TxIDRole).toString();
|
||||
QString txid = index.data(TransactionTableModel::TxHashRole).toString();
|
||||
qint64 amount = llabs(index.data(TransactionTableModel::AmountRole).toLongLong());
|
||||
int status = index.data(TransactionTableModel::StatusRole).toInt();
|
||||
|
||||
|
@ -380,7 +380,7 @@ bool TransactionRecord::statusUpdateNeeded(int chainLockHeight) const
|
||||
|| (!status.lockedByChainLocks && status.cachedChainLockHeight != chainLockHeight);
|
||||
}
|
||||
|
||||
QString TransactionRecord::getTxID() const
|
||||
QString TransactionRecord::getTxHash() const
|
||||
{
|
||||
return QString::fromStdString(hash.ToString());
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ public:
|
||||
bool involvesWatchAddress;
|
||||
|
||||
/** Return the unique identifier for this transaction (part) */
|
||||
QString getTxID() const;
|
||||
QString getTxHash() const;
|
||||
|
||||
/** Return the output index of the subtransaction */
|
||||
int getOutputIndex() const;
|
||||
|
@ -689,10 +689,8 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const
|
||||
return rec->status.label;
|
||||
case AmountRole:
|
||||
return qint64(rec->credit + rec->debit);
|
||||
case TxIDRole:
|
||||
return rec->getTxID();
|
||||
case TxHashRole:
|
||||
return QString::fromStdString(rec->hash.ToString());
|
||||
return rec->getTxHash();
|
||||
case TxHexRole:
|
||||
return priv->getTxHex(rec);
|
||||
case TxPlainTextRole:
|
||||
|
@ -63,8 +63,6 @@ public:
|
||||
LabelRole,
|
||||
/** Net amount of transaction */
|
||||
AmountRole,
|
||||
/** Unique identifier */
|
||||
TxIDRole,
|
||||
/** Transaction hash */
|
||||
TxHashRole,
|
||||
/** Transaction data, hex-encoded */
|
||||
|
@ -423,7 +423,7 @@ void TransactionView::exportClicked()
|
||||
writer.addColumn(tr("Label"), 0, TransactionTableModel::LabelRole);
|
||||
writer.addColumn(tr("Address"), 0, TransactionTableModel::AddressRole);
|
||||
writer.addColumn(BitcoinUnits::getAmountColumnTitle(model->getOptionsModel()->getDisplayUnit()), 0, TransactionTableModel::FormattedAmountRole);
|
||||
writer.addColumn(tr("ID"), 0, TransactionTableModel::TxIDRole);
|
||||
writer.addColumn(tr("ID"), 0, TransactionTableModel::TxHashRole);
|
||||
|
||||
if(!writer.write()) {
|
||||
Q_EMIT message(tr("Exporting Failed"), tr("There was an error trying to save the transaction history to %1.").arg(filename),
|
||||
@ -490,7 +490,7 @@ void TransactionView::copyAmount()
|
||||
|
||||
void TransactionView::copyTxID()
|
||||
{
|
||||
GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxIDRole);
|
||||
GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxHashRole);
|
||||
}
|
||||
|
||||
void TransactionView::copyTxHex()
|
||||
|
Loading…
Reference in New Issue
Block a user