From af933da0c921afe6479133f04f0f318526d5afda Mon Sep 17 00:00:00 2001 From: Jacob Brydolf Date: Sun, 6 Nov 2016 23:40:26 +0100 Subject: [PATCH 1/2] disconnect slots before reconnecting --- main.qml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/main.qml b/main.qml index 7b023c87..936cd046 100644 --- a/main.qml +++ b/main.qml @@ -147,6 +147,10 @@ ApplicationWindow { translationManager.setLanguage(locale.split("_")[0]); } + // disconnect handlers before connecting + middlePanel.paymentClicked.disconnect(handlePayment); + middlePanel.checkPaymentClicked.disconnect(handleCheckPayment); + middlePanel.paymentClicked.connect(handlePayment); // basicPanel.paymentClicked.connect(handlePayment); @@ -190,11 +194,21 @@ ApplicationWindow { function connectWallet(wallet) { showProcessingSplash() currentWallet = wallet + + // Disconnect before connecting + currentWallet.refreshed.disconnect(onWalletRefresh) + currentWallet.updated.disconnect(onWalletUpdate) + currentWallet.newBlock.disconnect(onWalletNewBlock) + currentWallet.moneySpent.disconnect(onWalletMoneySent) + currentWallet.moneyReceived.disconnect(onWalletMoneyReceived) + currentWallet.refreshed.connect(onWalletRefresh) currentWallet.updated.connect(onWalletUpdate) currentWallet.newBlock.connect(onWalletNewBlock) currentWallet.moneySpent.connect(onWalletMoneySent) currentWallet.moneyReceived.connect(onWalletMoneyReceived) + + console.log("initializing with daemon address: ", persistentSettings.daemon_address) console.log("Recovering from seed: ", persistentSettings.is_recovering) console.log("restore Height", persistentSettings.restore_height) From 5c330b071a4dd1b17917f6aa2031406f94fbf4a3 Mon Sep 17 00:00:00 2001 From: Jacob Brydolf Date: Tue, 8 Nov 2016 13:28:05 +0100 Subject: [PATCH 2/2] remove PR #111 dependency --- main.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.qml b/main.qml index 936cd046..a568c5f7 100644 --- a/main.qml +++ b/main.qml @@ -149,8 +149,10 @@ ApplicationWindow { // disconnect handlers before connecting middlePanel.paymentClicked.disconnect(handlePayment); - middlePanel.checkPaymentClicked.disconnect(handleCheckPayment); - + // TODO: remove if statement when PR #111 is merged + if(typeof(handleCheckPayment) !== "undefined") { + middlePanel.checkPaymentClicked.disconnect(handleCheckPayment); + } middlePanel.paymentClicked.connect(handlePayment); // basicPanel.paymentClicked.connect(handlePayment);