Wallet::daemonBlockChainHeight(); BC sync progress in GUI

This commit is contained in:
Ilya Kitaev
2016-09-26 22:55:25 +03:00
parent 7e769b3a87
commit f402fd9e7d
5 changed files with 84 additions and 16 deletions

View File

@@ -156,8 +156,12 @@ ApplicationWindow {
currentWallet = wallet
currentWallet.refreshed.connect(onWalletRefresh)
currentWallet.updated.connect(onWalletUpdate)
currentWallet.newBlock.connect(onWalletNewBlock)
console.log("initializing with daemon address: ", persistentSettings.daemon_address)
currentWallet.initAsync(persistentSettings.daemon_address, 0);
}
function walletPath() {
@@ -219,6 +223,14 @@ ApplicationWindow {
onWalletUpdate();
}
function onWalletNewBlock(blockHeight) {
if (splash.visible) {
var progressText = qsTr("Synchronizing blocks %1/%2").arg(blockHeight.toFixed(0)).arg(currentWallet.daemonBlockChainHeight().toFixed(0));
console.log("Progress text: " + progressText);
splash.heightProgressText = progressText
}
}
function walletsFound() {
var wallets = walletManager.findWallets(moneroAccountsDir);
@@ -418,7 +430,7 @@ ApplicationWindow {
height: appWindow.height / 2
x: (appWindow.width - width) / 2 + appWindow.x
y: (appWindow.height - height) / 2 + appWindow.y
message: qsTr("Please wait...")
messageText: qsTr("Please wait...")
}