@ -6,249 +6,134 @@ import "."
import "../common"
import "../common"
MyStackViewPage {
MyStackViewPage {
id: root
headerText: "Receive"
headerText: "Receive"
MyDialogOkPopup {
id: chaperoneMessageDialog
function showMessage ( title , text ) {
dialogTitle = title
dialogText = text
open ( )
}
}
MyDialogOkCancelPopup {
id: chaperoneDeleteProfileDialog
property int profileIndex: - 1
dialogTitle: "Delete Profile"
dialogText: "Do you really want to delete this profile?"
onClosed: {
if ( okClicked ) {
ChaperoneTabController . deleteChaperoneProfile ( profileIndex )
}
}
}
MyDialogOkCancelPopup {
id: chaperoneNewProfileDialog
dialogTitle: "Create New Profile"
dialogWidth: 800
dialogHeight: 780
dialogContentItem: ColumnLayout {
RowLayout {
Layout.topMargin: 16
Layout.leftMargin: 16
Layout.rightMargin: 16
MyText {
text: "Name: "
}
MyTextField {
id: chaperoneNewProfileName
keyBoardUID: 390
color: "#cccccc"
text: ""
Layout.fillWidth: true
font.pointSize: 20
function onInputEvent ( input ) {
chaperoneNewProfileName . text = input
}
}
}
MyText {
Layout.topMargin: 24
text: "What to include:"
}
MyToggleButton {
id: chaperoneNewProfileIncludeGeometry
Layout.leftMargin: 32
text: "Chaperone Geometry"
}
MyToggleButton {
id: chaperoneNewProfileIncludeStyle
Layout.leftMargin: 32
text: "Chaperone Style"
}
MyToggleButton {
id: chaperoneNewProfileIncludeBoundsColor
Layout.leftMargin: 32
text: "Chaperone Color"
}
MyToggleButton {
id: chaperoneNewProfileIncludeVisibility
Layout.leftMargin: 32
text: "Visibility Setting"
}
MyToggleButton {
id: chaperoneNewProfileIncludeFadeDistance
Layout.leftMargin: 32
text: "Fade Distance Setting"
}
MyToggleButton {
id: chaperoneNewProfileIncludeCenterMarker
Layout.leftMargin: 32
text: "Center Marker Setting"
}
MyToggleButton {
id: chaperoneNewProfileIncludePlaySpaceMarker
Layout.leftMargin: 32
text: "Play Space Marker Setting"
}
MyToggleButton {
id: chaperoneNewProfileIncludeFloorBoundsMarker
Layout.leftMargin: 32
text: "Floor Bounds Always On Setting"
}
MyToggleButton {
id: chaperoneNewProfileIncludeForceBounds
Layout.leftMargin: 32
text: "Force Bounds Setting"
}
MyToggleButton {
id: chaperoneNewProfileIncludeProximityWarnings
Layout.leftMargin: 32
text: "Proximity Warning Settings"
}
}
onClosed: {
if ( okClicked ) {
if ( chaperoneNewProfileName . text == "" ) {
chaperoneMessageDialog . showMessage ( "Create New Profile" , "ERROR: Empty profile name." )
} else if ( ! chaperoneNewProfileIncludeGeometry . checked
&& ! chaperoneNewProfileIncludeVisibility . checked
&& ! chaperoneNewProfileIncludeFadeDistance . checked
&& ! chaperoneNewProfileIncludeCenterMarker . checked
&& ! chaperoneNewProfileIncludePlaySpaceMarker . checked
&& ! chaperoneNewProfileIncludeFloorBoundsMarker . checked
&& ! chaperoneNewProfileIncludeBoundsColor . checked
&& ! chaperoneNewProfileIncludeStyle . checked
&& ! chaperoneNewProfileIncludeForceBounds . checked
&& ! chaperoneNewProfileIncludeProximityWarnings . checked ) {
chaperoneMessageDialog . showMessage ( "Create New Profile" , "ERROR: Nothing included." )
} else if ( Math . abs ( MoveCenterTabController . offsetX ) > 0.00000000001
|| Math . abs ( MoveCenterTabController . offsetY ) > 0.00000000001
|| Math . abs ( MoveCenterTabController . offsetZ ) > 0.00000000001
|| MoveCenterTabController . rotation !== 0 ) {
chaperoneMessageDialog . showMessage ( "Create New Profile" , "ERROR: Offsets not reset." )
} else {
ChaperoneTabController . addChaperoneProfile ( chaperoneNewProfileName . text ,
chaperoneNewProfileIncludeGeometry . checked ,
chaperoneNewProfileIncludeVisibility . checked ,
chaperoneNewProfileIncludeFadeDistance . checked ,
chaperoneNewProfileIncludeCenterMarker . checked ,
chaperoneNewProfileIncludePlaySpaceMarker . checked ,
chaperoneNewProfileIncludeFloorBoundsMarker . checked ,
chaperoneNewProfileIncludeBoundsColor . checked ,
chaperoneNewProfileIncludeStyle . checked ,
chaperoneNewProfileIncludeForceBounds . checked ,
chaperoneNewProfileIncludeProximityWarnings . checked )
}
}
}
function openPopup ( ) {
chaperoneNewProfileName . text = ""
chaperoneNewProfileIncludeGeometry . checked = false
chaperoneNewProfileIncludeVisibility . checked = false
chaperoneNewProfileIncludeFadeDistance . checked = false
chaperoneNewProfileIncludeCenterMarker . checked = false
chaperoneNewProfileIncludePlaySpaceMarker . checked = false
chaperoneNewProfileIncludeFloorBoundsMarker . checked = false
chaperoneNewProfileIncludeBoundsColor . checked = false
chaperoneNewProfileIncludeStyle . checked = false
chaperoneNewProfileIncludeForceBounds . checked = false
chaperoneNewProfileIncludeProximityWarnings . checked = false
open ( )
}
}
content: ColumnLayout {
content: ColumnLayout {
Layout.fillWidth: true
spacing: 30
spacing: 30
MyText {
RowLayout {
spacing: 30
Layout.fillWidth: true
Layout.fillWidth: true
wrap: true
text: "Give the following 4 digit PIN to the person that is sending you Wownero. PIN's are valid for 5 minutes and automatically renew."
}
ColumnLayout {
ColumnLayout {
MyText {
spacing: 20
visible: false
Layout.fillWidth: true
fontSize: 14
text: "Currently generating PIN."
Rectangle {
}
color: "transparent"
Layout.fillWidth: true
Layout.preferredHeight: 120
Text {
MyText {
visible: true
width: parent . width
text: "0 0 0 0"
wrap: true
color: "#ffffff"
fontSize: 14
font.bold: true
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."
font.pointSize: 40
}
leftPadding: 20
}
rightPadding: 20
Rectangle {
Rectangle {
z: parent . z - 1
color: "transparent"
anchors.fill: parent
Layout.fillWidth: true
color: "black"
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"
}
}
}
}
}
}
MyText {
Item {
id: expireText
Layout.fillWidth: true
visible: true
Layout.fillHeight: true
fontSize: 14
}
text: "Expires in 40 seconds."
}
}
Rectangle {
color: "#cccccc"
width: 1
Layout.fillHeight: true
}
}
ColumnLayout {
Layout.fillWidth: true
Rectangle {
Rectangle {
color: "#cccccc"
color: "transparent"
height: 1
Layout.fillWidth: true
Layout.topMargin: 10
Layout.preferredHeight: 80
Layout.fillWidth: true
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."
}
}
MyText {
MyPushButton {
Layout.fillWidth: true
id: viewAddress
wrap: true
text: "View address"
text: "Alternatively, you may use one of the following methods."
Layout.preferredHeight: 70
}
Layout.fillWidth: true
RowLayout {
onClicked: {
Layout.topMargin: 10
/ / w a l l e t V i e w . p u s h ( c h a p e r o n e A d d i t i o n a l P a g e )
}
}
MyPushButton {
MyPushButton {
id: viewAddress
id: copyToClipboard
text: "View address"
text: "Copy address to clipboard"
Layout.preferredWidth: 360
Layout.preferredHeight: 70
Layout.fillWidth: true
onClicked: {
onClicked: {
MyResources . playFocusChangedSound ( )
MyResources . playFocusChangedSound ( )
walletView . push ( chaperoneAdditionalPage )
walletView . push ( chaperoneAdditionalPage )
}
}
}
}
MyPushButton {
MyPushButton {
id: copyToClipboard
id: writeQRcode
text: "Copy address to clipboard"
text: "Save QR image"
Layout.preferredWidth: 540
Layout.preferredHeight: 70
Layout.fillWidth: true
onClicked: {
onClicked: {
MyResources . playFocusChangedSound ( )
chaperoneNewProfileDialog . open ( ) ;
walletView . push ( chaperoneAdditionalPage )
}
}
}
}
MyPushButton {
id: writeQRcode
text: "QR image"
Layout.preferredWidth: 340
onClicked: {
Item {
chaperoneNewProfileDialog . open ( ) ;
Layout.fillHeight: true
Layout.fillWidth: true
}
}
}
}
}
}
@ -262,5 +147,58 @@ MyStackViewPage {
function onPageCompleted ( ) {
function onPageCompleted ( ) {
console . log ( "onPageCompleted() ReceivePage" )
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 ( ) ;
}
}
}
}
}