This commit is contained in:
Zach Fox 2017-08-18 16:36:11 -07:00
parent 94da149ac8
commit a07598c738
4 changed files with 32 additions and 5 deletions

View file

@ -24,6 +24,14 @@ Item {
HifiConstants { id: hifi; }
id: root;
// This object is always used in a popup.
// This MouseArea is used to prevent a user from being
// able to click on a button/mouseArea underneath the popup.
MouseArea {
anchors.fill: parent;
propagateComposedEvents: false;
}
Hifi.QmlCommerce {
id: commerce;

View file

@ -27,6 +27,12 @@ Rectangle {
// Style
color: hifi.colors.baseGray;
onVisibleChanged: {
if (visible) {
root.resetSubmitButton();
}
}
Connections {
target: passphraseSelection;
onSendMessageToLightbox: {
@ -150,7 +156,10 @@ Rectangle {
width: 100;
text: "Submit";
onClicked: {
passphraseSelection.validateAndSubmitPassphrase()
if (passphraseSelection.validateAndSubmitPassphrase()) {
passphraseSubmitButton.text = "Submitting...";
passphraseSubmitButton.enabled = false;
}
}
}
}

View file

@ -74,6 +74,7 @@ Item {
}
MouseArea {
anchors.fill: parent;
propagateComposedEvents: false;
onClicked: {
securityImageGrid.currentIndex = index;
}

View file

@ -28,20 +28,24 @@ Rectangle {
// Style
color: hifi.colors.baseGray;
onVisibleChanged: {
if (visible) {
root.resetSubmitButton();
}
}
Hifi.QmlCommerce {
id: commerce;
onSecurityImageResult: {
if (imageID !== 0) { // Success submitting new security image
if (root.justSubmitted) {
securityImageSubmitButton.enabled = true;
securityImageSubmitButton.text = "Submit";
root.resetSubmitButton();
root.visible = false;
}
} else if (root.justSubmitted) {
// Error submitting new security image.
securityImageSubmitButton.enabled = true
securityImageSubmitButton.text = "Submit";
root.resetSubmitButton();
root.justSubmitted = false;
}
}
@ -186,4 +190,9 @@ Rectangle {
//
// SECURITY IMAGE SELECTION END
//
function resetSubmitButton() {
securityImageSubmitButton.enabled = true;
securityImageSubmitButton.text = "Submit";
}
}