From 3b76636d6b172f3afe6224c5ccb05e8307df4c13 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Thu, 5 Apr 2018 10:32:43 +0200 Subject: [PATCH] Refactoring signal functions --- main.qml | 90 +++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 80 insertions(+), 10 deletions(-) diff --git a/main.qml b/main.qml index b481985c..7b8ba21b 100644 --- a/main.qml +++ b/main.qml @@ -1315,16 +1315,86 @@ ApplicationWindow { anchors.top: mobileHeader.bottom anchors.left: parent.left anchors.bottom: parent.bottom - onDashboardClicked: { middlePanel.state = "Dashboard"; if(isMobile) hideMenu(); updateBalance(); } - onTransferClicked: { middlePanel.state = "Transfer"; if(isMobile) hideMenu(); updateBalance(); } - onReceiveClicked: { middlePanel.state = "Receive"; if(isMobile) hideMenu(); updateBalance(); } - onTxkeyClicked: { middlePanel.state = "TxKey"; if(isMobile) hideMenu(); updateBalance(); } - onSharedringdbClicked: { middlePanel.state = "SharedRingDB"; if(isMobile) hideMenu(); updateBalance(); } - onHistoryClicked: { middlePanel.state = "History"; if(isMobile) hideMenu(); updateBalance(); } - onAddressBookClicked: { middlePanel.state = "AddressBook"; if(isMobile) hideMenu(); updateBalance(); } - onMiningClicked: { middlePanel.state = "Mining"; if(isMobile) hideMenu(); updateBalance(); } - onSignClicked: { middlePanel.state = "Sign"; if(isMobile) hideMenu(); updateBalance(); } - onSettingsClicked: { middlePanel.state = "Settings"; if(isMobile) hideMenu(); updateBalance(); } + onDashboardClicked: { + middlePanel.state = "Dashboard"; + if(isMobile) { + hideMenu(); + } + updateBalance(); + } + + onTransferClicked: { + middlePanel.state = "Transfer"; + if(isMobile) { + hideMenu(); + } + updateBalance(); + } + + onReceiveClicked: { + middlePanel.state = "Receive"; + if(isMobile) { + hideMenu(); + } + updateBalance(); + } + + onTxkeyClicked: { + middlePanel.state = "TxKey"; + if(isMobile) { + hideMenu(); + } + updateBalance(); + } + + onSharedringdbClicked: { + middlePanel.state = "SharedRingDB"; + if(isMobile) { + hideMenu(); + } + updateBalance(); + } + + onHistoryClicked: { + middlePanel.state = "History"; + if(isMobile) { + hideMenu(); + } + updateBalance(); + } + + onAddressBookClicked: { + middlePanel.state = "AddressBook"; + if(isMobile) { + hideMenu(); + } + updateBalance(); + } + + onMiningClicked: { + middlePanel.state = "Mining"; + if(isMobile) { + hideMenu(); + } + updateBalance(); + } + + onSignClicked: { + middlePanel.state = "Sign"; + if(isMobile) { + hideMenu(); + } + updateBalance(); + } + + onSettingsClicked: { + middlePanel.state = "Settings"; + if(isMobile) { + hideMenu(); + } + updateBalance(); + } + onKeysClicked: { passwordDialog.onAcceptedCallback = function() { if(walletPassword === passwordDialog.password){