wallet: show notification on mining payment
Some checks are pending
ci/gh-actions/build / build-ubuntu-without-scanner (push) Waiting to run
ci/gh-actions/guix / cache-sources (push) Waiting to run
ci/gh-actions/guix / x86_64-w64-mingw32 (push) Blocked by required conditions
ci/gh-actions/guix / aarch64-linux-gnu (push) Blocked by required conditions
ci/gh-actions/guix / arm-linux-gnueabihf (push) Blocked by required conditions
ci/gh-actions/guix / arm64-apple-darwin (push) Blocked by required conditions
ci/gh-actions/guix / i686-linux-gnu (push) Blocked by required conditions
ci/gh-actions/guix / riscv64-linux-gnu (push) Blocked by required conditions
ci/gh-actions/guix / x86_64-apple-darwin (push) Blocked by required conditions
ci/gh-actions/guix / x86_64-linux-gnu.no-tor-bundle (push) Blocked by required conditions
ci/gh-actions/guix / x86_64-linux-gnu.pack (push) Blocked by required conditions
ci/gh-actions/guix / x86_64-linux-gnu (push) Blocked by required conditions
ci/gh-actions/guix / x86_64-w64-mingw32.installer (push) Blocked by required conditions
ci/gh-actions/guix / bundle-logs (push) Blocked by required conditions

This commit is contained in:
tobtoht 2024-10-06 22:43:37 +02:00
parent c355370c0f
commit 9a37d4789f
No known key found for this signature in database
GPG key ID: E45B10DD027D2472
6 changed files with 12 additions and 6 deletions

2
monero

@ -1 +1 @@
Subproject commit d50ba728d79cc3a96c928f7736503268ad567cba
Subproject commit ed8e0d19519f7fe50d0a8acc203e7d39c2aefbbc

View file

@ -485,6 +485,12 @@ void MainWindow::initWalletContext() {
m_windowManager->notify("Payment received", notify, 5000);
}
});
connect(m_wallet, &Wallet::moneyReceived, this, [this](const QString &txId, uint64_t amount, bool coinbase){
if (m_wallet->isSynchronized() && !m_locked && coinbase) {
auto notify = QString("%1 XMR").arg(WalletManager::displayAmount(amount, false));
m_windowManager->notify("Mining payment received", notify, 5000);
}
});
// Device
connect(m_wallet, &Wallet::deviceButtonRequest, this, &MainWindow::onDeviceButtonRequest);

View file

@ -435,7 +435,7 @@ signals:
void refreshed(bool success, const QString &message);
void moneySpent(const QString &txId, quint64 amount);
void moneyReceived(const QString &txId, quint64 amount);
void moneyReceived(const QString &txId, quint64 amount, bool coinbase);
void unconfirmedMoneyReceived(const QString &txId, quint64 amount);
void newBlock(quint64 height, quint64 targetHeight);
void walletCreationHeightChanged();

View file

@ -25,13 +25,13 @@ void WalletListenerImpl::moneySpent(const std::string &txId, uint64_t amount)
emit m_wallet->moneySpent(qTxId, amount);
}
void WalletListenerImpl::moneyReceived(const std::string &txId, uint64_t amount)
void WalletListenerImpl::moneyReceived(const std::string &txId, uint64_t amount, bool coinbase)
{
// Incoming tx included in a block.
QString qTxId = QString::fromStdString(txId);
qDebug() << Q_FUNC_INFO << qTxId << " " << WalletManager::displayAmount(amount);
emit m_wallet->moneyReceived(qTxId, amount);
emit m_wallet->moneyReceived(qTxId, amount, coinbase);
}
void WalletListenerImpl::unconfirmedMoneyReceived(const std::string &txId, uint64_t amount)

View file

@ -16,7 +16,7 @@ public:
virtual void moneySpent(const std::string &txId, uint64_t amount) override;
virtual void moneyReceived(const std::string &txId, uint64_t amount) override;
virtual void moneyReceived(const std::string &txId, uint64_t amount, bool coinbase) override;
virtual void unconfirmedMoneyReceived(const std::string &txId, uint64_t amount) override;

View file

@ -13,7 +13,7 @@ public:
explicit WalletPassphraseListenerImpl(WalletManager * mgr): m_mgr(mgr), m_phelper(mgr) {}
void moneySpent(const std::string &txId, uint64_t amount) override { (void)txId; (void)amount; };
void moneyReceived(const std::string &txId, uint64_t amount) override { (void)txId; (void)amount; };
void moneyReceived(const std::string &txId, uint64_t amount, bool coinbase) override { (void)txId; (void)amount; (void)coinbase;};
void unconfirmedMoneyReceived(const std::string &txId, uint64_t amount) override { (void)txId; (void)amount; };
void newBlock(uint64_t height) override { (void) height; };
void updated() override {};