From 79d0a0a0a8a82e8a6ac1e482b18936f81786c11a Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Mon, 25 Feb 2019 19:28:38 +0100 Subject: [PATCH] avatar doctor project status --- .../qml/hifi/avatarPackager/AvatarProject.qml | 82 ++++++++++++++++++- interface/src/avatar/AvatarProject.h | 5 +- 2 files changed, 85 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/hifi/avatarPackager/AvatarProject.qml b/interface/resources/qml/hifi/avatarPackager/AvatarProject.qml index 85ef821a4a..a92739cf8a 100644 --- a/interface/resources/qml/hifi/avatarPackager/AvatarProject.qml +++ b/interface/resources/qml/hifi/avatarPackager/AvatarProject.qml @@ -213,6 +213,63 @@ Item { popup.open(); } + HiFiGlyphs { + id: errorsGlyph + visible: !AvatarPackagerCore.currentAvatarProject || AvatarPackagerCore.currentAvatarProject.hasErrors + text: hifi.glyphs.alert + size: 315 + color: "#EA4C5F" + anchors { + top: parent.top + topMargin: -30 + horizontalCenter: parent.horizontalCenter + } + } + + Image { + id: successGlyph + visible: AvatarPackagerCore.currentAvatarProject && !AvatarPackagerCore.currentAvatarProject.hasErrors + anchors { + top: parent.top + topMargin: 52 + horizontalCenter: parent.horizontalCenter + } + width: 149.6 + height: 149 + source: "../../../icons/checkmark-stroke.svg" + } + + RalewayRegular { + id: doctorStatusMessage + + states: [ + State { + when: AvatarPackagerCore.currentAvatarProject && !AvatarPackagerCore.currentAvatarProject.hasErrors + name: "noErrors" + PropertyChanges { + target: doctorStatusMessage + text: "Your avatar looks fine." + } + }, + State { + when: !AvatarPackagerCore.currentAvatarProject || AvatarPackagerCore.currentAvatarProject.hasErrors + name: "errors" + PropertyChanges { + target: doctorStatusMessage + text: "It seems your project has a few issues that will affect how it works in High Fidelity. " + } + } + ] + color: 'white' + size: 20 + + anchors.left: parent.left + anchors.right: parent.right + anchors.top: errorsGlyph.bottom + + wrapMode: Text.Wrap + } + RalewayRegular { id: infoMessage @@ -240,7 +297,7 @@ Item { anchors.left: parent.left anchors.right: parent.right - anchors.top: parent.top + anchors.top: doctorStatusMessage.bottom anchors.bottomMargin: 24 @@ -249,6 +306,29 @@ Item { text: "You can upload your files to our servers to always access them, and to make your avatar visible to other users." } + RalewayRegular { + id: showErrorsLink + + color: 'white' + linkColor: '#00B4EF' + + visible: AvatarPackagerCore.currentAvatarProject && AvatarPackagerCore.currentAvatarProject.hasErrors + + anchors { + top: infoMessage.bottom + topMargin: 28 + horizontalCenter: parent.horizontalCenter + } + + size: 28 + + text: "View all errors" + + onLinkActivated: { + avatarPackager.state = AvatarPackagerState.avatarDoctorErrorReport; + } + } + HifiControls.Button { id: openFolderButton diff --git a/interface/src/avatar/AvatarProject.h b/interface/src/avatar/AvatarProject.h index f11547bdca..0a63290051 100644 --- a/interface/src/avatar/AvatarProject.h +++ b/interface/src/avatar/AvatarProject.h @@ -77,7 +77,10 @@ public: return QDir::cleanPath(QDir(_projectPath).absoluteFilePath(_fst->getModelPath())); } Q_INVOKABLE bool getHasErrors() const { return _hasErrors; } - Q_INVOKABLE void setHasErrors(bool hasErrors) { _hasErrors = hasErrors; } + Q_INVOKABLE void setHasErrors(bool hasErrors) { + _hasErrors = hasErrors; + emit hasErrorsChanged(); + } /** * returns the AvatarProject or a nullptr on failure.