From 515ff016a46c079d234705dc107cb21415a5d8a0 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Mon, 5 Nov 2018 13:03:34 -0800 Subject: [PATCH] Fix seven bugs --- .../qml/hifi/commerce/checkout/Checkout.qml | 7 +---- .../qml/hifi/commerce/wallet/Help.qml | 2 +- .../qml/hifi/commerce/wallet/Wallet.qml | 20 ++++++++------ .../qml/hifi/dialogs/security/Security.qml | 2 +- scripts/system/commerce/wallet.js | 8 +++--- scripts/system/marketplaces/marketplaces.js | 27 ++++++++++++++++--- 6 files changed, 42 insertions(+), 24 deletions(-) diff --git a/interface/resources/qml/hifi/commerce/checkout/Checkout.qml b/interface/resources/qml/hifi/commerce/checkout/Checkout.qml index db030d2fee..271aab87d1 100644 --- a/interface/resources/qml/hifi/commerce/checkout/Checkout.qml +++ b/interface/resources/qml/hifi/commerce/checkout/Checkout.qml @@ -240,11 +240,6 @@ Rectangle { lightboxPopup.button1method = function() { lightboxPopup.visible = false; } - lightboxPopup.button2text = "GO TO WALLET"; - lightboxPopup.button2method = function() { - lightboxPopup.visible = false; - sendToScript({method: 'checkout_openWallet'}); - }; lightboxPopup.visible = true; } else { sendToScript(msg); @@ -903,7 +898,7 @@ Rectangle { horizontalAlignment: Text.AlignLeft; verticalAlignment: Text.AlignVCenter; onLinkActivated: { - sendToScript({method: 'checkout_openWallet'}); + sendToScript({method: 'checkout_openRecentActivity'}); } } diff --git a/interface/resources/qml/hifi/commerce/wallet/Help.qml b/interface/resources/qml/hifi/commerce/wallet/Help.qml index 6cf00f78eb..575edfc34d 100644 --- a/interface/resources/qml/hifi/commerce/wallet/Help.qml +++ b/interface/resources/qml/hifi/commerce/wallet/Help.qml @@ -62,7 +62,7 @@ Item { isExpanded: false; question: "How can I get HFC?"; answer: "High Fidelity commerce is in open beta right now. Want more HFC? \ -Get it by going to

BankOfHighFidelity. and meeting with the banker!"; +Get it by going to BankOfHighFidelity and meeting with the banker!"; } ListElement { isExpanded: false; diff --git a/interface/resources/qml/hifi/commerce/wallet/Wallet.qml b/interface/resources/qml/hifi/commerce/wallet/Wallet.qml index 97736bf781..76c2484f0b 100644 --- a/interface/resources/qml/hifi/commerce/wallet/Wallet.qml +++ b/interface/resources/qml/hifi/commerce/wallet/Wallet.qml @@ -29,6 +29,7 @@ Rectangle { id: root; property string activeView: "initialize"; + property string initialActiveViewAfterStatus5: "walletInventory"; property bool keyboardRaised: false; property bool isPassword: false; @@ -66,7 +67,7 @@ Rectangle { } } else if (walletStatus === 5) { if (root.activeView !== "walletSetup") { - root.activeView = "walletInventory"; + root.activeView = root.initialActiveViewAfterStatus5; Commerce.getAvailableUpdates(); Commerce.getSecurityImage(); } @@ -526,7 +527,7 @@ Rectangle { id: exchangeMoneyMessagesWaitingLight; visible: parent.messagesWaiting; anchors.right: exchangeMoneyTabIcon.left; - anchors.rightMargin: -4; + anchors.rightMargin: 9; anchors.top: exchangeMoneyTabIcon.top; anchors.topMargin: 16; height: 10; @@ -682,15 +683,12 @@ Rectangle { function resetTabButtonColors() { walletHomeButtonContainer.color = hifi.colors.black; sendMoneyButtonContainer.color = hifi.colors.black; - securityButtonContainer.color = hifi.colors.black; helpButtonContainer.color = hifi.colors.black; exchangeMoneyButtonContainer.color = hifi.colors.black; if (root.activeView === "walletHome") { walletHomeButtonContainer.color = hifi.colors.blueAccent; } else if (root.activeView === "sendMoney") { sendMoneyButtonContainer.color = hifi.colors.blueAccent; - } else if (root.activeView === "security") { - securityButtonContainer.color = hifi.colors.blueAccent; } else if (root.activeView === "help") { helpButtonContainer.color = hifi.colors.blueAccent; } else if (root.activeView == "walletInventory") { @@ -760,10 +758,12 @@ Rectangle { break; case 'updateConnections': sendMoney.updateConnections(message.connections); + walletInventory.fromScript(message); break; case 'selectRecipient': case 'updateSelectedRecipientUsername': sendMoney.fromScript(message); + walletInventory.fromScript(message); break; case 'http.response': http.handleHttpResponse(message); @@ -779,15 +779,19 @@ Rectangle { break; case 'updatePurchases': case 'purchases_showMyItems': - case 'updateConnections': - case 'selectRecipient': - case 'updateSelectedRecipientUsername': case 'updateWearables': walletInventory.fromScript(message); break; case 'updateRecentActivityMessageLight': walletHomeButtonContainer.messagesWaiting = message.messagesWaiting; break; + case 'checkout_openRecentActivity': + if (root.activeView === "initialize") { + root.initialActiveViewAfterStatus5 = "walletHome"; + } else { + root.activeView = "walletHome"; + } + break; default: console.log('Unrecognized message from wallet.js:', JSON.stringify(message)); } diff --git a/interface/resources/qml/hifi/dialogs/security/Security.qml b/interface/resources/qml/hifi/dialogs/security/Security.qml index 8baff0ac13..96a554838f 100644 --- a/interface/resources/qml/hifi/dialogs/security/Security.qml +++ b/interface/resources/qml/hifi/dialogs/security/Security.qml @@ -328,7 +328,7 @@ Rectangle { HifiStylesUit.RalewayRegular { text: "Your wallet is not set up.\n" + - "Open the WALLET app to get started."; + "Open the ASSETS app to get started."; // Anchors anchors.fill: parent; // Text size diff --git a/scripts/system/commerce/wallet.js b/scripts/system/commerce/wallet.js index 837cf6a78a..033ca638e4 100644 --- a/scripts/system/commerce/wallet.js +++ b/scripts/system/commerce/wallet.js @@ -18,7 +18,7 @@ Script.include("/~/system/libraries/accountUtils.js"); Script.include("/~/system/libraries/connectionUtils.js"); var AppUi = Script.require('appUi'); - var MARKETPLACE_URL = Account.metaverseServerURL + "/marketplace";; +var MARKETPLACE_URL = Account.metaverseServerURL + "/marketplace"; // BEGIN AVATAR SELECTOR LOGIC var UNSELECTED_COLOR = { red: 0x1F, green: 0xC6, blue: 0xA6 }; @@ -607,13 +607,13 @@ function notificationPollCallbackHistory(historyArray) { if (notificationCount > 0) { var message; if (!ui.notificationInitialCallbackMade[1]) { - message = "You have " + notificationCount + " unread wallet " + - "transaction" + (notificationCount === 1 ? "" : "s") + ". Open WALLET to see all activity."; + message = "You have " + notificationCount + " unread recent " + + "transaction" + (notificationCount === 1 ? "" : "s") + ". Open ASSETS to see all activity."; ui.notificationDisplayBanner(message); } else { for (var i = 0; i < notificationCount; i++) { message = '"' + (historyArray[i].message) + '" ' + - "Open WALLET to see all activity."; + "Open ASSETS to see all activity."; ui.notificationDisplayBanner(message); } } diff --git a/scripts/system/marketplaces/marketplaces.js b/scripts/system/marketplaces/marketplaces.js index ed8ed9f288..8bfd776971 100644 --- a/scripts/system/marketplaces/marketplaces.js +++ b/scripts/system/marketplaces/marketplaces.js @@ -527,7 +527,13 @@ var onQmlMessageReceived = function onQmlMessageReceived(message) { Window.location = "hifi://BankOfHighFidelity"; } break; - case 'checkout_openWallet': + case 'checkout_openRecentActivity': + ui.open(MARKETPLACE_WALLET_QML_PATH); + wireQmlEventBridge(true); + ui.tablet.sendToQml({ + method: 'checkout_openRecentActivity' + }); + break; case 'checkout_setUpClicked': openWallet(); break; @@ -589,9 +595,6 @@ var onQmlMessageReceived = function onQmlMessageReceived(message) { break; case 'updateItemClicked': openMarketplace(message.upgradeUrl + "?edition=" + message.itemEdition); - break; - case 'giftAsset': - break; case 'passphrasePopup_cancelClicked': case 'needsLogIn_cancelClicked': @@ -635,6 +638,20 @@ var onQmlMessageReceived = function onQmlMessageReceived(message) { case 'http.request': // Handled elsewhere, don't log. break; + // All of these are handled by wallet.js + case 'purchases_updateWearables': + case 'enable_ChooseRecipientNearbyMode': + case 'disable_ChooseRecipientNearbyMode': + case 'sendAsset_sendPublicly': + case 'refreshConnections': + case 'transactionHistory_goToBank': + case 'purchases_walletNotSetUp': + case 'purchases_openGoTo': + case 'purchases_itemInfoClicked': + case 'purchases_itemCertificateClicked': + case 'clearShouldShowDotHistory': + case 'giftAsset': + break; default: print('Unrecognized message from Checkout.qml: ' + JSON.stringify(message)); } @@ -705,6 +722,8 @@ var onTabletScreenChanged = function onTabletScreenChanged(type, url) { referrerURL: referrerURL, filterText: filterText }); + referrerURL = ""; + filterText = ""; } ui.isOpen = (onMarketplaceScreen || onCommerceScreen) && !onWalletScreen;