Merge pull request #12251 from zfox23/commerce_fixMacSecurityPic

Fix MacOS Security Pic visibility; fix incorrect button state when changing pic
This commit is contained in:
John Conklin II 2018-01-25 09:42:32 -08:00 committed by GitHub
commit 5ac2e9da15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 15 deletions

View file

@ -193,7 +193,7 @@ Item {
color: hifi.colors.white;
}
// "Change Passphrase" button
// "Change Security Pic" button
HifiControlsUit.Button {
id: changeSecurityImageButton;
color: hifi.buttons.blue;

View file

@ -34,13 +34,11 @@ Item {
securityImageChangePageSecurityImage.source = "image://security/securityImage";
if (exists) { // Success submitting new security image
if (root.justSubmitted) {
root.resetSubmitButton();
sendSignalToWallet({method: "walletSecurity_changeSecurityImageSuccess"});
root.justSubmitted = false;
}
} else if (root.justSubmitted) {
// Error submitting new security image.
root.resetSubmitButton();
root.justSubmitted = false;
}
}
@ -180,7 +178,8 @@ Item {
// "Submit" button
HifiControlsUit.Button {
id: securityImageSubmitButton;
enabled: securityImageSelection.currentIndex !== -1;
text: root.justSubmitted ? "Submitting..." : "Submit";
enabled: securityImageSelection.currentIndex !== -1 && !root.justSubmitted;
color: hifi.buttons.blue;
colorScheme: hifi.colorSchemes.dark;
anchors.top: parent.top;
@ -188,11 +187,8 @@ Item {
anchors.right: parent.right;
anchors.rightMargin: 20;
width: 150;
text: "Submit";
onClicked: {
root.justSubmitted = true;
securityImageSubmitButton.text = "Submitting...";
securityImageSubmitButton.enabled = false;
var securityImagePath = securityImageSelection.getImagePathFromImageID(securityImageSelection.getSelectedImageIndex())
Commerce.chooseSecurityImage(securityImagePath);
}
@ -205,11 +201,6 @@ Item {
signal sendSignalToWallet(var msg);
function resetSubmitButton() {
securityImageSubmitButton.enabled = true;
securityImageSubmitButton.text = "Submit";
}
function initModel() {
securityImageSelection.initModel();
}

View file

@ -24,7 +24,7 @@ Item {
HifiConstants { id: hifi; }
id: root;
property int currentIndex: securityImageGrid.currentIndex;
property alias currentIndex: securityImageGrid.currentIndex;
// This will cause a bug -- if you bring up security image selection in HUD mode while
// in HMD while having HMD preview enabled, then move, then finish passphrase selection,
@ -98,6 +98,7 @@ Item {
function initModel() {
gridModel.initModel();
securityImageGrid.currentIndex = -1;
}
function resetSelection() {

View file

@ -591,8 +591,8 @@ void Wallet::chooseSecurityImage(const QString& filename) {
if (_securityImage) {
delete _securityImage;
}
QString path = qApp->applicationDirPath();
path.append("/resources/qml/hifi/commerce/wallet/");
QString path = PathUtils::resourcesPath();
path.append("/qml/hifi/commerce/wallet/");
path.append(filename);
// now create a new security image pixmap