aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-11-05 10:11:28 +0200
committerRiccardo Spagni <ric@spagni.net>2016-11-05 10:11:28 +0200
commit04325f4cd8e34f46cb20c038a0ec2f99aea907fd (patch)
tree270cb714897ec12337ef5c5229d38631dbb41277
parentcda769739e69080cd46f0f9269031dc12737a0b8 (diff)
parentfa1e92c34c1cf8f44d518891c1d24a2986f04538 (diff)
downloadmonzero-gui-04325f4cd8e34f46cb20c038a0ec2f99aea907fd.tar.gz
monzero-gui-04325f4cd8e34f46cb20c038a0ec2f99aea907fd.tar.xz
monzero-gui-04325f4cd8e34f46cb20c038a0ec2f99aea907fd.zip
Merge pull request #99
fa1e92c Disable transfer page if daemon isn't connected or fully synced (Jacob Brydolf)
-rw-r--r--MiddlePanel.qml18
-rw-r--r--main.qml13
2 files changed, 22 insertions, 9 deletions
diff --git a/MiddlePanel.qml b/MiddlePanel.qml
index 475d566a..59a77ba6 100644
--- a/MiddlePanel.qml
+++ b/MiddlePanel.qml
@@ -52,6 +52,9 @@ Rectangle {
signal paymentClicked(string address, string paymentId, double amount, int mixinCount, int priority)
signal generatePaymentIdInvoked()
+ // Disable transfer page if daemon isnt fully synced
+ enabled: (currentView !== transferView || appWindow.daemonSynced)
+
color: "#F0EEEE"
onCurrentViewChanged: {
@@ -279,14 +282,13 @@ Rectangle {
color: "#DBDBDB"
}
-
-
- // indicates disabled state
-// Desaturate {
-// anchors.fill: parent
-// source: parent
-// desaturation: root.enabled ? 0.0 : 1.0
-// }
+ Rectangle {
+ id:desaturate
+ color:"black"
+ anchors.fill: parent
+ opacity: 0.1
+ visible: (root.enabled)? 0 : 1;
+ }
/* connect "payment" click */
diff --git a/main.qml b/main.qml
index 26fa78a7..7b023c87 100644
--- a/main.qml
+++ b/main.qml
@@ -56,6 +56,7 @@ ApplicationWindow {
property int splashCounter: 0
property bool isNewWallet: false
property int restoreHeight:0
+ property bool daemonSynced: false
// true if wallet ever synchronized
property bool walletInitialized : false
@@ -252,10 +253,21 @@ ApplicationWindow {
if (splash.visible) {
hideProcessingSplash()
}
+
+ // Check daemon status
var dCurrentBlock = currentWallet.daemonBlockChainHeight();
var dTargetBlock = currentWallet.daemonBlockChainTargetHeight();
leftPanel.daemonProgress.updateProgress(dCurrentBlock,dTargetBlock);
+ // Daemon connected
+ leftPanel.networkStatus.connected = currentWallet.connected
+
+ // Daemon fully synced
+ // TODO: implement onDaemonSynced or similar in wallet API and don't start refresh thread before daemon is synced
+ daemonSynced = (currentWallet.connected && dCurrentBlock >= dTargetBlock)
+
+
+
// Store wallet after every refresh.
if (currentWallet.blockChainHeight() > 1){
@@ -277,7 +289,6 @@ ApplicationWindow {
walletInitialized = true
}
- leftPanel.networkStatus.connected = currentWallet.connected
onWalletUpdate();
}