From 3ed47b4f2345d91602aa98ec4fde1a05f961defd Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Wed, 22 May 2019 15:45:18 -0700 Subject: [PATCH] Show error states in Avatar app (BUGZ-310) --- .../hifi/simplifiedUI/avatarApp/AvatarApp.qml | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml b/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml index 57bec2250f..cb0da7c0df 100644 --- a/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml +++ b/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml @@ -58,7 +58,8 @@ Rectangle { if (isLoggedIn) { Commerce.getWalletStatus(); } else { - // Show some error to the user + errorText.text = "There was a problem while retrieving your inventory. " + + "Please try closing and re-opening the Avatar app.\n\nLogin status result: " + isLoggedIn; } } @@ -66,11 +67,17 @@ Rectangle { if (walletStatus === 5) { getInventory(); } else { - // Show some error to the user + errorText.text = "There was a problem while retrieving your inventory. " + + "Please try closing and re-opening the Avatar app.\n\nWallet status result: " + walletStatus; } } onInventoryResult: { + if (result.status !== "success") { + errorText.text = "There was a problem while retrieving your inventory. " + + "Please try closing and re-opening the Avatar app.\n\nInventory status: " + result.status + "\nMessage: " + result.message; + } + avatarAppInventoryModel.handlePage(result.status !== "success" && result.message, result); root.updatePreviewUrl(); } @@ -172,7 +179,7 @@ Rectangle { anchors.bottom: parent.bottom AnimatedImage { - visible: !inventoryContentsList.visible + visible: !inventoryContentsList.visible && !errorText.visible anchors.centerIn: parent width: 72 height: width @@ -181,7 +188,7 @@ Rectangle { ListView { id: inventoryContentsList - visible: avatarAppInventoryModel.count !== 0 + visible: avatarAppInventoryModel.count !== 0 && !errorText.visible interactive: contentItem.height > height clip: true model: avatarAppInventoryModel @@ -196,6 +203,18 @@ Rectangle { standaloneIncompatible: model.standalone_incompatible } } + + HifiStylesUit.GraphikRegular { + id: errorText + text: "" + visible: text !== "" + anchors.fill: parent + size: 22 + color: simplifiedUI.colors.text.white + wrapMode: Text.Wrap + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + } }