import QtQuick 2.7 import QtQuick.Controls 2.0 import QtQuick.Layouts 1.3 import QtQuick.Dialogs 1.2 import "." import "../common" MyStackViewPage { id: root headerText: "Receive" content: ColumnLayout { Layout.fillWidth: true spacing: 30 RowLayout { spacing: 30 Layout.fillWidth: true ColumnLayout { spacing: 20 Layout.fillWidth: true Rectangle { color: "transparent" Layout.fillWidth: true Layout.preferredHeight: 120 MyText { width: parent.width wrap: true fontSize: 14 text: "Give the following 4 digit PIN to the person that is sending you Wownero. PIN's are valid for 10 minutes and automatically renew." } } Rectangle { color: "transparent" Layout.fillWidth: true Layout.preferredHeight: 220 ColumnLayout { spacing: 20 MyText { id: statusText width: parent.width visible: true fontSize: 14 text: "Generating PIN..." } Text { id: pinText visible: false text: "- - - -" color: "#ffffff" font.bold: true font.pointSize: 40 leftPadding: 20 rightPadding: 20 Rectangle { z: parent.z - 1 anchors.fill: parent color: "black" } } } } Item { Layout.fillWidth: true Layout.fillHeight: true } } Rectangle { color: "#cccccc" width: 1 Layout.fillHeight: true } ColumnLayout { Layout.fillWidth: true Rectangle { color: "transparent" Layout.fillWidth: true Layout.preferredHeight: 80 Layout.bottomMargin: 20 MyText { width: parent.width fontSize: 14 wrap: true text: "Alternatively, you may use one of the following methods to retreive your address." } } MyPushButton { id: viewAddress text: "View address" Layout.preferredHeight: 70 Layout.fillWidth: true onClicked: { //walletView.push(chaperoneAdditionalPage) } } MyPushButton { id: copyToClipboard text: "Copy address to clipboard" Layout.preferredHeight: 70 Layout.fillWidth: true onClicked: { MyResources.playFocusChangedSound() walletView.push(chaperoneAdditionalPage) } } MyPushButton { id: writeQRcode text: "Save QR image" Layout.preferredHeight: 70 Layout.fillWidth: true onClicked: { chaperoneNewProfileDialog.open(); } } Item { Layout.fillHeight: true Layout.fillWidth: true } } } Item { Layout.fillHeight: true Layout.fillWidth: true } } function onPageCompleted() { console.log("onPageCompleted() ReceivePage") pinAskTimer.start(); askReceivingPIN(); } function resetPage() { pinAskTimer.stop(); statusText.visible = true; statusText.text = "Generating PIN..."; pinText.visible = false; pinText.text = "- - - -"; } onBackClicked: { resetPage(); } Timer { id: pinAskTimer interval: 1000 * 5; running: false; repeat: true onTriggered: askReceivingPIN() triggeredOnStart: false } function askReceivingPIN() { ctx.onAskReceivingPIN(); } Connections { target: ctx function onPinReceived(pin) { console.log("onPINReceived", pin); statusText.visible = false; pinText.visible = true; pinText.text = pin[0] + " " + pin[1] + " " + pin[2] + " " + pin[3]; } } Connections { target: OverlayController function onDashboardDeactivated() { console.log("onDashboardDeactivated()") pinAskTimer.stop(); } function onDashboardActivated() { console.log("onDashboardActivated()") if(walletView.currentItem == root) pinAskTimer.start(); } } }