mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 16:42:27 +02:00
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:
commit
5ac2e9da15
4 changed files with 7 additions and 15 deletions
|
@ -193,7 +193,7 @@ Item {
|
|||
color: hifi.colors.white;
|
||||
}
|
||||
|
||||
// "Change Passphrase" button
|
||||
// "Change Security Pic" button
|
||||
HifiControlsUit.Button {
|
||||
id: changeSecurityImageButton;
|
||||
color: hifi.buttons.blue;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue