Changeset View
Changeset View
Standalone View
Standalone View
src/qt/transactiontablemodel.cpp
Show First 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | void updateWallet(const uint256 &hash, int status, bool showTransaction) { | ||||
if (status == CT_UPDATED) { | if (status == CT_UPDATED) { | ||||
/* Not in model, but want to show, treat as new */ | /* Not in model, but want to show, treat as new */ | ||||
if (showTransaction && !inModel) status = CT_NEW; | if (showTransaction && !inModel) status = CT_NEW; | ||||
/* In model, but want to hide, treat as deleted */ | /* In model, but want to hide, treat as deleted */ | ||||
if (!showTransaction && inModel) status = CT_DELETED; | if (!showTransaction && inModel) status = CT_DELETED; | ||||
} | } | ||||
qDebug() << " inModel=" + QString::number(inModel) + " Index=" + | qDebug() << " inModel=" + QString::number(inModel) + | ||||
QString::number(lowerIndex) + "-" + | " Index=" + QString::number(lowerIndex) + "-" + | ||||
QString::number(upperIndex) + " showTransaction=" + | QString::number(upperIndex) + | ||||
QString::number(showTransaction) + " derivedStatus=" + | " showTransaction=" + QString::number(showTransaction) + | ||||
QString::number(status); | " derivedStatus=" + QString::number(status); | ||||
switch (status) { | switch (status) { | ||||
case CT_NEW: | case CT_NEW: | ||||
if (inModel) { | if (inModel) { | ||||
qWarning() << "TransactionTablePriv::updateWallet: " | qWarning() << "TransactionTablePriv::updateWallet: " | ||||
"Warning: Got CT_NEW, but transaction is " | "Warning: Got CT_NEW, but transaction is " | ||||
"already in model"; | "already in model"; | ||||
break; | break; | ||||
▲ Show 20 Lines • Show All 584 Lines • ▼ Show 20 Lines | |||||
public: | public: | ||||
TransactionNotification() {} | TransactionNotification() {} | ||||
TransactionNotification(uint256 _hash, ChangeType _status, | TransactionNotification(uint256 _hash, ChangeType _status, | ||||
bool _showTransaction) | bool _showTransaction) | ||||
: hash(_hash), status(_status), showTransaction(_showTransaction) {} | : hash(_hash), status(_status), showTransaction(_showTransaction) {} | ||||
void invoke(QObject *ttm) { | void invoke(QObject *ttm) { | ||||
QString strHash = QString::fromStdString(hash.GetHex()); | QString strHash = QString::fromStdString(hash.GetHex()); | ||||
qDebug() << "NotifyTransactionChanged: " + strHash + " status= " + | qDebug() << "NotifyTransactionChanged: " + strHash + | ||||
QString::number(status); | " status= " + QString::number(status); | ||||
QMetaObject::invokeMethod(ttm, "updateTransaction", | QMetaObject::invokeMethod(ttm, "updateTransaction", | ||||
Qt::QueuedConnection, Q_ARG(QString, strHash), | Qt::QueuedConnection, Q_ARG(QString, strHash), | ||||
Q_ARG(int, status), | Q_ARG(int, status), | ||||
Q_ARG(bool, showTransaction)); | Q_ARG(bool, showTransaction)); | ||||
} | } | ||||
private: | private: | ||||
uint256 hash; | uint256 hash; | ||||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |