mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 13:44:32 +02:00
QmlMarketplace Bugfixes
* Fix upgrades * Certificate 'View in Marketplace' wasn't working * command-line hifiapp:MARKET wasn't launching * Home link wasn't disappearing where it should * Log In button on marketplace wasn't working * Other minor UI bugfixes
This commit is contained in:
parent
a4d105f24f
commit
0fdbca8ade
10 changed files with 66 additions and 291 deletions
|
@ -662,7 +662,7 @@ Rectangle {
|
||||||
anchors.right: parent.right;
|
anchors.right: parent.right;
|
||||||
text: "Cancel"
|
text: "Cancel"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
sendToScript({method: 'checkout_cancelClicked', params: itemId});
|
sendToScript({method: 'checkout_cancelClicked', itemId: itemId});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,11 +24,8 @@ Item {
|
||||||
HifiConstants { id: hifi; }
|
HifiConstants { id: hifi; }
|
||||||
|
|
||||||
id: root;
|
id: root;
|
||||||
property string referrerURL: (Account.metaverseServerURL + "/marketplace?");
|
|
||||||
readonly property int additionalDropdownHeight: usernameDropdown.height - myUsernameButton.anchors.bottomMargin;
|
|
||||||
property alias usernameDropdownVisible: usernameDropdown.visible;
|
|
||||||
|
|
||||||
height: mainContainer.height + additionalDropdownHeight;
|
height: mainContainer.height;
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: Commerce;
|
target: Commerce;
|
||||||
|
@ -93,77 +90,7 @@ Item {
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent;
|
anchors.fill: parent;
|
||||||
onClicked: {
|
onClicked: {
|
||||||
sendToParent({method: "header_marketplaceImageClicked", referrerURL: root.referrerURL});
|
sendToParent({method: "header_marketplaceImageClicked"});
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: buttonAndUsernameContainer;
|
|
||||||
anchors.left: marketplaceHeaderImage.right;
|
|
||||||
anchors.leftMargin: 8;
|
|
||||||
anchors.top: parent.top;
|
|
||||||
anchors.bottom: parent.bottom;
|
|
||||||
anchors.bottomMargin: 10;
|
|
||||||
anchors.right: securityImage.left;
|
|
||||||
anchors.rightMargin: 6;
|
|
||||||
|
|
||||||
TextMetrics {
|
|
||||||
id: textMetrics;
|
|
||||||
font.family: "Raleway"
|
|
||||||
text: usernameText.text;
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: myUsernameButton;
|
|
||||||
anchors.right: parent.right;
|
|
||||||
anchors.verticalCenter: parent.verticalCenter;
|
|
||||||
height: 40;
|
|
||||||
width: usernameText.width + 25;
|
|
||||||
color: "white";
|
|
||||||
radius: 4;
|
|
||||||
border.width: 1;
|
|
||||||
border.color: hifi.colors.lightGray;
|
|
||||||
|
|
||||||
// Username Text
|
|
||||||
RalewayRegular {
|
|
||||||
id: usernameText;
|
|
||||||
text: Account.username;
|
|
||||||
// Text size
|
|
||||||
size: 18;
|
|
||||||
// Style
|
|
||||||
color: hifi.colors.baseGray;
|
|
||||||
elide: Text.ElideRight;
|
|
||||||
horizontalAlignment: Text.AlignHCenter;
|
|
||||||
verticalAlignment: Text.AlignVCenter;
|
|
||||||
width: Math.min(textMetrics.width + 25, 110);
|
|
||||||
// Anchors
|
|
||||||
anchors.centerIn: parent;
|
|
||||||
rightPadding: 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
HiFiGlyphs {
|
|
||||||
id: dropdownIcon;
|
|
||||||
text: hifi.glyphs.caratDn;
|
|
||||||
// Size
|
|
||||||
size: 50;
|
|
||||||
// Anchors
|
|
||||||
anchors.right: parent.right;
|
|
||||||
anchors.rightMargin: -14;
|
|
||||||
anchors.verticalCenter: parent.verticalCenter;
|
|
||||||
horizontalAlignment: Text.AlignHCenter;
|
|
||||||
// Style
|
|
||||||
color: hifi.colors.baseGray;
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent;
|
|
||||||
hoverEnabled: enabled;
|
|
||||||
onClicked: {
|
|
||||||
usernameDropdown.visible = !usernameDropdown.visible;
|
|
||||||
}
|
|
||||||
onEntered: usernameText.color = hifi.colors.baseGrayShadow;
|
|
||||||
onExited: usernameText.color = hifi.colors.baseGray;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -205,92 +132,6 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
|
||||||
id: usernameDropdown;
|
|
||||||
z: 998;
|
|
||||||
visible: false;
|
|
||||||
anchors.top: buttonAndUsernameContainer.bottom;
|
|
||||||
anchors.topMargin: -buttonAndUsernameContainer.anchors.bottomMargin;
|
|
||||||
anchors.right: buttonAndUsernameContainer.right;
|
|
||||||
height: childrenRect.height;
|
|
||||||
width: 150;
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: myItemsButton;
|
|
||||||
color: hifi.colors.white;
|
|
||||||
anchors.top: parent.top;
|
|
||||||
anchors.left: parent.left;
|
|
||||||
anchors.right: parent.right;
|
|
||||||
height: 50;
|
|
||||||
|
|
||||||
RalewaySemiBold {
|
|
||||||
anchors.fill: parent;
|
|
||||||
text: "My Submissions"
|
|
||||||
color: hifi.colors.baseGray;
|
|
||||||
horizontalAlignment: Text.AlignHCenter;
|
|
||||||
verticalAlignment: Text.AlignVCenter;
|
|
||||||
size: 18;
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent;
|
|
||||||
hoverEnabled: true;
|
|
||||||
onEntered: {
|
|
||||||
myItemsButton.color = hifi.colors.blueHighlight;
|
|
||||||
}
|
|
||||||
onExited: {
|
|
||||||
myItemsButton.color = hifi.colors.white;
|
|
||||||
}
|
|
||||||
onClicked: {
|
|
||||||
sendToParent({method: "header_myItemsClicked"});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: logOutButton;
|
|
||||||
color: hifi.colors.white;
|
|
||||||
anchors.top: myItemsButton.bottom;
|
|
||||||
anchors.left: parent.left;
|
|
||||||
anchors.right: parent.right;
|
|
||||||
height: 50;
|
|
||||||
|
|
||||||
RalewaySemiBold {
|
|
||||||
anchors.fill: parent;
|
|
||||||
text: "Log Out"
|
|
||||||
color: hifi.colors.baseGray;
|
|
||||||
horizontalAlignment: Text.AlignHCenter;
|
|
||||||
verticalAlignment: Text.AlignVCenter;
|
|
||||||
size: 18;
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent;
|
|
||||||
hoverEnabled: true;
|
|
||||||
onEntered: {
|
|
||||||
logOutButton.color = hifi.colors.blueHighlight;
|
|
||||||
}
|
|
||||||
onExited: {
|
|
||||||
logOutButton.color = hifi.colors.white;
|
|
||||||
}
|
|
||||||
onClicked: {
|
|
||||||
Account.logOut();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DropShadow {
|
|
||||||
z: 997;
|
|
||||||
visible: usernameDropdown.visible;
|
|
||||||
anchors.fill: usernameDropdown;
|
|
||||||
horizontalOffset: 3;
|
|
||||||
verticalOffset: 3;
|
|
||||||
radius: 8.0;
|
|
||||||
samples: 17;
|
|
||||||
color: "#80000000";
|
|
||||||
source: usernameDropdown;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@ Rectangle {
|
||||||
HifiConstants { id: hifi; }
|
HifiConstants { id: hifi; }
|
||||||
|
|
||||||
id: root;
|
id: root;
|
||||||
property string marketplaceUrl: "";
|
|
||||||
property string entityId: "";
|
property string entityId: "";
|
||||||
property string certificateId: "";
|
property string certificateId: "";
|
||||||
property string itemName: "--";
|
property string itemName: "--";
|
||||||
|
@ -30,6 +29,7 @@ Rectangle {
|
||||||
property string itemEdition: "--";
|
property string itemEdition: "--";
|
||||||
property string dateAcquired: "--";
|
property string dateAcquired: "--";
|
||||||
property string itemCost: "--";
|
property string itemCost: "--";
|
||||||
|
property string marketplace_item_id: "";
|
||||||
property string certTitleTextColor: hifi.colors.darkGray;
|
property string certTitleTextColor: hifi.colors.darkGray;
|
||||||
property string certTextColor: hifi.colors.white;
|
property string certTextColor: hifi.colors.white;
|
||||||
property string infoTextColor: hifi.colors.blueAccent;
|
property string infoTextColor: hifi.colors.blueAccent;
|
||||||
|
@ -69,7 +69,7 @@ Rectangle {
|
||||||
errorText.text = "Information about this certificate is currently unavailable. Please try again later.";
|
errorText.text = "Information about this certificate is currently unavailable. Please try again later.";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
root.marketplaceUrl = result.data.marketplace_item_url;
|
root.marketplace_item_id = result.data.marketplace_item_id;
|
||||||
root.isMyCert = result.isMyCert ? result.isMyCert : false;
|
root.isMyCert = result.isMyCert ? result.isMyCert : false;
|
||||||
|
|
||||||
if (root.certInfoReplaceMode > 3) {
|
if (root.certInfoReplaceMode > 3) {
|
||||||
|
@ -352,7 +352,7 @@ Rectangle {
|
||||||
anchors.fill: parent;
|
anchors.fill: parent;
|
||||||
hoverEnabled: enabled;
|
hoverEnabled: enabled;
|
||||||
onClicked: {
|
onClicked: {
|
||||||
sendToScript({method: 'inspectionCertificate_showInMarketplaceClicked', marketplaceUrl: root.marketplaceUrl});
|
sendToScript({method: 'inspectionCertificate_showInMarketplaceClicked', itemId: root.marketplace_item_id});
|
||||||
}
|
}
|
||||||
onEntered: itemName.color = hifi.colors.blueHighlight;
|
onEntered: itemName.color = hifi.colors.blueHighlight;
|
||||||
onExited: itemName.color = root.certTextColor;
|
onExited: itemName.color = root.certTextColor;
|
||||||
|
@ -391,7 +391,7 @@ Rectangle {
|
||||||
// "Show In Marketplace" button
|
// "Show In Marketplace" button
|
||||||
HifiControlsUit.Button {
|
HifiControlsUit.Button {
|
||||||
id: showInMarketplaceButton;
|
id: showInMarketplaceButton;
|
||||||
enabled: root.marketplaceUrl;
|
enabled: root.marketplace_item_id && marketplace_item_id !== "";
|
||||||
color: hifi.buttons.blue;
|
color: hifi.buttons.blue;
|
||||||
colorScheme: hifi.colorSchemes.light;
|
colorScheme: hifi.colorSchemes.light;
|
||||||
anchors.bottom: parent.bottom;
|
anchors.bottom: parent.bottom;
|
||||||
|
@ -401,7 +401,7 @@ Rectangle {
|
||||||
height: 40;
|
height: 40;
|
||||||
text: "View In Market"
|
text: "View In Market"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
sendToScript({method: 'inspectionCertificate_showInMarketplaceClicked', marketplaceUrl: root.marketplaceUrl});
|
sendToScript({method: 'inspectionCertificate_showInMarketplaceClicked', itemId: root.marketplace_item_id});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -620,7 +620,7 @@ Rectangle {
|
||||||
root.itemOwner = "--";
|
root.itemOwner = "--";
|
||||||
root.itemEdition = "--";
|
root.itemEdition = "--";
|
||||||
root.dateAcquired = "--";
|
root.dateAcquired = "--";
|
||||||
root.marketplaceUrl = "";
|
root.marketplace_item_id = "";
|
||||||
root.itemCost = "--";
|
root.itemCost = "--";
|
||||||
root.isMyCert = false;
|
root.isMyCert = false;
|
||||||
errorText.text = "";
|
errorText.text = "";
|
||||||
|
|
|
@ -131,7 +131,6 @@ Rectangle {
|
||||||
|
|
||||||
onLoginStatusResult: {
|
onLoginStatusResult: {
|
||||||
root.isLoggedIn = isLoggedIn;
|
root.isLoggedIn = isLoggedIn;
|
||||||
itemsLoginStatus.visible = !isLoggedIn;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,38 +178,27 @@ Rectangle {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 50
|
height: 60
|
||||||
visible: true
|
visible: true
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: marketplaceIcon
|
id: marketplaceHeaderImage;
|
||||||
|
source: "../common/images/marketplaceHeaderImage.png";
|
||||||
|
anchors.top: parent.top;
|
||||||
|
anchors.topMargin: 2;
|
||||||
|
anchors.bottom: parent.bottom;
|
||||||
|
anchors.bottomMargin: 0;
|
||||||
|
anchors.left: parent.left;
|
||||||
|
anchors.leftMargin: 8;
|
||||||
|
width: 140;
|
||||||
|
fillMode: Image.PreserveAspectFit;
|
||||||
|
|
||||||
anchors {
|
MouseArea {
|
||||||
left: parent.left
|
anchors.fill: parent;
|
||||||
leftMargin: 8
|
onClicked: {
|
||||||
verticalCenter: parent.verticalCenter
|
sendToParent({method: "header_marketplaceImageClicked"});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
height: 20
|
|
||||||
width: marketplaceIcon.height
|
|
||||||
source: "../../../../images/hifi-logo-blackish.svg"
|
|
||||||
visible: true
|
|
||||||
}
|
|
||||||
|
|
||||||
RalewaySemiBold {
|
|
||||||
id: titleBarText
|
|
||||||
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
left: marketplaceIcon.right
|
|
||||||
bottom: parent.bottom
|
|
||||||
leftMargin: 6
|
|
||||||
}
|
|
||||||
width: paintedWidth
|
|
||||||
|
|
||||||
text: "Marketplace"
|
|
||||||
size: hifi.fontSizes.overlayTitle
|
|
||||||
color: hifi.colors.black
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -403,7 +391,7 @@ Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.rightMargin: 10
|
anchors.rightMargin: 10
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
currentIndex: -1;
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
model: categoriesModel
|
model: categoriesModel
|
||||||
|
@ -587,7 +575,7 @@ Rectangle {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
leftMargin: 15
|
leftMargin: 15
|
||||||
rightMargin: 15
|
top: parent.top+15
|
||||||
}
|
}
|
||||||
height: root.isLoggedIn ? 0 : 80
|
height: root.isLoggedIn ? 0 : 80
|
||||||
|
|
||||||
|
@ -944,7 +932,7 @@ Rectangle {
|
||||||
isLoggedIn: root.isLoggedIn;
|
isLoggedIn: root.isLoggedIn;
|
||||||
|
|
||||||
onBuy: {
|
onBuy: {
|
||||||
sendToScript({method: 'marketplace_checkout', itemId: item_id});
|
sendToScript({method: 'marketplace_checkout', itemId: item_id, itemEdition: edition});
|
||||||
}
|
}
|
||||||
|
|
||||||
onShowLicense: {
|
onShowLicense: {
|
||||||
|
@ -1142,7 +1130,7 @@ Rectangle {
|
||||||
console.log("A message with method 'updateMarketplaceQMLItem' was sent without an itemId!");
|
console.log("A message with method 'updateMarketplaceQMLItem' was sent without an itemId!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
marketplaceItem.edition = message.params.edition ? message.params.edition : -1;
|
||||||
MarketplaceScriptingInterface.getMarketplaceItem(message.params.itemId);
|
MarketplaceScriptingInterface.getMarketplaceItem(message.params.itemId);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,7 @@ Rectangle {
|
||||||
property bool available: false
|
property bool available: false
|
||||||
property string created_at: ""
|
property string created_at: ""
|
||||||
property bool isLoggedIn: false;
|
property bool isLoggedIn: false;
|
||||||
|
property int edition: -1;
|
||||||
|
|
||||||
onCategoriesChanged: {
|
onCategoriesChanged: {
|
||||||
categoriesListModel.clear();
|
categoriesListModel.clear();
|
||||||
|
@ -228,8 +229,8 @@ Rectangle {
|
||||||
}
|
}
|
||||||
height: 50
|
height: 50
|
||||||
|
|
||||||
text: root.available ? (root.price ? root.price : "FREE") : "UNAVAILABLE (not for sale)"
|
text: root.edition >= 0 ? "UPGRADE FOR FREE" : (root.available ? (root.price ? root.price : "FREE") : "UNAVAILABLE (not for sale)")
|
||||||
enabled: root.available
|
enabled: root.edition >= 0 || root.available
|
||||||
buttonGlyph: root.available ? (root.price ? hifi.glyphs.hfc : "") : ""
|
buttonGlyph: root.available ? (root.price ? hifi.glyphs.hfc : "") : ""
|
||||||
color: hifi.buttons.blue
|
color: hifi.buttons.blue
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@ Item {
|
||||||
property string purchaseStatus;
|
property string purchaseStatus;
|
||||||
property string itemName;
|
property string itemName;
|
||||||
property string itemId;
|
property string itemId;
|
||||||
|
property string updateItemId;
|
||||||
property string itemPreviewImageUrl;
|
property string itemPreviewImageUrl;
|
||||||
property string itemHref;
|
property string itemHref;
|
||||||
property string certificateId;
|
property string certificateId;
|
||||||
|
@ -45,9 +46,9 @@ Item {
|
||||||
property bool cardBackVisible;
|
property bool cardBackVisible;
|
||||||
property bool isInstalled;
|
property bool isInstalled;
|
||||||
property string wornEntityID;
|
property string wornEntityID;
|
||||||
property string upgradeUrl;
|
property string updatedItemId;
|
||||||
property string upgradeTitle;
|
property string upgradeTitle;
|
||||||
property bool updateAvailable: root.upgradeUrl !== "";
|
property bool updateAvailable: root.updateItemId && root.updateItemId !== "";
|
||||||
property bool valid;
|
property bool valid;
|
||||||
|
|
||||||
property string originalStatusText;
|
property string originalStatusText;
|
||||||
|
@ -175,7 +176,7 @@ Item {
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
property alias buttonGlyphText: buttonGlyph.text;
|
property alias buttonGlyphText: buttonGlyph.text;
|
||||||
property alias buttonText: buttonText.text;
|
property alias itemButtonText: buttonText.text;
|
||||||
property alias glyphSize: buttonGlyph.size;
|
property alias glyphSize: buttonGlyph.size;
|
||||||
property string buttonColor: hifi.colors.black;
|
property string buttonColor: hifi.colors.black;
|
||||||
property string buttonColor_hover: hifi.colors.blueHighlight;
|
property string buttonColor_hover: hifi.colors.blueHighlight;
|
||||||
|
@ -243,7 +244,7 @@ Item {
|
||||||
onLoaded: {
|
onLoaded: {
|
||||||
item.enabled = root.valid;
|
item.enabled = root.valid;
|
||||||
item.buttonGlyphText = hifi.glyphs.gift;
|
item.buttonGlyphText = hifi.glyphs.gift;
|
||||||
item.buttonText = "Gift";
|
item.itemButtonText = "Gift";
|
||||||
item.buttonClicked = function() {
|
item.buttonClicked = function() {
|
||||||
sendToPurchases({ method: 'flipCard', closeAll: true });
|
sendToPurchases({ method: 'flipCard', closeAll: true });
|
||||||
sendToPurchases({
|
sendToPurchases({
|
||||||
|
@ -270,7 +271,7 @@ Item {
|
||||||
|
|
||||||
onLoaded: {
|
onLoaded: {
|
||||||
item.buttonGlyphText = hifi.glyphs.market;
|
item.buttonGlyphText = hifi.glyphs.market;
|
||||||
item.buttonText = "View in Marketplace";
|
item.itemButtonText = "View in Marketplace";
|
||||||
item.buttonClicked = function() {
|
item.buttonClicked = function() {
|
||||||
sendToPurchases({ method: 'flipCard', closeAll: true });
|
sendToPurchases({ method: 'flipCard', closeAll: true });
|
||||||
sendToPurchases({method: 'purchases_itemInfoClicked', itemId: root.itemId});
|
sendToPurchases({method: 'purchases_itemInfoClicked', itemId: root.itemId});
|
||||||
|
@ -288,7 +289,7 @@ Item {
|
||||||
|
|
||||||
onLoaded: {
|
onLoaded: {
|
||||||
item.buttonGlyphText = hifi.glyphs.certificate;
|
item.buttonGlyphText = hifi.glyphs.certificate;
|
||||||
item.buttonText = "View Certificate";
|
item.itemButtonText = "View Certificate";
|
||||||
item.buttonClicked = function() {
|
item.buttonClicked = function() {
|
||||||
sendToPurchases({ method: 'flipCard', closeAll: true });
|
sendToPurchases({ method: 'flipCard', closeAll: true });
|
||||||
sendToPurchases({method: 'purchases_itemCertificateClicked', itemCertificateId: root.certificateId});
|
sendToPurchases({method: 'purchases_itemCertificateClicked', itemCertificateId: root.certificateId});
|
||||||
|
@ -307,7 +308,7 @@ Item {
|
||||||
|
|
||||||
onLoaded: {
|
onLoaded: {
|
||||||
item.buttonGlyphText = hifi.glyphs.uninstall;
|
item.buttonGlyphText = hifi.glyphs.uninstall;
|
||||||
item.buttonText = "Uninstall";
|
item.itemButtonText = "Uninstall";
|
||||||
item.buttonClicked = function() {
|
item.buttonClicked = function() {
|
||||||
sendToPurchases({ method: 'flipCard', closeAll: true });
|
sendToPurchases({ method: 'flipCard', closeAll: true });
|
||||||
Commerce.uninstallApp(root.itemHref);
|
Commerce.uninstallApp(root.itemHref);
|
||||||
|
@ -330,15 +331,14 @@ Item {
|
||||||
|
|
||||||
onLoaded: {
|
onLoaded: {
|
||||||
item.buttonGlyphText = hifi.glyphs.update;
|
item.buttonGlyphText = hifi.glyphs.update;
|
||||||
item.buttonText = "Update";
|
item.itemButtonText = "Update";
|
||||||
item.buttonColor = "#E2334D";
|
item.buttonColor = "#E2334D";
|
||||||
item.buttonClicked = function() {
|
item.buttonClicked = function() {
|
||||||
sendToPurchases({ method: 'flipCard', closeAll: true });
|
sendToPurchases({ method: 'flipCard', closeAll: true });
|
||||||
sendToPurchases({
|
sendToPurchases({
|
||||||
method: 'updateItemClicked',
|
method: 'updateItemClicked',
|
||||||
itemId: root.itemId,
|
itemId: root.updateAvailable ? root.updateItemId : root.itemId,
|
||||||
itemEdition: root.itemEdition,
|
itemEdition: root.itemEdition,
|
||||||
upgradeUrl: root.upgradeUrl,
|
|
||||||
itemHref: root.itemHref,
|
itemHref: root.itemHref,
|
||||||
itemType: root.itemType,
|
itemType: root.itemType,
|
||||||
isInstalled: root.isInstalled,
|
isInstalled: root.isInstalled,
|
||||||
|
@ -378,10 +378,10 @@ Item {
|
||||||
|
|
||||||
function updateProperties() {
|
function updateProperties() {
|
||||||
if (updateButton.visible && uninstallButton.visible) {
|
if (updateButton.visible && uninstallButton.visible) {
|
||||||
item.buttonText = "";
|
item.itemButtonText = "";
|
||||||
item.glyphSize = 20;
|
item.glyphSize = 20;
|
||||||
} else {
|
} else {
|
||||||
item.buttonText = "Send to Trash";
|
item.itemButtonText = "Send to Trash";
|
||||||
item.glyphSize = 30;
|
item.glyphSize = 30;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,6 @@ Rectangle {
|
||||||
|
|
||||||
id: root;
|
id: root;
|
||||||
property string activeView: "initialize";
|
property string activeView: "initialize";
|
||||||
property string referrerURL: "";
|
|
||||||
property bool securityImageResultReceived: false;
|
property bool securityImageResultReceived: false;
|
||||||
property bool purchasesReceived: false;
|
property bool purchasesReceived: false;
|
||||||
property bool punctuationMode: false;
|
property bool punctuationMode: false;
|
||||||
|
@ -154,55 +153,10 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// TITLE BAR START
|
|
||||||
//
|
|
||||||
HifiCommerceCommon.EmulatedMarketplaceHeader {
|
|
||||||
id: titleBarContainer;
|
|
||||||
z: 997;
|
|
||||||
visible: false;
|
|
||||||
height: 100;
|
|
||||||
// Size
|
|
||||||
width: parent.width;
|
|
||||||
// Anchors
|
|
||||||
anchors.left: parent.left;
|
|
||||||
anchors.top: parent.top;
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
onSendToParent: {
|
|
||||||
if (msg.method === 'needsLogIn' && root.activeView !== "needsLogIn") {
|
|
||||||
root.activeView = "needsLogIn";
|
|
||||||
} else if (msg.method === 'showSecurityPicLightbox') {
|
|
||||||
lightboxPopup.titleText = "Your Security Pic";
|
|
||||||
lightboxPopup.bodyImageSource = msg.securityImageSource;
|
|
||||||
lightboxPopup.bodyText = lightboxPopup.securityPicBodyText;
|
|
||||||
lightboxPopup.button1text = "CLOSE";
|
|
||||||
lightboxPopup.button1method = function() {
|
|
||||||
lightboxPopup.visible = false;
|
|
||||||
}
|
|
||||||
lightboxPopup.visible = true;
|
|
||||||
} else {
|
|
||||||
sendToScript(msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MouseArea {
|
|
||||||
enabled: titleBarContainer.usernameDropdownVisible;
|
|
||||||
anchors.fill: parent;
|
|
||||||
onClicked: {
|
|
||||||
titleBarContainer.usernameDropdownVisible = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// TITLE BAR END
|
|
||||||
//
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: initialize;
|
id: initialize;
|
||||||
visible: root.activeView === "initialize";
|
visible: root.activeView === "initialize";
|
||||||
anchors.top: titleBarContainer.bottom;
|
anchors.top: parent.top;
|
||||||
anchors.topMargin: -titleBarContainer.additionalDropdownHeight;
|
|
||||||
anchors.bottom: parent.bottom;
|
anchors.bottom: parent.bottom;
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
anchors.right: parent.right;
|
anchors.right: parent.right;
|
||||||
|
@ -219,8 +173,7 @@ Rectangle {
|
||||||
id: installedAppsContainer;
|
id: installedAppsContainer;
|
||||||
z: 998;
|
z: 998;
|
||||||
visible: false;
|
visible: false;
|
||||||
anchors.top: titleBarContainer.bottom;
|
anchors.top: parent.top;
|
||||||
anchors.topMargin: -titleBarContainer.additionalDropdownHeight;
|
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
anchors.bottom: parent.bottom;
|
anchors.bottom: parent.bottom;
|
||||||
width: parent.width;
|
width: parent.width;
|
||||||
|
@ -422,8 +375,8 @@ Rectangle {
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
anchors.right: parent.right;
|
anchors.right: parent.right;
|
||||||
anchors.top: titleBarContainer.bottom;
|
anchors.top: parent.top;
|
||||||
anchors.topMargin: 8 - titleBarContainer.additionalDropdownHeight;
|
anchors.topMargin: 8;
|
||||||
anchors.bottom: parent.bottom;
|
anchors.bottom: parent.bottom;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -585,6 +538,7 @@ Rectangle {
|
||||||
delegate: PurchasedItem {
|
delegate: PurchasedItem {
|
||||||
itemName: title;
|
itemName: title;
|
||||||
itemId: id;
|
itemId: id;
|
||||||
|
updateItemId: model.upgrade_id ? model.upgrade_id : "";
|
||||||
itemPreviewImageUrl: preview;
|
itemPreviewImageUrl: preview;
|
||||||
itemHref: download_url;
|
itemHref: download_url;
|
||||||
certificateId: certificate_id;
|
certificateId: certificate_id;
|
||||||
|
@ -596,7 +550,6 @@ Rectangle {
|
||||||
cardBackVisible: model.cardBackVisible || false;
|
cardBackVisible: model.cardBackVisible || false;
|
||||||
isInstalled: model.isInstalled || false;
|
isInstalled: model.isInstalled || false;
|
||||||
wornEntityID: model.wornEntityID;
|
wornEntityID: model.wornEntityID;
|
||||||
upgradeUrl: model.upgrade_url;
|
|
||||||
upgradeTitle: model.upgrade_title;
|
upgradeTitle: model.upgrade_title;
|
||||||
itemType: model.item_type;
|
itemType: model.item_type;
|
||||||
valid: model.valid;
|
valid: model.valid;
|
||||||
|
@ -1083,8 +1036,6 @@ Rectangle {
|
||||||
function fromScript(message) {
|
function fromScript(message) {
|
||||||
switch (message.method) {
|
switch (message.method) {
|
||||||
case 'updatePurchases':
|
case 'updatePurchases':
|
||||||
referrerURL = message.referrerURL || "";
|
|
||||||
titleBarContainer.referrerURL = message.referrerURL || "";
|
|
||||||
filterBar.text = message.filterText ? message.filterText : "";
|
filterBar.text = message.filterText ? message.filterText : "";
|
||||||
break;
|
break;
|
||||||
case 'purchases_showMyItems':
|
case 'purchases_showMyItems':
|
||||||
|
|
|
@ -335,7 +335,7 @@ Item {
|
||||||
if (link.indexOf("users/") !== -1) {
|
if (link.indexOf("users/") !== -1) {
|
||||||
sendSignalToWallet({method: 'transactionHistory_usernameLinkClicked', usernameLink: link});
|
sendSignalToWallet({method: 'transactionHistory_usernameLinkClicked', usernameLink: link});
|
||||||
} else {
|
} else {
|
||||||
sendSignalToWallet({method: 'transactionHistory_linkClicked', marketplaceLink: link});
|
sendSignalToWallet({method: 'transactionHistory_linkClicked', itemId: model.marketplace_item});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -420,10 +420,10 @@ function fromQml(message) {
|
||||||
case 'purchases':
|
case 'purchases':
|
||||||
case 'marketplace cta':
|
case 'marketplace cta':
|
||||||
case 'mainPage':
|
case 'mainPage':
|
||||||
ui.open(MARKETPLACE_URL, MARKETPLACES_INJECT_SCRIPT_URL);
|
openMarketplace();
|
||||||
break;
|
break;
|
||||||
default: // User needs to return to an individual marketplace item URL
|
default:
|
||||||
ui.open(MARKETPLACE_URL + '/items/' + message.referrer, MARKETPLACES_INJECT_SCRIPT_URL);
|
openMarketplace();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -435,13 +435,13 @@ function fromQml(message) {
|
||||||
case 'maybeEnableHmdPreview':
|
case 'maybeEnableHmdPreview':
|
||||||
break; // do nothing here, handled in marketplaces.js
|
break; // do nothing here, handled in marketplaces.js
|
||||||
case 'transactionHistory_linkClicked':
|
case 'transactionHistory_linkClicked':
|
||||||
ui.open(message.marketplaceLink, MARKETPLACES_INJECT_SCRIPT_URL);
|
openMarketplace(message.itemId);
|
||||||
break;
|
break;
|
||||||
case 'goToMarketplaceMainPage':
|
case 'goToMarketplaceMainPage':
|
||||||
ui.open(MARKETPLACE_URL, MARKETPLACES_INJECT_SCRIPT_URL);
|
openMarketplace();
|
||||||
break;
|
break;
|
||||||
case 'goToMarketplaceItemPage':
|
case 'goToMarketplaceItemPage':
|
||||||
ui.open(MARKETPLACE_URL + '/items/' + message.itemId, MARKETPLACES_INJECT_SCRIPT_URL);
|
openMarketplace(message.itemId);
|
||||||
break;
|
break;
|
||||||
case 'refreshConnections':
|
case 'refreshConnections':
|
||||||
print('Refreshing Connections...');
|
print('Refreshing Connections...');
|
||||||
|
|
|
@ -19,6 +19,7 @@ var selectionDisplay = null; // for gridTool.js to ignore
|
||||||
var AppUi = Script.require('appUi');
|
var AppUi = Script.require('appUi');
|
||||||
Script.include("/~/system/libraries/gridTool.js");
|
Script.include("/~/system/libraries/gridTool.js");
|
||||||
Script.include("/~/system/libraries/connectionUtils.js");
|
Script.include("/~/system/libraries/connectionUtils.js");
|
||||||
|
Script.include("/~/system/libraries/accountUtils.js");
|
||||||
|
|
||||||
var MARKETPLACE_CHECKOUT_QML_PATH = "hifi/commerce/checkout/Checkout.qml";
|
var MARKETPLACE_CHECKOUT_QML_PATH = "hifi/commerce/checkout/Checkout.qml";
|
||||||
var MARKETPLACE_INSPECTIONCERTIFICATE_QML_PATH = "hifi/commerce/inspectionCertificate/InspectionCertificate.qml";
|
var MARKETPLACE_INSPECTIONCERTIFICATE_QML_PATH = "hifi/commerce/inspectionCertificate/InspectionCertificate.qml";
|
||||||
|
@ -156,13 +157,12 @@ function onMarketplaceOpen(referrer) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function openMarketplace(optionalItem) {
|
function openMarketplace(optionalItem, edition) {
|
||||||
ui.open(MARKETPLACE_QML_PATH);
|
ui.open(MARKETPLACE_QML_PATH);
|
||||||
|
|
||||||
if (optionalItem) {
|
if (optionalItem) {
|
||||||
ui.tablet.sendToQml({
|
ui.tablet.sendToQml({
|
||||||
method: 'updateMarketplaceQMLItem',
|
method: 'updateMarketplaceQMLItem',
|
||||||
params: { itemId: optionalItem }
|
params: { itemId: optionalItem, edition: edition }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -486,7 +486,6 @@ function onWebEventReceived(message) {
|
||||||
} else if (message.type === "WALLET_SETUP") {
|
} else if (message.type === "WALLET_SETUP") {
|
||||||
setupWallet('marketplace cta');
|
setupWallet('marketplace cta');
|
||||||
} else if (message.type === "MY_ITEMS") {
|
} else if (message.type === "MY_ITEMS") {
|
||||||
referrerURL = MARKETPLACE_URL_INITIAL;
|
|
||||||
filterText = "";
|
filterText = "";
|
||||||
ui.open(MARKETPLACE_PURCHASES_QML_PATH);
|
ui.open(MARKETPLACE_PURCHASES_QML_PATH);
|
||||||
wireQmlEventBridge(true);
|
wireQmlEventBridge(true);
|
||||||
|
@ -519,7 +518,6 @@ var onQmlMessageReceived = function onQmlMessageReceived(message) {
|
||||||
if (message.messageSrc === "HTML") {
|
if (message.messageSrc === "HTML") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(JSON.stringify(message));
|
|
||||||
switch (message.method) {
|
switch (message.method) {
|
||||||
case 'gotoBank':
|
case 'gotoBank':
|
||||||
ui.close();
|
ui.close();
|
||||||
|
@ -548,11 +546,10 @@ var onQmlMessageReceived = function onQmlMessageReceived(message) {
|
||||||
openWallet();
|
openWallet();
|
||||||
break;
|
break;
|
||||||
case 'checkout_cancelClicked':
|
case 'checkout_cancelClicked':
|
||||||
openMarketplace(message.params);
|
openMarketplace(message.itemId);
|
||||||
break;
|
break;
|
||||||
case 'header_goToPurchases':
|
case 'header_goToPurchases':
|
||||||
case 'checkout_goToPurchases':
|
case 'checkout_goToPurchases':
|
||||||
referrerURL = MARKETPLACE_URL_INITIAL;
|
|
||||||
filterText = message.filterText;
|
filterText = message.filterText;
|
||||||
ui.open(MARKETPLACE_PURCHASES_QML_PATH);
|
ui.open(MARKETPLACE_PURCHASES_QML_PATH);
|
||||||
break;
|
break;
|
||||||
|
@ -602,13 +599,13 @@ var onQmlMessageReceived = function onQmlMessageReceived(message) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'header_marketplaceImageClicked':
|
case 'header_marketplaceImageClicked':
|
||||||
openMarketplace(message.referrerURL);
|
openMarketplace();
|
||||||
break;
|
break;
|
||||||
case 'purchases_goToMarketplaceClicked':
|
case 'purchases_goToMarketplaceClicked':
|
||||||
openMarketplace();
|
openMarketplace();
|
||||||
break;
|
break;
|
||||||
case 'updateItemClicked':
|
case 'updateItemClicked':
|
||||||
openMarketplace(message.upgradeUrl + "?edition=" + message.itemEdition);
|
openMarketplace(message.itemId, message.itemEdition);
|
||||||
break;
|
break;
|
||||||
case 'passphrasePopup_cancelClicked':
|
case 'passphrasePopup_cancelClicked':
|
||||||
case 'needsLogIn_cancelClicked':
|
case 'needsLogIn_cancelClicked':
|
||||||
|
@ -638,10 +635,10 @@ var onQmlMessageReceived = function onQmlMessageReceived(message) {
|
||||||
ContextOverlay.requestOwnershipVerification(message.entity);
|
ContextOverlay.requestOwnershipVerification(message.entity);
|
||||||
break;
|
break;
|
||||||
case 'inspectionCertificate_showInMarketplaceClicked':
|
case 'inspectionCertificate_showInMarketplaceClicked':
|
||||||
openMarketplace(message.marketplaceUrl);
|
console.log("INSPECTION CERTIFICATE SHOW IN MARKETPLACE CLICKED: " + message.itemId);
|
||||||
|
openMarketplace(message.itemId);
|
||||||
break;
|
break;
|
||||||
case 'header_myItemsClicked':
|
case 'header_myItemsClicked':
|
||||||
referrerURL = MARKETPLACE_URL_INITIAL;
|
|
||||||
filterText = "";
|
filterText = "";
|
||||||
ui.open(MARKETPLACE_PURCHASES_QML_PATH);
|
ui.open(MARKETPLACE_PURCHASES_QML_PATH);
|
||||||
wireQmlEventBridge(true);
|
wireQmlEventBridge(true);
|
||||||
|
@ -750,11 +747,8 @@ var onTabletScreenChanged = function onTabletScreenChanged(type, url) {
|
||||||
Keyboard.raised = false;
|
Keyboard.raised = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === "Web" && url.indexOf(MARKETPLACE_URL) !== -1) {
|
ContextOverlay.isInMarketplaceInspectionMode = false;
|
||||||
ContextOverlay.isInMarketplaceInspectionMode = true;
|
|
||||||
} else {
|
|
||||||
ContextOverlay.isInMarketplaceInspectionMode = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (onInspectionCertificateScreen) {
|
if (onInspectionCertificateScreen) {
|
||||||
setCertificateInfo(contextOverlayEntity);
|
setCertificateInfo(contextOverlayEntity);
|
||||||
|
|
Loading…
Reference in a new issue