Changeset View
Changeset View
Standalone View
Standalone View
src/qt/walletmodel.cpp
Show All 31 Lines | : QObject(parent), m_wallet(std::move(wallet)), m_node(node), | ||||
optionsModel(_optionsModel), addressTableModel(nullptr), | optionsModel(_optionsModel), addressTableModel(nullptr), | ||||
transactionTableModel(nullptr), recentRequestsTableModel(nullptr), | transactionTableModel(nullptr), recentRequestsTableModel(nullptr), | ||||
cachedEncryptionStatus(Unencrypted), cachedNumBlocks(0) { | cachedEncryptionStatus(Unencrypted), cachedNumBlocks(0) { | ||||
fHaveWatchOnly = m_wallet->haveWatchOnly(); | fHaveWatchOnly = m_wallet->haveWatchOnly(); | ||||
addressTableModel = new AddressTableModel(this); | addressTableModel = new AddressTableModel(this); | ||||
transactionTableModel = new TransactionTableModel(platformStyle, this); | transactionTableModel = new TransactionTableModel(platformStyle, this); | ||||
recentRequestsTableModel = new RecentRequestsTableModel(this); | recentRequestsTableModel = new RecentRequestsTableModel(this); | ||||
// This timer will be fired repeatedly to update the balance | |||||
pollTimer = new QTimer(this); | |||||
connect(pollTimer, &QTimer::timeout, this, | |||||
&WalletModel::pollBalanceChanged); | |||||
pollTimer->start(MODEL_UPDATE_DELAY); | |||||
subscribeToCoreSignals(); | subscribeToCoreSignals(); | ||||
} | } | ||||
WalletModel::~WalletModel() { | WalletModel::~WalletModel() { | ||||
unsubscribeFromCoreSignals(); | unsubscribeFromCoreSignals(); | ||||
} | } | ||||
void WalletModel::startPollBalance() { | |||||
// This timer will be fired repeatedly to update the balance | |||||
QTimer *timer = new QTimer(this); | |||||
connect(timer, &QTimer::timeout, this, &WalletModel::pollBalanceChanged); | |||||
timer->start(MODEL_UPDATE_DELAY); | |||||
} | |||||
void WalletModel::updateStatus() { | void WalletModel::updateStatus() { | ||||
EncryptionStatus newEncryptionStatus = getEncryptionStatus(); | EncryptionStatus newEncryptionStatus = getEncryptionStatus(); | ||||
if (cachedEncryptionStatus != newEncryptionStatus) { | if (cachedEncryptionStatus != newEncryptionStatus) { | ||||
Q_EMIT encryptionStatusChanged(); | Q_EMIT encryptionStatusChanged(); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 466 Lines • Show Last 20 Lines |