diff --git a/interface/resources/qml/hifi/commerce/wallet/NotSetUp.qml b/interface/resources/qml/hifi/commerce/wallet/NotSetUp.qml index 3efb592ba1..42b8526a8a 100644 --- a/interface/resources/qml/hifi/commerce/wallet/NotSetUp.qml +++ b/interface/resources/qml/hifi/commerce/wallet/NotSetUp.qml @@ -80,7 +80,7 @@ Item { // "Set Up" button HifiControlsUit.Button { - color: hifi.buttons.black; + color: hifi.buttons.blue; colorScheme: hifi.colorSchemes.dark; anchors.bottom: parent.bottom; anchors.bottomMargin: 150; diff --git a/interface/resources/qml/hifi/commerce/wallet/PassphraseSelection.qml b/interface/resources/qml/hifi/commerce/wallet/PassphraseSelection.qml index 89ef851b06..70a627846b 100644 --- a/interface/resources/qml/hifi/commerce/wallet/PassphraseSelection.qml +++ b/interface/resources/qml/hifi/commerce/wallet/PassphraseSelection.qml @@ -48,6 +48,9 @@ Item { onVisibleChanged: { if (visible) { passphraseField.focus = true; + sendMessageToLightbox({method: 'disableHmdPreview'}); + } else { + sendMessageToLightbox({method: 'maybeEnableHmdPreview'}); } } diff --git a/interface/resources/qml/hifi/commerce/wallet/PassphraseSelectionLightbox.qml b/interface/resources/qml/hifi/commerce/wallet/PassphraseSelectionLightbox.qml index 862d1894db..a26bc01533 100644 --- a/interface/resources/qml/hifi/commerce/wallet/PassphraseSelectionLightbox.qml +++ b/interface/resources/qml/hifi/commerce/wallet/PassphraseSelectionLightbox.qml @@ -33,23 +33,6 @@ Rectangle { } } - Connections { - target: passphraseSelection; - onSendMessageToLightbox: { - if (msg.method === 'statusResult') { - if (msg.status) { - // Success submitting new passphrase - root.resetSubmitButton(); - root.visible = false; - } else { - // Error submitting new passphrase - root.resetSubmitButton(); - passphraseSelection.setErrorText("Backend error"); - } - } - } - } - // // SECURE PASSPHRASE SELECTION START // @@ -113,6 +96,24 @@ Rectangle { anchors.left: parent.left; anchors.right: parent.right; anchors.bottom: passphraseNavBar.top; + + Connections { + onSendMessageToLightbox: { + if (msg.method === 'statusResult') { + if (msg.status) { + // Success submitting new passphrase + root.resetSubmitButton(); + root.visible = false; + } else { + // Error submitting new passphrase + root.resetSubmitButton(); + passphraseSelection.setErrorText("Backend error"); + } + } else { + sendSignalToWallet(msg); + } + } + } } // Navigation Bar @@ -168,6 +169,8 @@ Rectangle { // SECURE PASSPHRASE SELECTION END // + signal sendSignalToWallet(var msg); + function resetSubmitButton() { passphraseSubmitButton.enabled = true; passphraseSubmitButton.text = "Submit"; diff --git a/interface/resources/qml/hifi/commerce/wallet/SecurityImageSelection.qml b/interface/resources/qml/hifi/commerce/wallet/SecurityImageSelection.qml index 7ab52b7551..2bf99ba615 100644 --- a/interface/resources/qml/hifi/commerce/wallet/SecurityImageSelection.qml +++ b/interface/resources/qml/hifi/commerce/wallet/SecurityImageSelection.qml @@ -27,13 +27,14 @@ Item { Hifi.QmlCommerce { id: commerce; - onSecurityImageResult: { - } } onVisibleChanged: { if (visible) { commerce.getSecurityImage(); + sendSignalToWallet({method: 'disableHmdPreview'}); + } else { + sendSignalToWallet({method: 'maybeEnableHmdPreview'}); } } @@ -83,7 +84,7 @@ Item { // // FUNCTION DEFINITIONS START // - signal sendToScript(var message); + signal sendSignalToWallet(var msg); function getImagePathFromImageID(imageID) { return (imageID ? gridModel.getImagePathFromImageID(imageID) : ""); diff --git a/interface/resources/qml/hifi/commerce/wallet/SecurityImageSelectionLightbox.qml b/interface/resources/qml/hifi/commerce/wallet/SecurityImageSelectionLightbox.qml index d4b0b82ed3..397c5c7788 100644 --- a/interface/resources/qml/hifi/commerce/wallet/SecurityImageSelectionLightbox.qml +++ b/interface/resources/qml/hifi/commerce/wallet/SecurityImageSelectionLightbox.qml @@ -116,6 +116,12 @@ Rectangle { anchors.right: parent.right; anchors.rightMargin: 16; height: 280; + + Connections { + onSendSignalToWallet: { + sendSignalToWallet(msg); + } + } } // Text below security images @@ -193,6 +199,8 @@ Rectangle { // SECURITY IMAGE SELECTION END // + signal sendSignalToWallet(var msg); + function resetSubmitButton() { securityImageSubmitButton.enabled = true; securityImageSubmitButton.text = "Submit"; diff --git a/interface/resources/qml/hifi/commerce/wallet/Wallet.qml b/interface/resources/qml/hifi/commerce/wallet/Wallet.qml index ae2606c0f6..4fd085fafd 100644 --- a/interface/resources/qml/hifi/commerce/wallet/Wallet.qml +++ b/interface/resources/qml/hifi/commerce/wallet/Wallet.qml @@ -101,6 +101,12 @@ Rectangle { anchors.centerIn: walletSetupLightboxContainer; width: walletSetupLightboxContainer.width - 50; height: walletSetupLightboxContainer.height - 50; + + Connections { + onSendSignalToWallet: { + sendToScript(msg); + } + } } SecurityImageSelectionLightbox { id: securityImageSelectionLightbox; @@ -109,6 +115,12 @@ Rectangle { anchors.centerIn: walletSetupLightboxContainer; width: walletSetupLightboxContainer.width - 50; height: walletSetupLightboxContainer.height - 50; + + Connections { + onSendSignalToWallet: { + sendToScript(msg); + } + } } diff --git a/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml b/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml index 33faacd0ab..51e2187029 100644 --- a/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml +++ b/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml @@ -208,8 +208,7 @@ Item { anchors.topMargin: 8; anchors.left: parent.left; anchors.right: parent.right; - anchors.bottom: homeMessage.visible ? homeMessage.top : root.bottom; - anchors.bottomMargin: 10; + anchors.bottom: parent.bottom; RalewayRegular { id: recentActivityText; @@ -229,8 +228,7 @@ Item { id: transactionHistory; anchors.top: recentActivityText.bottom; anchors.topMargin: 4; - anchors.bottom: toggleFullHistoryButton.top; - anchors.bottomMargin: 8; + anchors.bottom: parent.bottom; anchors.left: parent.left; anchors.right: parent.right; @@ -245,92 +243,6 @@ Item { verticalAlignment: Text.AlignTop; } } - - HifiControlsUit.Button { - id: toggleFullHistoryButton; - color: hifi.buttons.black; - colorScheme: hifi.colorSchemes.dark; - anchors.bottom: parent.bottom; - anchors.right: parent.right; - width: 250; - height: 40; - text: homeMessage.visible ? "See Full Transaction History" : "Collapse Transaction History"; - onClicked: { - if (homeMessage.visible) { - homeMessage.visible = false; - } else { - homeMessage.visible = true; - } - } - } - } - - // Item for "messages" - like "Welcome" - Item { - id: homeMessage; - anchors.bottom: parent.bottom; - anchors.left: parent.left; - anchors.leftMargin: 20; - anchors.right: parent.right; - anchors.rightMargin: 20; - height: childrenRect.height; - - RalewayRegular { - id: messageText; - text: "Welcome! Let's get you some spending money.

" + - "Now that your account is all set up, click the button below to request your starter money. " + - "A robot will promptly review your request and put money into your account."; - // Text size - size: 16; - // Anchors - anchors.top: parent.top; - anchors.left: parent.left; - anchors.right: parent.right; - height: 130; - // Style - color: hifi.colors.faintGray; - wrapMode: Text.WordWrap; - // Alignment - horizontalAlignment: Text.AlignHLeft; - verticalAlignment: Text.AlignVCenter; - } - - Item { - id: homeMessageButtons; - anchors.top: messageText.bottom; - anchors.topMargin: 4; - anchors.left: parent.left; - anchors.right: parent.right; - height: 40; - HifiControlsUit.Button { - id: noThanksButton; - color: hifi.buttons.black; - colorScheme: hifi.colorSchemes.dark; - anchors.top: parent.top; - anchors.bottom: parent.bottom; - anchors.left: parent.left; - width: 100; - text: "No Thanks" - onClicked: { - messageText.text = "Okay...weird. Who doesn't like free money? If you change your mind, too bad. Sorry." - homeMessageButtons.visible = false; - } - } - HifiControlsUit.Button { - id: freeMoneyButton; - color: hifi.buttons.black; - colorScheme: hifi.colorSchemes.dark; - anchors.top: parent.top; - anchors.bottom: parent.bottom; - anchors.right: parent.right; - width: 210; - text: "Free Money Please" - onClicked: { - messageText.text = "Go, MoneyRobots, Go!" - homeMessageButtons.visible = false; - } - } - } } // diff --git a/interface/resources/qml/hifi/commerce/wallet/WalletSetupLightbox.qml b/interface/resources/qml/hifi/commerce/wallet/WalletSetupLightbox.qml index bbeb77f6fa..d2ddb204fb 100644 --- a/interface/resources/qml/hifi/commerce/wallet/WalletSetupLightbox.qml +++ b/interface/resources/qml/hifi/commerce/wallet/WalletSetupLightbox.qml @@ -262,6 +262,12 @@ Rectangle { anchors.right: parent.right; anchors.rightMargin: 16; height: 280; + + Connections { + onSendSignalToWallet: { + sendSignalToWallet(msg); + } + } } // Text below security images @@ -407,6 +413,15 @@ Rectangle { anchors.left: parent.left; anchors.right: parent.right; anchors.bottom: passphraseNavBar.top; + + Connections { + onSendMessageToLightbox: { + if (msg.method === 'statusResult') { + } else { + sendSignalToWallet(msg); + } + } + } } // Navigation Bar diff --git a/scripts/system/commerce/wallet.js b/scripts/system/commerce/wallet.js index 4b758f0add..0f49b5cede 100644 --- a/scripts/system/commerce/wallet.js +++ b/scripts/system/commerce/wallet.js @@ -53,6 +53,7 @@ // Description: // -Called when a message is received from SpectatorCamera.qml. The "message" argument is what is sent from the QML // in the format "{method, params}", like json-rpc. See also sendToQml(). + var isHmdPreviewDisabled = true; function fromQml(message) { switch (message.method) { case 'walletSetup_cancelClicked': @@ -67,6 +68,13 @@ tablet.loadQMLOnTop("../../../dialogs/TabletLoginDialog.qml"); } break; + case 'disableHmdPreview': + isHmdPreviewDisabled = Menu.isOptionChecked("Disable Preview"); + Menu.setIsOptionChecked("Disable Preview", true); + break; + case 'maybeEnableHmdPreview': + Menu.setIsOptionChecked("Disable Preview", isHmdPreviewDisabled); + break; default: print('Unrecognized message from QML:', JSON.stringify(message)); } diff --git a/scripts/system/html/js/marketplacesInject.js b/scripts/system/html/js/marketplacesInject.js index 9c5439ec2f..2675bb97b6 100644 --- a/scripts/system/html/js/marketplacesInject.js +++ b/scripts/system/html/js/marketplacesInject.js @@ -179,7 +179,7 @@ var cost = $('.item-cost').text(); if (parseInt(cost) > 0 && $('#side-info').find('#buyItemButton').size() === 0) { - $('#side-info').find('.btn').html('Buy Item: ' + (parseFloat(cost / 100).toFixed(2)) + ' HFC'); + $('#side-info').find('.btn').html('Own Item: ' + (parseFloat(cost / 100).toFixed(2)) + ' HFC'); } $('#side-info').find('.btn').on('click', function () {