aboutsummaryrefslogtreecommitdiff
path: root/main.qml
diff options
context:
space:
mode:
authorJaquee <jaquee.monero@gmail.com>2018-03-20 19:19:30 +0100
committerJaquee <jaquee.monero@gmail.com>2018-03-20 19:23:04 +0100
commitee6dd2ec56a8b4e426dc3d96a8824d377d43934e (patch)
treeb2dc06e37e558631af066ce523e47edbe38b576a /main.qml
parentda0155e26027523189906f3c66de4278fa13b5c0 (diff)
downloadmonzero-gui-ee6dd2ec56a8b4e426dc3d96a8824d377d43934e.tar.gz
monzero-gui-ee6dd2ec56a8b4e426dc3d96a8824d377d43934e.tar.xz
monzero-gui-ee6dd2ec56a8b4e426dc3d96a8824d377d43934e.zip
progress bar improvements
Diffstat (limited to 'main.qml')
-rw-r--r--main.qml25
1 files changed, 20 insertions, 5 deletions
diff --git a/main.qml b/main.qml
index 78818a96..afadb2ac 100644
--- a/main.qml
+++ b/main.qml
@@ -57,6 +57,7 @@ ApplicationWindow {
property bool isNewWallet: false
property int restoreHeight:0
property bool daemonSynced: false
+ property bool walletSynced: false
property int maxWindowHeight: (isAndroid || isIOS)? screenHeight : (screenHeight < 900)? 720 : 800;
property bool daemonRunning: false
property alias toolTip: toolTip
@@ -405,6 +406,9 @@ ApplicationWindow {
// Daemon connected
leftPanel.networkStatus.connected = currentWallet.connected()
+ // Wallet height
+ var bcHeight = currentWallet.blockChainHeight();
+
// Check daemon status
var dCurrentBlock = currentWallet.daemonBlockChainHeight();
var dTargetBlock = currentWallet.daemonBlockChainTargetHeight();
@@ -412,18 +416,25 @@ ApplicationWindow {
// TODO: implement onDaemonSynced or similar in wallet API and don't start refresh thread before daemon is synced
// targetBlock = currentBlock = 1 before network connection is established.
daemonSynced = dCurrentBlock >= dTargetBlock && dTargetBlock != 1
- // Update daemon sync progress
- leftPanel.daemonProgressBar.updateProgress(dCurrentBlock,dTargetBlock);
- if(!daemonSynced)
+ walletSynced = bcHeight >= dTargetBlock
+
+ // Update progress bars
+ if(!daemonSynced) {
+ leftPanel.daemonProgressBar.updateProgress(dCurrentBlock,dTargetBlock, dTargetBlock-dCurrentBlock);
leftPanel.progressBar.updateProgress(0,dTargetBlock, dTargetBlock, qsTr("Waiting for daemon to sync"));
+ } else {
+ leftPanel.daemonProgressBar.updateProgress(dCurrentBlock,dTargetBlock, 0, qsTr("Daemon is synchronized (%1)").arg(dCurrentBlock.toFixed(0)));
+ if(walletSynced)
+ leftPanel.progressBar.updateProgress(bcHeight,dTargetBlock,dTargetBlock-bcHeight, qsTr("Wallet is synchronized"))
+ }
+
// Update wallet sync progress
updateSyncing((currentWallet.connected() !== Wallet.ConnectionStatus_Disconnected) && !daemonSynced)
// Update transfer page status
middlePanel.updateStatus();
// Refresh is succesfull if blockchain height > 1
- if (currentWallet.blockChainHeight() > 1){
-
+ if (bcHeight > 1){
// Save new wallet after first refresh
// Wallet is nomrmally saved to disk on app exit. This prevents rescan from block 0 after app crash
if(isNewWallet){
@@ -498,6 +509,10 @@ ApplicationWindow {
}
leftPanel.progressBar.updateProgress(blockHeight,targetHeight, blocksToSync);
+
+ // If wallet is syncing, daemon is already synced
+ leftPanel.daemonProgressBar.updateProgress(1,1,0,qsTr("Daemon is synchronized"));
+
foundNewBlock = true;
}