2021-04-05 11:37:41 +00: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 09:39:12 +00:00
property bool takingScreenshot: false
2021-04-05 11:37:41 +00:00
Layout.fillWidth: true
MyText {
Layout.fillWidth: true
wrap: true
2021-04-08 01:40:44 +00:00
fontColor: Style . fontColorBright
2021-04-13 09:39:12 +00: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 11:37:41 +00:00
}
MyPushButton {
id: continueButton
text: "Take in-game screenshot"
Layout.preferredWidth: 490
2021-04-13 09:39:12 +00:00
opacity: takingScreenshot ? 0.0 : 1.0
2021-04-05 11:37:41 +00:00
onClicked: {
2021-04-13 09:39:12 +00:00
root . takingScreenshot = true ;
WowletVR . takeQRScreenshot ( ) ;
2021-04-05 11:37:41 +00:00
}
}
MyText {
id: statusMessage
visible: false
Layout.fillWidth: true
wrap: true
2021-04-08 01:40:44 +00:00
fontColor: Style . fontColorBright
2021-04-05 11:37:41 +00:00
text: "Status message."
}
Item {
Layout.fillHeight: true
Layout.fillWidth: true
}
2021-04-13 09:39:12 +00:00
Connections {
target: WowletVR
function onQrScreenshotSuccess ( address ) {
root . takingScreenshot = false ;
console . log ( "onPinLookupReceived" , address ) ;
if ( ! address . startsWith ( "wownero:" ) ) {
messagePopup . showMessage ( "Invalid QR code" , "QR data did not start with \"wownero:\"" ) ;
return ;
}
if ( sendStateView . currentView === sendStateView . qrPage ) {
sendStateController . destinationAddress = address . slice ( 8 ) ;
sendStateView . state = "transferPage" ;
}
}
function onQrScreenshotFailed ( msg ) {
root . takingScreenshot = false ;
console . log ( "onQrScreenshotFailed" , msg ) ;
messagePopup . showMessage ( "QR scan failure" , msg )
reset ( ) ;
}
}
2021-04-09 16:00:12 +00:00
function reset ( ) {
2021-04-13 09:39:12 +00:00
root . takingScreenshot = false ;
2021-04-09 16:00:12 +00:00
}
2021-04-05 11:37:41 +00:00
2021-04-09 16:00:12 +00:00
function onPageCompleted ( previousView ) {
reset ( ) ;
2021-04-05 11:37:41 +00:00
}
2021-04-13 09:39:12 +00:00
}