forked from Public/monero-gui
History: Show num of confirmations + unconfirmed payments
history: refresh on new block
This commit is contained in:
@@ -46,6 +46,11 @@ quint64 TransactionInfo::blockHeight() const
|
||||
return m_pimpl->blockHeight();
|
||||
}
|
||||
|
||||
quint64 TransactionInfo::confirmations() const
|
||||
{
|
||||
return m_pimpl->confirmations();
|
||||
}
|
||||
|
||||
QString TransactionInfo::hash() const
|
||||
{
|
||||
return QString::fromStdString(m_pimpl->hash());
|
||||
|
||||
@@ -18,6 +18,7 @@ class TransactionInfo : public QObject
|
||||
Q_PROPERTY(QString displayAmount READ displayAmount)
|
||||
Q_PROPERTY(QString fee READ fee)
|
||||
Q_PROPERTY(quint64 blockHeight READ blockHeight)
|
||||
Q_PROPERTY(quint64 confirmations READ confirmations)
|
||||
Q_PROPERTY(QString hash READ hash)
|
||||
Q_PROPERTY(QDateTime timestamp READ timestamp)
|
||||
Q_PROPERTY(QString date READ date)
|
||||
@@ -42,6 +43,7 @@ public:
|
||||
QString displayAmount() const;
|
||||
QString fee() const;
|
||||
quint64 blockHeight() const;
|
||||
quint64 confirmations() const;
|
||||
//! transaction_id
|
||||
QString hash() const;
|
||||
QDateTime timestamp() const;
|
||||
|
||||
@@ -44,6 +44,12 @@ public:
|
||||
emit m_wallet->moneyReceived(QString::fromStdString(txId), amount);
|
||||
}
|
||||
|
||||
virtual void unconfirmedMoneyReceived(const std::string &txId, uint64_t amount)
|
||||
{
|
||||
qDebug() << __FUNCTION__;
|
||||
emit m_wallet->unconfirmedMoneyReceived(QString::fromStdString(txId), amount);
|
||||
}
|
||||
|
||||
virtual void newBlock(uint64_t height)
|
||||
{
|
||||
// qDebug() << __FUNCTION__;
|
||||
|
||||
@@ -206,6 +206,7 @@ signals:
|
||||
|
||||
void moneySpent(const QString &txId, quint64 amount);
|
||||
void moneyReceived(const QString &txId, quint64 amount);
|
||||
void unconfirmedMoneyReceived(const QString &txId, quint64 amount);
|
||||
void newBlock(quint64 height);
|
||||
void historyModelChanged() const;
|
||||
|
||||
|
||||
@@ -81,6 +81,10 @@ QVariant TransactionHistoryModel::data(const QModelIndex &index, int role) const
|
||||
result = tInfo->blockHeight();
|
||||
}
|
||||
break;
|
||||
|
||||
case TransactionConfirmationsRole:
|
||||
result = tInfo->confirmations();
|
||||
break;
|
||||
case TransactionHashRole:
|
||||
result = tInfo->hash();
|
||||
break;
|
||||
@@ -125,6 +129,7 @@ QHash<int, QByteArray> TransactionHistoryModel::roleNames() const
|
||||
roleNames.insert(TransactionAtomicAmountRole, "atomicAmount");
|
||||
roleNames.insert(TransactionFeeRole, "fee");
|
||||
roleNames.insert(TransactionBlockHeightRole, "blockHeight");
|
||||
roleNames.insert(TransactionConfirmationsRole, "confirmations");
|
||||
roleNames.insert(TransactionHashRole, "hash");
|
||||
roleNames.insert(TransactionTimeStampRole, "timeStamp");
|
||||
roleNames.insert(TransactionPaymentIdRole, "paymentId");
|
||||
|
||||
@@ -25,6 +25,7 @@ public:
|
||||
TransactionDisplayAmountRole,
|
||||
TransactionFeeRole,
|
||||
TransactionBlockHeightRole,
|
||||
TransactionConfirmationsRole,
|
||||
TransactionHashRole,
|
||||
TransactionTimeStampRole,
|
||||
TransactionPaymentIdRole,
|
||||
|
||||
Reference in New Issue
Block a user