WalletManager: non-blocking mining status updates

This commit is contained in:
xiphon
2019-05-30 10:48:57 +00:00
parent c286c7e5a8
commit 73a3549e09
3 changed files with 22 additions and 3 deletions

View File

@@ -258,14 +258,18 @@ Rectangle {
}
}
function update() {
function onMiningStatus(isMining) {
var daemonReady = walletManager.isDaemonLocal(appWindow.currentDaemonAddress) && appWindow.daemonSynced
appWindow.isMining = walletManager.isMining()
appWindow.isMining = isMining;
updateStatusText()
startSoloMinerButton.enabled = !appWindow.isMining && daemonReady
stopSoloMinerButton.enabled = !startSoloMinerButton.enabled && daemonReady
}
function update() {
walletManager.miningStatusAsync();
}
MoneroComponents.StandardDialog {
id: errorPopup
cancelVisible: false
@@ -286,4 +290,8 @@ Rectangle {
function onPageClosed() {
timer.running = false
}
Component.onCompleted: {
walletManager.miningStatus.connect(onMiningStatus);
}
}