mirror of
https://github.com/overte-org/overte.git
synced 2025-06-15 20:59:17 +02:00
My Items Interface
This commit is contained in:
parent
3a537cdcc3
commit
66be558a04
3 changed files with 67 additions and 14 deletions
|
@ -39,7 +39,7 @@ Rectangle {
|
||||||
property bool itemIsJson: true;
|
property bool itemIsJson: true;
|
||||||
property bool shouldBuyWithControlledFailure: false;
|
property bool shouldBuyWithControlledFailure: false;
|
||||||
property bool debugCheckoutSuccess: false;
|
property bool debugCheckoutSuccess: false;
|
||||||
property bool canRezCertifiedItems: false;
|
property bool canRezCertifiedItems: Entities.canRezCertified || Entities.canRezTmpCertified;
|
||||||
// Style
|
// Style
|
||||||
color: hifi.colors.white;
|
color: hifi.colors.white;
|
||||||
Hifi.QmlCommerce {
|
Hifi.QmlCommerce {
|
||||||
|
@ -829,7 +829,6 @@ Rectangle {
|
||||||
if (itemHref.indexOf('.json') === -1) {
|
if (itemHref.indexOf('.json') === -1) {
|
||||||
root.itemIsJson = false;
|
root.itemIsJson = false;
|
||||||
}
|
}
|
||||||
root.canRezCertifiedItems = message.canRezCertifiedItems;
|
|
||||||
setBuyText();
|
setBuyText();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -32,8 +32,9 @@ Rectangle {
|
||||||
property bool securityImageResultReceived: false;
|
property bool securityImageResultReceived: false;
|
||||||
property bool purchasesReceived: false;
|
property bool purchasesReceived: false;
|
||||||
property bool punctuationMode: false;
|
property bool punctuationMode: false;
|
||||||
property bool canRezCertifiedItems: false;
|
property bool canRezCertifiedItems: Entities.canRezCertified || Entities.canRezTmpCertified;
|
||||||
property bool pendingInventoryReply: true;
|
property bool pendingInventoryReply: true;
|
||||||
|
property bool isShowingMyItems: false;
|
||||||
// Style
|
// Style
|
||||||
color: hifi.colors.white;
|
color: hifi.colors.white;
|
||||||
Hifi.QmlCommerce {
|
Hifi.QmlCommerce {
|
||||||
|
@ -299,7 +300,7 @@ Rectangle {
|
||||||
anchors.topMargin: 4;
|
anchors.topMargin: 4;
|
||||||
|
|
||||||
RalewayRegular {
|
RalewayRegular {
|
||||||
id: myPurchasesText;
|
id: myText;
|
||||||
anchors.top: parent.top;
|
anchors.top: parent.top;
|
||||||
anchors.topMargin: 10;
|
anchors.topMargin: 10;
|
||||||
anchors.bottom: parent.bottom;
|
anchors.bottom: parent.bottom;
|
||||||
|
@ -307,7 +308,7 @@ Rectangle {
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
anchors.leftMargin: 4;
|
anchors.leftMargin: 4;
|
||||||
width: paintedWidth;
|
width: paintedWidth;
|
||||||
text: "My Purchases";
|
text: isShowingMyItems ? "My Items" : "My Purchases";
|
||||||
color: hifi.colors.baseGray;
|
color: hifi.colors.baseGray;
|
||||||
size: 28;
|
size: 28;
|
||||||
}
|
}
|
||||||
|
@ -317,7 +318,7 @@ Rectangle {
|
||||||
colorScheme: hifi.colorSchemes.faintGray;
|
colorScheme: hifi.colorSchemes.faintGray;
|
||||||
hasClearButton: true;
|
hasClearButton: true;
|
||||||
hasRoundedBorder: true;
|
hasRoundedBorder: true;
|
||||||
anchors.left: myPurchasesText.right;
|
anchors.left: myText.right;
|
||||||
anchors.leftMargin: 16;
|
anchors.leftMargin: 16;
|
||||||
anchors.top: parent.top;
|
anchors.top: parent.top;
|
||||||
anchors.bottom: parent.bottom;
|
anchors.bottom: parent.bottom;
|
||||||
|
@ -421,7 +422,7 @@ Rectangle {
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
id: purchasesContentsList;
|
id: purchasesContentsList;
|
||||||
visible: purchasesModel.count !== 0;
|
visible: (root.isShowingMyItems && filteredPurchasesModel.count !== 0) || (!root.isShowingMyItems && filteredPurchasesModel.count !== 0);
|
||||||
clip: true;
|
clip: true;
|
||||||
model: filteredPurchasesModel;
|
model: filteredPurchasesModel;
|
||||||
// Anchors
|
// Anchors
|
||||||
|
@ -473,9 +474,55 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: noItemsAlertContainer;
|
||||||
|
visible: !purchasesContentsList.visible && root.purchasesReceived && root.isShowingMyItems && filterBar.text === "";
|
||||||
|
anchors.top: filterBarContainer.bottom;
|
||||||
|
anchors.topMargin: 12;
|
||||||
|
anchors.left: parent.left;
|
||||||
|
anchors.bottom: parent.bottom;
|
||||||
|
width: parent.width;
|
||||||
|
|
||||||
|
// Explanitory text
|
||||||
|
RalewayRegular {
|
||||||
|
id: noItemsYet;
|
||||||
|
text: "<b>You haven't submitted anything to the Marketplace yet!</b><br><br>Submit an item to the Marketplace to add it to My Items.";
|
||||||
|
// Text size
|
||||||
|
size: 22;
|
||||||
|
// Anchors
|
||||||
|
anchors.top: parent.top;
|
||||||
|
anchors.topMargin: 150;
|
||||||
|
anchors.left: parent.left;
|
||||||
|
anchors.leftMargin: 24;
|
||||||
|
anchors.right: parent.right;
|
||||||
|
anchors.rightMargin: 24;
|
||||||
|
height: paintedHeight;
|
||||||
|
// Style
|
||||||
|
color: hifi.colors.baseGray;
|
||||||
|
wrapMode: Text.WordWrap;
|
||||||
|
// Alignment
|
||||||
|
horizontalAlignment: Text.AlignHCenter;
|
||||||
|
}
|
||||||
|
|
||||||
|
// "Go To Marketplace" button
|
||||||
|
HifiControlsUit.Button {
|
||||||
|
color: hifi.buttons.blue;
|
||||||
|
colorScheme: hifi.colorSchemes.dark;
|
||||||
|
anchors.top: noItemsYet.bottom;
|
||||||
|
anchors.topMargin: 20;
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter;
|
||||||
|
width: parent.width * 2 / 3;
|
||||||
|
height: 50;
|
||||||
|
text: "Visit Marketplace";
|
||||||
|
onClicked: {
|
||||||
|
sendToScript({method: 'purchases_goToMarketplaceClicked'});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: noPurchasesAlertContainer;
|
id: noPurchasesAlertContainer;
|
||||||
visible: !purchasesContentsList.visible && root.purchasesReceived;
|
visible: !purchasesContentsList.visible && root.purchasesReceived && !root.isShowingMyItems && filterBar.text === "";
|
||||||
anchors.top: filterBarContainer.bottom;
|
anchors.top: filterBarContainer.bottom;
|
||||||
anchors.topMargin: 12;
|
anchors.topMargin: 12;
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
|
@ -503,7 +550,7 @@ Rectangle {
|
||||||
horizontalAlignment: Text.AlignHCenter;
|
horizontalAlignment: Text.AlignHCenter;
|
||||||
}
|
}
|
||||||
|
|
||||||
// "Set Up" button
|
// "Go To Marketplace" button
|
||||||
HifiControlsUit.Button {
|
HifiControlsUit.Button {
|
||||||
color: hifi.buttons.blue;
|
color: hifi.buttons.blue;
|
||||||
colorScheme: hifi.colorSchemes.dark;
|
colorScheme: hifi.colorSchemes.dark;
|
||||||
|
@ -582,9 +629,9 @@ Rectangle {
|
||||||
filteredPurchasesModel.clear();
|
filteredPurchasesModel.clear();
|
||||||
for (var i = 0; i < purchasesModel.count; i++) {
|
for (var i = 0; i < purchasesModel.count; i++) {
|
||||||
if (purchasesModel.get(i).title.toLowerCase().indexOf(filterBar.text.toLowerCase()) !== -1) {
|
if (purchasesModel.get(i).title.toLowerCase().indexOf(filterBar.text.toLowerCase()) !== -1) {
|
||||||
if (purchasesModel.get(i).status !== "confirmed") {
|
if (purchasesModel.get(i).status !== "confirmed" && !root.isShowingMyItems) {
|
||||||
filteredPurchasesModel.insert(0, purchasesModel.get(i));
|
filteredPurchasesModel.insert(0, purchasesModel.get(i));
|
||||||
} else {
|
} else if ((root.isShowingMyItems && purchasesModel.get(i).edition_number === -1) || !root.isShowingMyItems) {
|
||||||
filteredPurchasesModel.append(purchasesModel.get(i));
|
filteredPurchasesModel.append(purchasesModel.get(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -632,7 +679,6 @@ Rectangle {
|
||||||
case 'updatePurchases':
|
case 'updatePurchases':
|
||||||
referrerURL = message.referrerURL;
|
referrerURL = message.referrerURL;
|
||||||
titleBarContainer.referrerURL = message.referrerURL;
|
titleBarContainer.referrerURL = message.referrerURL;
|
||||||
root.canRezCertifiedItems = message.canRezCertifiedItems;
|
|
||||||
filterBar.text = message.filterText ? message.filterText : "";
|
filterBar.text = message.filterText ? message.filterText : "";
|
||||||
break;
|
break;
|
||||||
case 'purchases_getIsFirstUseResult':
|
case 'purchases_getIsFirstUseResult':
|
||||||
|
@ -647,6 +693,9 @@ Rectangle {
|
||||||
case 'inspectionCertificate_setItemInfo':
|
case 'inspectionCertificate_setItemInfo':
|
||||||
inspectionCertificate.fromScript(message);
|
inspectionCertificate.fromScript(message);
|
||||||
break;
|
break;
|
||||||
|
case 'purchases_showMyItems':
|
||||||
|
root.isShowingMyItems = true;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
console.log('Unrecognized message from marketplaces.js:', JSON.stringify(message));
|
console.log('Unrecognized message from marketplaces.js:', JSON.stringify(message));
|
||||||
}
|
}
|
||||||
|
|
|
@ -337,7 +337,6 @@
|
||||||
tablet.loadQMLSource("TabletAddressDialog.qml");
|
tablet.loadQMLSource("TabletAddressDialog.qml");
|
||||||
break;
|
break;
|
||||||
case 'purchases_itemCertificateClicked':
|
case 'purchases_itemCertificateClicked':
|
||||||
console.log("ZRFJIOSE FJSOPIEFJSE OIFJSOPEI FJSIOEFJ ")
|
|
||||||
setCertificateInfo("", message.itemMarketplaceId);
|
setCertificateInfo("", message.itemMarketplaceId);
|
||||||
break;
|
break;
|
||||||
case 'inspectionCertificate_closeClicked':
|
case 'inspectionCertificate_closeClicked':
|
||||||
|
@ -347,7 +346,13 @@
|
||||||
tablet.gotoWebScreen(MARKETPLACE_URL + '/items/' + message.itemId, MARKETPLACES_INJECT_SCRIPT_URL);
|
tablet.gotoWebScreen(MARKETPLACE_URL + '/items/' + message.itemId, MARKETPLACES_INJECT_SCRIPT_URL);
|
||||||
break;
|
break;
|
||||||
case 'header_myItemsClicked':
|
case 'header_myItemsClicked':
|
||||||
tablet.gotoWebScreen(MARKETPLACE_URL + '?view=mine', MARKETPLACES_INJECT_SCRIPT_URL);
|
referrerURL = MARKETPLACE_URL_INITIAL;
|
||||||
|
filterText = "";
|
||||||
|
tablet.pushOntoStack(MARKETPLACE_PURCHASES_QML_PATH);
|
||||||
|
wireEventBridge(true);
|
||||||
|
tablet.sendToQml({
|
||||||
|
method: 'purchases_showMyItems'
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
print('Unrecognized message from Checkout.qml or Purchases.qml: ' + JSON.stringify(message));
|
print('Unrecognized message from Checkout.qml or Purchases.qml: ' + JSON.stringify(message));
|
||||||
|
|
Loading…
Reference in a new issue