First steps

This commit is contained in:
Zach Fox 2017-10-25 14:07:02 -07:00
parent 0c9184566e
commit dafa830c0d
19 changed files with 110 additions and 85 deletions

View file

@ -43,8 +43,8 @@ Rectangle {
property bool isWearable; property bool isWearable;
// Style // Style
color: hifi.colors.white; color: hifi.colors.white;
Hifi.QmlCommerce { Connections {
id: commerce; target: Commerce;
onWalletStatusResult: { onWalletStatusResult: {
if (walletStatus === 0) { if (walletStatus === 0) {
@ -71,7 +71,7 @@ Rectangle {
if (!isLoggedIn && root.activeView !== "needsLogIn") { if (!isLoggedIn && root.activeView !== "needsLogIn") {
root.activeView = "needsLogIn"; root.activeView = "needsLogIn";
} else { } else {
commerce.getWalletStatus(); Commerce.getWalletStatus();
} }
} }
@ -112,7 +112,7 @@ Rectangle {
} }
onItemIdChanged: { onItemIdChanged: {
commerce.inventory(); Commerce.inventory();
itemPreviewImage.source = "https://hifi-metaverse.s3-us-west-1.amazonaws.com/marketplace/previews/" + itemId + "/thumbnail/hifi-mp-" + itemId + ".jpg"; itemPreviewImage.source = "https://hifi-metaverse.s3-us-west-1.amazonaws.com/marketplace/previews/" + itemId + "/thumbnail/hifi-mp-" + itemId + ".jpg";
} }
@ -121,7 +121,7 @@ Rectangle {
} }
onItemPriceChanged: { onItemPriceChanged: {
commerce.balance(); Commerce.balance();
} }
Timer { Timer {
@ -200,7 +200,7 @@ Rectangle {
Component.onCompleted: { Component.onCompleted: {
purchasesReceived = false; purchasesReceived = false;
balanceReceived = false; balanceReceived = false;
commerce.getWalletStatus(); Commerce.getWalletStatus();
} }
} }
@ -221,7 +221,7 @@ Rectangle {
Connections { Connections {
target: GlobalServices target: GlobalServices
onMyUsernameChanged: { onMyUsernameChanged: {
commerce.getLoginStatus(); Commerce.getLoginStatus();
} }
} }
@ -471,9 +471,9 @@ Rectangle {
if (itemIsJson) { if (itemIsJson) {
buyButton.enabled = false; buyButton.enabled = false;
if (!root.shouldBuyWithControlledFailure) { if (!root.shouldBuyWithControlledFailure) {
commerce.buy(itemId, itemPrice); Commerce.buy(itemId, itemPrice);
} else { } else {
commerce.buy(itemId, itemPrice, true); Commerce.buy(itemId, itemPrice, true);
} }
} else { } else {
if (urlHandler.canHandleUrl(itemHref)) { if (urlHandler.canHandleUrl(itemHref)) {
@ -938,8 +938,8 @@ Rectangle {
} }
root.balanceReceived = false; root.balanceReceived = false;
root.purchasesReceived = false; root.purchasesReceived = false;
commerce.inventory(); Commerce.inventory();
commerce.balance(); Commerce.balance();
} }
// //

View file

@ -31,14 +31,14 @@ Item {
height: mainContainer.height + additionalDropdownHeight; height: mainContainer.height + additionalDropdownHeight;
Hifi.QmlCommerce { Connections {
id: commerce; target: Commerce;
onWalletStatusResult: { onWalletStatusResult: {
if (walletStatus === 0) { if (walletStatus === 0) {
sendToParent({method: "needsLogIn"}); sendToParent({method: "needsLogIn"});
} else if (walletStatus === 3) { } else if (walletStatus === 3) {
commerce.getSecurityImage(); Commerce.getSecurityImage();
} else if (walletStatus > 3) { } else if (walletStatus > 3) {
console.log("ERROR in EmulatedMarketplaceHeader.qml: Unknown wallet status: " + walletStatus); console.log("ERROR in EmulatedMarketplaceHeader.qml: Unknown wallet status: " + walletStatus);
} }
@ -48,7 +48,7 @@ Item {
if (!isLoggedIn) { if (!isLoggedIn) {
sendToParent({method: "needsLogIn"}); sendToParent({method: "needsLogIn"});
} else { } else {
commerce.getWalletStatus(); Commerce.getWalletStatus();
} }
} }
@ -61,13 +61,13 @@ Item {
} }
Component.onCompleted: { Component.onCompleted: {
commerce.getWalletStatus(); Commerce.getWalletStatus();
} }
Connections { Connections {
target: GlobalServices target: GlobalServices
onMyUsernameChanged: { onMyUsernameChanged: {
commerce.getLoginStatus(); Commerce.getLoginStatus();
} }
} }

View file

@ -35,8 +35,8 @@ Rectangle {
property bool isMyCert: false; property bool isMyCert: false;
// Style // Style
color: hifi.colors.faintGray; color: hifi.colors.faintGray;
Hifi.QmlCommerce { Connections {
id: commerce; target: Commerce;
onCertificateInfoResult: { onCertificateInfoResult: {
if (result.status !== 'success') { if (result.status !== 'success') {
@ -69,7 +69,7 @@ Rectangle {
onCertificateIdChanged: { onCertificateIdChanged: {
if (certificateId !== "") { if (certificateId !== "") {
commerce.certificateInfo(certificateId); Commerce.certificateInfo(certificateId);
} }
} }

View file

@ -38,8 +38,8 @@ Rectangle {
property bool isDebuggingFirstUseTutorial: false; property bool isDebuggingFirstUseTutorial: false;
// Style // Style
color: hifi.colors.white; color: hifi.colors.white;
Hifi.QmlCommerce { Connections {
id: commerce; target: Commerce;
onWalletStatusResult: { onWalletStatusResult: {
if (walletStatus === 0) { if (walletStatus === 0) {
@ -60,7 +60,7 @@ Rectangle {
root.activeView = "firstUseTutorial"; root.activeView = "firstUseTutorial";
} else if (!Settings.getValue("isFirstUseOfPurchases", true) && root.activeView === "initialize") { } else if (!Settings.getValue("isFirstUseOfPurchases", true) && root.activeView === "initialize") {
root.activeView = "purchasesMain"; root.activeView = "purchasesMain";
commerce.inventory(); Commerce.inventory();
} }
} else { } else {
console.log("ERROR in Purchases.qml: Unknown wallet status: " + walletStatus); console.log("ERROR in Purchases.qml: Unknown wallet status: " + walletStatus);
@ -71,7 +71,7 @@ Rectangle {
if (!isLoggedIn && root.activeView !== "needsLogIn") { if (!isLoggedIn && root.activeView !== "needsLogIn") {
root.activeView = "needsLogIn"; root.activeView = "needsLogIn";
} else { } else {
commerce.getWalletStatus(); Commerce.getWalletStatus();
} }
} }
@ -197,7 +197,7 @@ Rectangle {
Component.onCompleted: { Component.onCompleted: {
securityImageResultReceived = false; securityImageResultReceived = false;
purchasesReceived = false; purchasesReceived = false;
commerce.getWalletStatus(); Commerce.getWalletStatus();
} }
} }
@ -218,7 +218,7 @@ Rectangle {
Connections { Connections {
target: GlobalServices target: GlobalServices
onMyUsernameChanged: { onMyUsernameChanged: {
commerce.getLoginStatus(); Commerce.getLoginStatus();
} }
} }
@ -233,7 +233,7 @@ Rectangle {
onSendSignalToParent: { onSendSignalToParent: {
if (msg.method === "authSuccess") { if (msg.method === "authSuccess") {
root.activeView = "initialize"; root.activeView = "initialize";
commerce.getWalletStatus(); Commerce.getWalletStatus();
} else { } else {
sendToScript(msg); sendToScript(msg);
} }
@ -254,7 +254,7 @@ Rectangle {
case 'tutorial_finished': case 'tutorial_finished':
Settings.setValue("isFirstUseOfPurchases", false); Settings.setValue("isFirstUseOfPurchases", false);
root.activeView = "purchasesMain"; root.activeView = "purchasesMain";
commerce.inventory(); Commerce.inventory();
break; break;
} }
} }
@ -589,7 +589,7 @@ Rectangle {
if (root.activeView === "purchasesMain" && !root.pendingInventoryReply) { if (root.activeView === "purchasesMain" && !root.pendingInventoryReply) {
console.log("Refreshing Purchases..."); console.log("Refreshing Purchases...");
root.pendingInventoryReply = true; root.pendingInventoryReply = true;
commerce.inventory(); Commerce.inventory();
} }
} }
} }

View file

@ -27,8 +27,8 @@ Item {
property string keyFilePath; property string keyFilePath;
property bool showDebugButtons: true; property bool showDebugButtons: true;
Hifi.QmlCommerce { Connections {
id: commerce; target: Commerce;
onKeyFilePathIfExistsResult: { onKeyFilePathIfExistsResult: {
root.keyFilePath = path; root.keyFilePath = path;
@ -37,7 +37,7 @@ Item {
onVisibleChanged: { onVisibleChanged: {
if (visible) { if (visible) {
commerce.getKeyFilePathIfExists(); Commerce.getKeyFilePathIfExists();
} }
} }
@ -67,7 +67,7 @@ Item {
width: 150; width: 150;
text: "DBG: Clear Pass"; text: "DBG: Clear Pass";
onClicked: { onClicked: {
commerce.setPassphrase(""); Commerce.setPassphrase("");
sendSignalToWallet({method: 'passphraseReset'}); sendSignalToWallet({method: 'passphraseReset'});
} }
} }
@ -82,7 +82,7 @@ Item {
width: 150; width: 150;
text: "DBG: RST Wallet"; text: "DBG: RST Wallet";
onClicked: { onClicked: {
commerce.reset(); Commerce.reset();
sendSignalToWallet({method: 'walletReset'}); sendSignalToWallet({method: 'walletReset'});
} }
} }

View file

@ -30,8 +30,8 @@ Item {
source: "images/wallet-bg.jpg"; source: "images/wallet-bg.jpg";
} }
Hifi.QmlCommerce { Connections {
id: commerce; target: Commerce;
} }
// //

View file

@ -36,8 +36,8 @@ Item {
source: "images/wallet-bg.jpg"; source: "images/wallet-bg.jpg";
} }
Hifi.QmlCommerce { Connections {
id: commerce; target: Commerce;
onSecurityImageResult: { onSecurityImageResult: {
titleBarSecurityImage.source = ""; titleBarSecurityImage.source = "";
@ -218,7 +218,7 @@ Item {
onAccepted: { onAccepted: {
submitPassphraseInputButton.enabled = false; submitPassphraseInputButton.enabled = false;
commerce.setPassphrase(passphraseField.text); Commerce.setPassphrase(passphraseField.text);
} }
} }
@ -258,7 +258,7 @@ Item {
source: "image://security/securityImage"; source: "image://security/securityImage";
cache: false; cache: false;
onVisibleChanged: { onVisibleChanged: {
commerce.getSecurityImage(); Commerce.getSecurityImage();
} }
} }
Item { Item {
@ -326,7 +326,7 @@ Item {
text: "Submit" text: "Submit"
onClicked: { onClicked: {
submitPassphraseInputButton.enabled = false; submitPassphraseInputButton.enabled = false;
commerce.setPassphrase(passphraseField.text); Commerce.setPassphrase(passphraseField.text);
} }
} }

View file

@ -36,8 +36,8 @@ Item {
propagateComposedEvents: false; propagateComposedEvents: false;
} }
Hifi.QmlCommerce { Connections {
id: commerce; target: Commerce;
onSecurityImageResult: { onSecurityImageResult: {
passphrasePageSecurityImage.source = ""; passphrasePageSecurityImage.source = "";
passphrasePageSecurityImage.source = "image://security/securityImage"; passphrasePageSecurityImage.source = "image://security/securityImage";
@ -193,7 +193,7 @@ Item {
source: "image://security/securityImage"; source: "image://security/securityImage";
cache: false; cache: false;
onVisibleChanged: { onVisibleChanged: {
commerce.getSecurityImage(); Commerce.getSecurityImage();
} }
} }
Item { Item {
@ -316,7 +316,7 @@ Item {
passphraseFieldAgain.error = false; passphraseFieldAgain.error = false;
currentPassphraseField.error = false; currentPassphraseField.error = false;
setErrorText(""); setErrorText("");
commerce.changePassphrase(currentPassphraseField.text, passphraseField.text); Commerce.changePassphrase(currentPassphraseField.text, passphraseField.text);
return true; return true;
} }
} }

View file

@ -27,8 +27,8 @@ Item {
id: root; id: root;
property string keyFilePath; property string keyFilePath;
Hifi.QmlCommerce { Connections {
id: commerce; target: Commerce;
onKeyFilePathIfExistsResult: { onKeyFilePathIfExistsResult: {
root.keyFilePath = path; root.keyFilePath = path;
@ -234,7 +234,7 @@ Item {
onVisibleChanged: { onVisibleChanged: {
if (visible) { if (visible) {
commerce.getKeyFilePathIfExists(); Commerce.getKeyFilePathIfExists();
} }
} }

View file

@ -30,8 +30,8 @@ Item {
id: securityImageModel; id: securityImageModel;
} }
Hifi.QmlCommerce { Connections {
id: commerce; target: Commerce;
onSecurityImageResult: { onSecurityImageResult: {
securityImageChangePageSecurityImage.source = ""; securityImageChangePageSecurityImage.source = "";
@ -70,7 +70,7 @@ Item {
source: "image://security/securityImage"; source: "image://security/securityImage";
cache: false; cache: false;
onVisibleChanged: { onVisibleChanged: {
commerce.getSecurityImage(); Commerce.getSecurityImage();
} }
} }
Item { Item {
@ -198,7 +198,7 @@ Item {
securityImageSubmitButton.text = "Submitting..."; securityImageSubmitButton.text = "Submitting...";
securityImageSubmitButton.enabled = false; securityImageSubmitButton.enabled = false;
var securityImagePath = securityImageSelection.getImagePathFromImageID(securityImageSelection.getSelectedImageIndex()) var securityImagePath = securityImageSelection.getImagePathFromImageID(securityImageSelection.getSelectedImageIndex())
commerce.chooseSecurityImage(securityImagePath); Commerce.chooseSecurityImage(securityImagePath);
} }
} }
} }

View file

@ -25,8 +25,8 @@ Item {
id: root; id: root;
Hifi.QmlCommerce { Connections {
id: commerce; target: Commerce;
} }
// "Unavailable" // "Unavailable"

View file

@ -36,8 +36,8 @@ Rectangle {
source: "images/wallet-bg.jpg"; source: "images/wallet-bg.jpg";
} }
Hifi.QmlCommerce { Connections {
id: commerce; target: Commerce;
onWalletStatusResult: { onWalletStatusResult: {
if (walletStatus === 0) { if (walletStatus === 0) {
@ -54,7 +54,7 @@ Rectangle {
} }
} else if (walletStatus === 3) { } else if (walletStatus === 3) {
root.activeView = "walletHome"; root.activeView = "walletHome";
commerce.getSecurityImage(); Commerce.getSecurityImage();
} else { } else {
console.log("ERROR in Wallet.qml: Unknown wallet status: " + walletStatus); console.log("ERROR in Wallet.qml: Unknown wallet status: " + walletStatus);
} }
@ -64,7 +64,7 @@ Rectangle {
if (!isLoggedIn && root.activeView !== "needsLogIn") { if (!isLoggedIn && root.activeView !== "needsLogIn") {
root.activeView = "needsLogIn"; root.activeView = "needsLogIn";
} else if (isLoggedIn) { } else if (isLoggedIn) {
commerce.getWalletStatus(); Commerce.getWalletStatus();
} }
} }
@ -174,7 +174,7 @@ Rectangle {
if (msg.method === 'walletSetup_finished') { if (msg.method === 'walletSetup_finished') {
if (msg.referrer === '') { if (msg.referrer === '') {
root.activeView = "initialize"; root.activeView = "initialize";
commerce.getWalletStatus(); Commerce.getWalletStatus();
} else if (msg.referrer === 'purchases') { } else if (msg.referrer === 'purchases') {
sendToScript({method: 'goToPurchases'}); sendToScript({method: 'goToPurchases'});
} else { } else {
@ -254,7 +254,7 @@ Rectangle {
color: hifi.colors.baseGray; color: hifi.colors.baseGray;
Component.onCompleted: { Component.onCompleted: {
commerce.getWalletStatus(); Commerce.getWalletStatus();
} }
} }
@ -275,7 +275,7 @@ Rectangle {
Connections { Connections {
target: GlobalServices target: GlobalServices
onMyUsernameChanged: { onMyUsernameChanged: {
commerce.getLoginStatus(); Commerce.getLoginStatus();
} }
} }
@ -289,7 +289,7 @@ Rectangle {
Connections { Connections {
onSendSignalToParent: { onSendSignalToParent: {
if (msg.method === "authSuccess") { if (msg.method === "authSuccess") {
commerce.getWalletStatus(); Commerce.getWalletStatus();
} else { } else {
sendToScript(msg); sendToScript(msg);
} }

View file

@ -28,8 +28,8 @@ Item {
property bool historyReceived: false; property bool historyReceived: false;
property int pendingCount: 0; property int pendingCount: 0;
Hifi.QmlCommerce { Connections {
id: commerce; target: Commerce;
onBalanceResult : { onBalanceResult : {
balanceText.text = result.data.balance; balanceText.text = result.data.balance;
@ -116,8 +116,8 @@ Item {
onVisibleChanged: { onVisibleChanged: {
if (visible) { if (visible) {
historyReceived = false; historyReceived = false;
commerce.balance(); Commerce.balance();
commerce.history(); Commerce.history();
} else { } else {
refreshTimer.stop(); refreshTimer.stop();
} }
@ -147,8 +147,8 @@ Item {
onTriggered: { onTriggered: {
console.log("Refreshing Wallet Home..."); console.log("Refreshing Wallet Home...");
historyReceived = false; historyReceived = false;
commerce.balance(); Commerce.balance();
commerce.history(); Commerce.history();
} }
} }

View file

@ -37,8 +37,8 @@ Item {
source: "images/wallet-bg.jpg"; source: "images/wallet-bg.jpg";
} }
Hifi.QmlCommerce { Connections {
id: commerce; target: Commerce;
onSecurityImageResult: { onSecurityImageResult: {
if (!exists && root.lastPage === "step_2") { if (!exists && root.lastPage === "step_2") {
@ -356,7 +356,7 @@ Item {
onClicked: { onClicked: {
root.lastPage = "step_2"; root.lastPage = "step_2";
var securityImagePath = securityImageSelection.getImagePathFromImageID(securityImageSelection.getSelectedImageIndex()) var securityImagePath = securityImageSelection.getImagePathFromImageID(securityImageSelection.getSelectedImageIndex())
commerce.chooseSecurityImage(securityImagePath); Commerce.chooseSecurityImage(securityImagePath);
root.activeView = "step_3"; root.activeView = "step_3";
passphraseSelection.clearPassphraseFields(); passphraseSelection.clearPassphraseFields();
} }
@ -440,7 +440,7 @@ Item {
onVisibleChanged: { onVisibleChanged: {
if (visible) { if (visible) {
commerce.getWalletAuthenticatedStatus(); Commerce.getWalletAuthenticatedStatus();
if (!root.hasShownSecurityImageTip) { if (!root.hasShownSecurityImageTip) {
securityImageTip.visible = true; securityImageTip.visible = true;
} }
@ -529,7 +529,7 @@ Item {
onClicked: { onClicked: {
if (passphraseSelection.validateAndSubmitPassphrase()) { if (passphraseSelection.validateAndSubmitPassphrase()) {
root.lastPage = "step_3"; root.lastPage = "step_3";
commerce.generateKeyPair(); Commerce.generateKeyPair();
root.activeView = "step_4"; root.activeView = "step_4";
} }
} }
@ -662,7 +662,7 @@ Item {
onVisibleChanged: { onVisibleChanged: {
if (visible) { if (visible) {
commerce.getKeyFilePathIfExists(); Commerce.getKeyFilePathIfExists();
} }
} }
} }

View file

@ -2246,7 +2246,32 @@ void Application::initializeUi() {
LoginDialog::registerType(); LoginDialog::registerType();
Tooltip::registerType(); Tooltip::registerType();
UpdateDialog::registerType(); UpdateDialog::registerType();
QmlCommerce::registerType(); QmlContextCallback callback = [](QQmlContext* context, QObject*) {
context->setContextProperty("Commerce", new QmlCommerce());
};
OffscreenQmlSurface::addWhitelistContextHandler({
QUrl{ "qrc://qml/hifi/commerce/checkout/Checkout.qml" },
QUrl{ "qrc://qml/hifi/commerce/common/CommerceLightbox.qml" },
QUrl{ "qrc://qml/hifi/commerce/common/EmulatedMarketplaceHeader.qml" },
QUrl{ "qrc://qml/hifi/commerce/common/FirstUseTutorial.qml" },
QUrl{ "qrc://qml/hifi/commerce/common/SortableListModel.qml" },
QUrl{ "qrc://qml/hifi/commerce/inspectionCertificate/InspectionCertificate.qml" },
QUrl{ "qrc://qml/hifi/commerce/purchases/PurchasedItem.qml" },
QUrl{ "qrc://qml/hifi/commerce/purchases/Purchases.qml" },
QUrl{ "qrc://qml/hifi/commerce/wallet/Help.qml" },
QUrl{ "qrc://qml/hifi/commerce/wallet/NeedsLogIn.qml" },
QUrl{ "qrc://qml/hifi/commerce/wallet/PassphraseChange.qml" },
QUrl{ "qrc://qml/hifi/commerce/wallet/PassphraseModal.qml" },
QUrl{ "qrc://qml/hifi/commerce/wallet/PassphraseSelection.qml" },
QUrl{ "qrc://qml/hifi/commerce/wallet/Security.qml" },
QUrl{ "qrc://qml/hifi/commerce/wallet/SecurityImageChange.qml" },
QUrl{ "qrc://qml/hifi/commerce/wallet/SecurityImageModel.qml" },
QUrl{ "qrc://qml/hifi/commerce/wallet/SecurityImageSelection.qml" },
QUrl{ "qrc://qml/hifi/commerce/wallet/SendMoney.qml" },
QUrl{ "qrc://qml/hifi/commerce/wallet/Wallet.qml" },
QUrl{ "qrc://qml/hifi/commerce/wallet/WalletHome.qml" },
QUrl{ "qrc://qml/hifi/commerce/wallet/WalletSetup.qml" },
}, callback);
qmlRegisterType<ResourceImageItem>("Hifi", 1, 0, "ResourceImageItem"); qmlRegisterType<ResourceImageItem>("Hifi", 1, 0, "ResourceImageItem");
qmlRegisterType<Preference>("Hifi", 1, 0, "Preference"); qmlRegisterType<Preference>("Hifi", 1, 0, "Preference");

View file

@ -16,9 +16,7 @@
#include "Wallet.h" #include "Wallet.h"
#include <AccountManager.h> #include <AccountManager.h>
HIFI_QML_DEF(QmlCommerce) QmlCommerce::QmlCommerce() {
QmlCommerce::QmlCommerce(QQuickItem* parent) : OffscreenQmlDialog(parent) {
auto ledger = DependencyManager::get<Ledger>(); auto ledger = DependencyManager::get<Ledger>();
auto wallet = DependencyManager::get<Wallet>(); auto wallet = DependencyManager::get<Wallet>();
connect(ledger.data(), &Ledger::buyResult, this, &QmlCommerce::buyResult); connect(ledger.data(), &Ledger::buyResult, this, &QmlCommerce::buyResult);

View file

@ -16,16 +16,14 @@
#define hifi_QmlCommerce_h #define hifi_QmlCommerce_h
#include <QJsonObject> #include <QJsonObject>
#include <OffscreenQmlDialog.h>
#include <QPixmap> #include <QPixmap>
class QmlCommerce : public OffscreenQmlDialog { class QmlCommerce : public QObject {
Q_OBJECT Q_OBJECT
HIFI_QML_DECL
public: public:
QmlCommerce(QQuickItem* parent = nullptr); QmlCommerce();
signals: signals:
void walletStatusResult(uint walletStatus); void walletStatusResult(uint walletStatus);

View file

@ -62,7 +62,7 @@ QVariantMap QmlWindowClass::parseArguments(QScriptContext* context) {
QUrl url { properties[SOURCE_PROPERTY].toString() }; QUrl url { properties[SOURCE_PROPERTY].toString() };
if (url.scheme() != "http" && url.scheme() != "https" && url.scheme() != "file" && url.scheme() != "about" && if (url.scheme() != "http" && url.scheme() != "https" && url.scheme() != "file" && url.scheme() != "about" &&
url.scheme() != "atp") { url.scheme() != "atp" && url.scheme() != "qrc") {
properties[SOURCE_PROPERTY] = QUrl::fromLocalFile(url.toString()).toString(); properties[SOURCE_PROPERTY] = QUrl::fromLocalFile(url.toString()).toString();
} }

View file

@ -26,7 +26,7 @@
// Relevant Variables: // Relevant Variables:
// -WALLET_QML_SOURCE: The path to the Wallet QML // -WALLET_QML_SOURCE: The path to the Wallet QML
// -onWalletScreen: true/false depending on whether we're looking at the app. // -onWalletScreen: true/false depending on whether we're looking at the app.
var WALLET_QML_SOURCE = Script.resourcesPath() + "qml/hifi/commerce/wallet/Wallet.qml"; var WALLET_QML_SOURCE = "qrc:///qml/hifi/commerce/wallet/Wallet.qml";
var MARKETPLACE_PURCHASES_QML_PATH = Script.resourcesPath() + "qml/hifi/commerce/purchases/Purchases.qml"; var MARKETPLACE_PURCHASES_QML_PATH = Script.resourcesPath() + "qml/hifi/commerce/purchases/Purchases.qml";
var onWalletScreen = false; var onWalletScreen = false;
function onButtonClicked() { function onButtonClicked() {
@ -38,7 +38,11 @@
// for toolbar-mode: go back to home screen, this will close the window. // for toolbar-mode: go back to home screen, this will close the window.
tablet.gotoHomeScreen(); tablet.gotoHomeScreen();
} else { } else {
tablet.loadQMLSource(WALLET_QML_SOURCE); var window = new OverlayWindow({
title: "Wallet",
source: WALLET_QML_SOURCE,
width: 480, height: 706
});
} }
} }