mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-31 01:04:20 +00:00
show transaction ID in record list
This commit is contained in:
parent
618dac55c8
commit
1ead67cd11
@ -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)),
|
||||
|
@ -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
|
||||
};
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
};
|
||||
|
||||
|
@ -805,6 +805,8 @@ void WalletModel::getKevaEntries(std::vector<KevaEntry>& 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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user