wowlet/src/vr/qml/wallet/send/SendPageQR.qml

77 lines
1.9 KiB
QML
Raw Normal View History

2021-04-05 12:37:41 +01:00
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import "../../common"
ColumnLayout {
id: root
spacing: 20
2021-04-13 10:39:12 +01:00
property bool takingScreenshot: false
2021-04-05 12:37:41 +01:00
Layout.fillWidth: true
MyText {
Layout.fillWidth: true
wrap: true
2021-04-08 02:40:44 +01:00
fontColor: Style.fontColorBright
2021-04-13 10:39:12 +01:00
text: "Look at a QR code and press the button below to take a screenshot. Note: make sure to look at the center of the QR code. The parser works best with simple, straight-forward QR codes. When using more complex QR codes, make sure to properly fill your screen with the QR code itself (plus some margins)."
2021-04-05 12:37:41 +01:00
}
MyPushButton {
id: continueButton
text: "Take in-game screenshot"
Layout.preferredWidth: 490
2021-04-13 10:39:12 +01:00
opacity: takingScreenshot ? 0.0 : 1.0
2021-04-05 12:37:41 +01:00
onClicked: {
2021-04-13 10:39:12 +01:00
root.takingScreenshot = true;
WowletVR.takeQRScreenshot();
2021-04-05 12:37:41 +01:00
}
}
MyText {
id: statusMessage
visible: false
Layout.fillWidth: true
wrap: true
2021-04-08 02:40:44 +01:00
fontColor: Style.fontColorBright
2021-04-05 12:37:41 +01:00
text: "Status message."
}
Item {
Layout.fillHeight: true
Layout.fillWidth: true
}
2021-04-13 10:39:12 +01:00
Connections {
target: WowletVR
function onQrScreenshotSuccess(address) {
root.takingScreenshot = false;
console.log("onPinLookupReceived", address);
if(sendStateView.currentView === sendStateView.qrPage) {
2021-05-14 21:42:14 +01:00
sendStateController.destinationAddress = address;
2021-04-13 10:39:12 +01:00
sendStateView.state = "transferPage";
}
}
function onQrScreenshotFailed(msg) {
root.takingScreenshot = false;
console.log("onQrScreenshotFailed", msg);
messagePopup.showMessage("QR scan failure", msg)
reset();
}
}
2021-04-09 17:00:12 +01:00
function reset() {
2021-04-13 10:39:12 +01:00
root.takingScreenshot = false;
2021-04-09 17:00:12 +01:00
}
2021-04-05 12:37:41 +01:00
2021-04-09 17:00:12 +01:00
function onPageCompleted(previousView){
reset();
2021-04-05 12:37:41 +01:00
}
2021-04-13 10:39:12 +01:00
}