Merge pull request #12007 from zfox23/commerce_moreSecurityImages

Commerce: More security images!
This commit is contained in:
Zach Fox 2017-12-18 12:06:43 -08:00 committed by GitHub
commit affd67d7d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 31 additions and 34 deletions

View file

@ -25,10 +25,6 @@ Item {
id: root; id: root;
SecurityImageModel {
id: securityImageModel;
}
// Username Text // Username Text
RalewayRegular { RalewayRegular {
id: usernameText; id: usernameText;

View file

@ -26,10 +26,6 @@ Item {
id: root; id: root;
property bool justSubmitted: false; property bool justSubmitted: false;
SecurityImageModel {
id: securityImageModel;
}
Hifi.QmlCommerce { Hifi.QmlCommerce {
id: commerce; id: commerce;
@ -213,4 +209,8 @@ Item {
securityImageSubmitButton.enabled = true; securityImageSubmitButton.enabled = true;
securityImageSubmitButton.text = "Submit"; securityImageSubmitButton.text = "Submit";
} }
function initModel() {
securityImageSelection.initModel();
}
} }

View file

@ -15,29 +15,28 @@ import QtQuick 2.5
ListModel { ListModel {
id: root; id: root;
ListElement{
sourcePath: "images/01.jpg" function initModel() {
securityImageEnumValue: 1; var array = [];
while (array.length < 6) {
// We currently have 34 security images to choose from
var randomNumber = Math.floor(Math.random() * 34) + 1;
if (array.indexOf(randomNumber) > -1) {
continue;
}
array[array.length] = randomNumber;
}
var modelElement;
for (var i = 0; i < 6; i++) {
modelElement = { "sourcePath":"images/" + addLeadingZero(array[i]) + ".jpg", "securityImageEnumValue": (i + 1) }
root.insert(i, modelElement);
}
} }
ListElement{
sourcePath: "images/02.jpg" function addLeadingZero(n) {
securityImageEnumValue: 2; return n < 10 ? '0' + n : '' + n;
}
ListElement{
sourcePath: "images/03.jpg"
securityImageEnumValue: 3;
}
ListElement{
sourcePath: "images/04.jpg"
securityImageEnumValue: 4;
}
ListElement{
sourcePath: "images/05.jpg"
securityImageEnumValue: 5;
}
ListElement{
sourcePath: "images/06.jpg"
securityImageEnumValue: 6;
} }
function getImagePathFromImageID(imageID) { function getImagePathFromImageID(imageID) {

View file

@ -95,6 +95,10 @@ Item {
function getSelectedImageIndex() { function getSelectedImageIndex() {
return gridModel.get(securityImageGrid.currentIndex).securityImageEnumValue; return gridModel.get(securityImageGrid.currentIndex).securityImageEnumValue;
} }
function initModel() {
gridModel.initModel();
}
// //
// FUNCTION DEFINITIONS END // FUNCTION DEFINITIONS END
// //

View file

@ -82,10 +82,6 @@ Rectangle {
} }
} }
SecurityImageModel {
id: securityImageModel;
}
HifiCommerceCommon.CommerceLightbox { HifiCommerceCommon.CommerceLightbox {
id: lightboxPopup; id: lightboxPopup;
visible: false; visible: false;
@ -342,6 +338,7 @@ Rectangle {
passphraseChange.clearPassphraseFields(); passphraseChange.clearPassphraseFields();
passphraseChange.resetSubmitButton(); passphraseChange.resetSubmitButton();
} else if (msg.method === 'walletSecurity_changeSecurityImage') { } else if (msg.method === 'walletSecurity_changeSecurityImage') {
securityImageChange.initModel();
root.activeView = "securityImageChange"; root.activeView = "securityImageChange";
} }
} }

View file

@ -236,6 +236,7 @@ Item {
height: 50; height: 50;
text: "Set Up Wallet"; text: "Set Up Wallet";
onClicked: { onClicked: {
securityImageSelection.initModel();
root.activeView = "step_2"; root.activeView = "step_2";
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB