diff --git a/src/qt/kevadialog.cpp b/src/qt/kevadialog.cpp index 79985a601..bec47fd82 100644 --- a/src/qt/kevadialog.cpp +++ b/src/qt/kevadialog.cpp @@ -101,6 +101,7 @@ void KevaDialog::setModel(WalletModel *_model) tableView->setSelectionMode(QAbstractItemView::ContiguousSelection); tableView->setColumnWidth(KevaTableModel::Date, DATE_COLUMN_WIDTH); tableView->setColumnWidth(KevaTableModel::Key, KEY_COLUMN_WIDTH); + tableView->setColumnWidth(KevaTableModel::TransactionID, TRANSACTION_ID_MINIMUM_COLUMN_WIDTH); tableView->setColumnWidth(KevaTableModel::Block, BLOCK_MINIMUM_COLUMN_WIDTH); connect(ui->kevaView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), diff --git a/src/qt/kevadialog.h b/src/qt/kevadialog.h index 524c5f7a6..cd4b360a6 100644 --- a/src/qt/kevadialog.h +++ b/src/qt/kevadialog.h @@ -36,6 +36,7 @@ public: enum ColumnWidths { DATE_COLUMN_WIDTH = 130, KEY_COLUMN_WIDTH = 120, + TRANSACTION_ID_MINIMUM_COLUMN_WIDTH = 200, BLOCK_MINIMUM_COLUMN_WIDTH = 100, MINIMUM_COLUMN_WIDTH = 100 }; diff --git a/src/qt/kevatablemodel.cpp b/src/qt/kevatablemodel.cpp index ea9ce1aa5..f521de310 100644 --- a/src/qt/kevatablemodel.cpp +++ b/src/qt/kevatablemodel.cpp @@ -18,7 +18,7 @@ KevaTableModel::KevaTableModel(CWallet *wallet, WalletModel *parent) : Q_UNUSED(wallet) /* These columns must match the indices in the ColumnIndex enumeration */ - columns << tr("Date") << tr("Key") << tr("Value") << tr("Block"); + columns << tr("Date") << tr("Key") << tr("Value") << tr("Transaction ID") << tr("Block"); // TODO: display new keva entry when it arrives. // connect(walletModel->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); @@ -67,6 +67,8 @@ QVariant KevaTableModel::data(const QModelIndex &index, int role) const return QString::fromStdString(rec->key); case Value: return QString::fromStdString(rec->value); + case TransactionID: + return QString::fromStdString(rec->transactionID); case Block: return QString::number(rec->block); } @@ -172,6 +174,8 @@ bool KevaEntryLessThan::operator()(KevaEntry &left, KevaEntry &right) const return pLeft->date.toTime_t() < pRight->date.toTime_t(); case KevaTableModel::Block: return pLeft->block < pRight->block; + case KevaTableModel::TransactionID: + return pLeft->transactionID < pRight->transactionID; case KevaTableModel::Key: return pLeft->key < pRight->key; case KevaTableModel::Value: diff --git a/src/qt/kevatablemodel.h b/src/qt/kevatablemodel.h index 83600bc0b..f0ca9b06b 100644 --- a/src/qt/kevatablemodel.h +++ b/src/qt/kevatablemodel.h @@ -20,6 +20,7 @@ public: std::string key; std::string value; + std::string transactionID; int64_t block; QDateTime date; }; @@ -51,7 +52,8 @@ public: Date = 0, Key = 1, Value = 2, - Block = 3, + TransactionID = 3, + Block = 4, NUMBER_OF_COLUMNS }; diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 3b72ab95e..062eb347a 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -805,6 +805,8 @@ void WalletModel::getKevaEntries(std::vector& vKevaEntries, std::stri entry.key = ValtypeToString(key); entry.value = ValtypeToString(data.getValue()); entry.block = data.getHeight(); + entry.transactionID = data.getUpdateOutpoint().hash.ToString(); + CBlockIndex* pblockindex = chainActive[entry.block]; if (pblockindex) { entry.date.setTime_t(pblockindex->nTime);