mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 16:58:09 +02:00
Fix MacOS Security Pic visibility; fix incorrect button state when changing pic
This commit is contained in:
parent
6f54921cb1
commit
94e1c425ab
4 changed files with 7 additions and 15 deletions
|
@ -193,7 +193,7 @@ Item {
|
||||||
color: hifi.colors.white;
|
color: hifi.colors.white;
|
||||||
}
|
}
|
||||||
|
|
||||||
// "Change Passphrase" button
|
// "Change Security Pic" button
|
||||||
HifiControlsUit.Button {
|
HifiControlsUit.Button {
|
||||||
id: changeSecurityImageButton;
|
id: changeSecurityImageButton;
|
||||||
color: hifi.buttons.blue;
|
color: hifi.buttons.blue;
|
||||||
|
|
|
@ -34,13 +34,11 @@ Item {
|
||||||
securityImageChangePageSecurityImage.source = "image://security/securityImage";
|
securityImageChangePageSecurityImage.source = "image://security/securityImage";
|
||||||
if (exists) { // Success submitting new security image
|
if (exists) { // Success submitting new security image
|
||||||
if (root.justSubmitted) {
|
if (root.justSubmitted) {
|
||||||
root.resetSubmitButton();
|
|
||||||
sendSignalToWallet({method: "walletSecurity_changeSecurityImageSuccess"});
|
sendSignalToWallet({method: "walletSecurity_changeSecurityImageSuccess"});
|
||||||
root.justSubmitted = false;
|
root.justSubmitted = false;
|
||||||
}
|
}
|
||||||
} else if (root.justSubmitted) {
|
} else if (root.justSubmitted) {
|
||||||
// Error submitting new security image.
|
// Error submitting new security image.
|
||||||
root.resetSubmitButton();
|
|
||||||
root.justSubmitted = false;
|
root.justSubmitted = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -180,7 +178,8 @@ Item {
|
||||||
// "Submit" button
|
// "Submit" button
|
||||||
HifiControlsUit.Button {
|
HifiControlsUit.Button {
|
||||||
id: securityImageSubmitButton;
|
id: securityImageSubmitButton;
|
||||||
enabled: securityImageSelection.currentIndex !== -1;
|
text: root.justSubmitted ? "Submitting..." : "Submit";
|
||||||
|
enabled: securityImageSelection.currentIndex !== -1 && !root.justSubmitted;
|
||||||
color: hifi.buttons.blue;
|
color: hifi.buttons.blue;
|
||||||
colorScheme: hifi.colorSchemes.dark;
|
colorScheme: hifi.colorSchemes.dark;
|
||||||
anchors.top: parent.top;
|
anchors.top: parent.top;
|
||||||
|
@ -188,11 +187,8 @@ Item {
|
||||||
anchors.right: parent.right;
|
anchors.right: parent.right;
|
||||||
anchors.rightMargin: 20;
|
anchors.rightMargin: 20;
|
||||||
width: 150;
|
width: 150;
|
||||||
text: "Submit";
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
root.justSubmitted = true;
|
root.justSubmitted = true;
|
||||||
securityImageSubmitButton.text = "Submitting...";
|
|
||||||
securityImageSubmitButton.enabled = false;
|
|
||||||
var securityImagePath = securityImageSelection.getImagePathFromImageID(securityImageSelection.getSelectedImageIndex())
|
var securityImagePath = securityImageSelection.getImagePathFromImageID(securityImageSelection.getSelectedImageIndex())
|
||||||
Commerce.chooseSecurityImage(securityImagePath);
|
Commerce.chooseSecurityImage(securityImagePath);
|
||||||
}
|
}
|
||||||
|
@ -205,11 +201,6 @@ Item {
|
||||||
|
|
||||||
signal sendSignalToWallet(var msg);
|
signal sendSignalToWallet(var msg);
|
||||||
|
|
||||||
function resetSubmitButton() {
|
|
||||||
securityImageSubmitButton.enabled = true;
|
|
||||||
securityImageSubmitButton.text = "Submit";
|
|
||||||
}
|
|
||||||
|
|
||||||
function initModel() {
|
function initModel() {
|
||||||
securityImageSelection.initModel();
|
securityImageSelection.initModel();
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ Item {
|
||||||
HifiConstants { id: hifi; }
|
HifiConstants { id: hifi; }
|
||||||
|
|
||||||
id: root;
|
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
|
// 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,
|
// in HMD while having HMD preview enabled, then move, then finish passphrase selection,
|
||||||
|
@ -98,6 +98,7 @@ Item {
|
||||||
|
|
||||||
function initModel() {
|
function initModel() {
|
||||||
gridModel.initModel();
|
gridModel.initModel();
|
||||||
|
securityImageGrid.currentIndex = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetSelection() {
|
function resetSelection() {
|
||||||
|
|
|
@ -591,8 +591,8 @@ void Wallet::chooseSecurityImage(const QString& filename) {
|
||||||
if (_securityImage) {
|
if (_securityImage) {
|
||||||
delete _securityImage;
|
delete _securityImage;
|
||||||
}
|
}
|
||||||
QString path = qApp->applicationDirPath();
|
QString path = PathUtils::resourcesPath();
|
||||||
path.append("/resources/qml/hifi/commerce/wallet/");
|
path.append("/qml/hifi/commerce/wallet/");
|
||||||
path.append(filename);
|
path.append(filename);
|
||||||
|
|
||||||
// now create a new security image pixmap
|
// now create a new security image pixmap
|
||||||
|
|
Loading…
Reference in a new issue