Replace the "HifiAbout" API with a new "About" API

This commit is contained in:
David Rowe 2020-08-17 11:34:58 +12:00
parent c9c8e5fedd
commit 70fd954ef4
5 changed files with 43 additions and 19 deletions

View file

@ -3,6 +3,7 @@
// //
// Created by David Rowe on 18 Apr 2017 // Created by David Rowe on 18 Apr 2017
// Copyright 2017 High Fidelity, Inc. // Copyright 2017 High Fidelity, Inc.
// Copyright 2020 Vircadia contributors.
// //
// Distributed under the Apache License, Version 2.0. // Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
@ -33,12 +34,12 @@ Rectangle {
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: 70 anchors.leftMargin: 70
RalewayRegular { RalewayRegular {
text: "Build " + HiFiAbout.buildVersion text: "Build " + About.buildVersion
size: 16 size: 16
color: "white" color: "white"
} }
RalewayRegular { RalewayRegular {
text: "Released " + HiFiAbout.buildDate text: "Released " + About.buildDate
size: 16 size: 16
color: "white" color: "white"
} }
@ -56,7 +57,7 @@ Rectangle {
text: "<a href=\"https://github.com/kasenvr/project-athena\">Vircadia Github</a>." text: "<a href=\"https://github.com/kasenvr/project-athena\">Vircadia Github</a>."
size: 20 size: 20
onLinkActivated: { onLinkActivated: {
HiFiAbout.openUrl("https:/github.com/kasenvr/project-athena"); About.openUrl("https:/github.com/kasenvr/project-athena");
} }
} }
@ -70,13 +71,13 @@ Rectangle {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
HiFiAbout.openUrl("https://www.qt.io/"); About.openUrl("https://www.qt.io/");
} }
} }
} }
RalewayRegular { RalewayRegular {
color: "white" color: "white"
text: "Built using Qt " + HiFiAbout.qtVersion text: "Built using Qt " + About.qtVersion
size: 12 size: 12
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
@ -102,7 +103,7 @@ Rectangle {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
HiFiAbout.openUrl("http://opus-codec.org/"); About.openUrl("http://opus-codec.org/");
} }
} }
} }
@ -131,7 +132,7 @@ Rectangle {
text: "Distributed under the <a href=\"http://www.apache.org/licenses/LICENSE-2.0.html\">Apache License, Version 2.0.</a>." text: "Distributed under the <a href=\"http://www.apache.org/licenses/LICENSE-2.0.html\">Apache License, Version 2.0.</a>."
size: 14 size: 14
onLinkActivated: { onLinkActivated: {
HiFiAbout.openUrl("http://www.apache.org/licenses/LICENSE-2.0.html"); About.openUrl("http://www.apache.org/licenses/LICENSE-2.0.html");
} }
} }
} }

View file

@ -894,7 +894,7 @@ Flickable {
hoverEnabled: true hoverEnabled: true
onEntered: privacyPolicyUnderline.visible = true; onEntered: privacyPolicyUnderline.visible = true;
onExited: privacyPolicyUnderline.visible = false; onExited: privacyPolicyUnderline.visible = false;
onClicked: HiFiAbout.openUrl("https://vircadia.com/privacy-policy"); onClicked: About.openUrl("https://vircadia.com/privacy-policy");
} }
} }

View file

@ -4,6 +4,7 @@
// //
// Created by Vlad Stelmahovsky on 15/5/2018. // Created by Vlad Stelmahovsky on 15/5/2018.
// Copyright 2018 High Fidelity, Inc. // Copyright 2018 High Fidelity, Inc.
// Copyright 2020 Vircadia Contributors.
// //
// Distributed under the Apache License, Version 2.0. // Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
@ -16,10 +17,10 @@
#include <QObject> #include <QObject>
/**jsdoc /**jsdoc
* The <code>HifiAbout</code> API provides information about the version of Interface that is currently running. It also * The <code>About</code> API provides information about the version of Interface that is currently running. It also has the
* has the functionality to open a web page in an Interface browser window. * functionality to open a web page in an Interface browser window.
* *
* @namespace HifiAbout * @namespace About
* *
* @hifi-interface * @hifi-interface
* @hifi-client-entity * @hifi-client-entity
@ -30,9 +31,28 @@
* @property {string} qtVersion - The Qt version used in Interface that is currently running. <em>Read-only.</em> * @property {string} qtVersion - The Qt version used in Interface that is currently running. <em>Read-only.</em>
* *
* @example <caption>Report build information for the version of Interface currently running.</caption> * @example <caption>Report build information for the version of Interface currently running.</caption>
* print("HiFi build date: " + HifiAbout.buildDate); // Returns the build date of the version of Interface currently running on your machine. * print("Interface build date: " + About.buildDate);
* print("HiFi version: " + HifiAbout.buildVersion); // Returns the build version of Interface currently running on your machine. * print("Interface version: " + About.buildVersion);
* print("Qt version: " + HifiAbout.qtVersion); // Returns the Qt version details of the version of Interface currently running on your machine. * print("Qt version: " + About.qtVersion);
*/
/**jsdoc
* The <code>HifiAbout</code> API provides information about the version of Interface that is currently running. It also
* has the functionality to open a web page in an Interface browser window.
*
* @namespace HifiAbout
*
* @hifi-interface
* @hifi-client-entity
* @hifi-avatar
*
* @deprecated This API is deprecated and will be removed. Use the {@link About} API instead.
*
* @property {string} buildDate - The build date of Interface that is currently running. <em>Read-only.</em>
* @property {string} buildVersion - The build version of Interface that is currently running. <em>Read-only.</em>
* @property {string} qtVersion - The Qt version used in Interface that is currently running. <em>Read-only.</em>
*
* @borrows About.openUrl as openUrl
*/ */
class AboutUtil : public QObject { class AboutUtil : public QObject {
@ -53,7 +73,7 @@ public slots:
/**jsdoc /**jsdoc
* Display a web page in an Interface browser window. * Display a web page in an Interface browser window.
* @function HifiAbout.openUrl * @function About.openUrl
* @param {string} url - The URL of the web page you want to view in Interface. * @param {string} url - The URL of the web page you want to view in Interface.
*/ */
void openUrl(const QString &url) const; void openUrl(const QString &url) const;

View file

@ -3512,7 +3512,8 @@ void Application::onDesktopRootContextCreated(QQmlContext* surfaceContext) {
surfaceContext->setContextProperty("Selection", DependencyManager::get<SelectionScriptingInterface>().data()); surfaceContext->setContextProperty("Selection", DependencyManager::get<SelectionScriptingInterface>().data());
surfaceContext->setContextProperty("ContextOverlay", DependencyManager::get<ContextOverlayInterface>().data()); surfaceContext->setContextProperty("ContextOverlay", DependencyManager::get<ContextOverlayInterface>().data());
surfaceContext->setContextProperty("WalletScriptingInterface", DependencyManager::get<WalletScriptingInterface>().data()); surfaceContext->setContextProperty("WalletScriptingInterface", DependencyManager::get<WalletScriptingInterface>().data());
surfaceContext->setContextProperty("HiFiAbout", AboutUtil::getInstance()); surfaceContext->setContextProperty("About", AboutUtil::getInstance());
surfaceContext->setContextProperty("HiFiAbout", AboutUtil::getInstance()); // Deprecated
surfaceContext->setContextProperty("ResourceRequestObserver", DependencyManager::get<ResourceRequestObserver>().data()); surfaceContext->setContextProperty("ResourceRequestObserver", DependencyManager::get<ResourceRequestObserver>().data());
if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) { if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) {
@ -3623,7 +3624,8 @@ void Application::setupQmlSurface(QQmlContext* surfaceContext, bool setAdditiona
surfaceContext->setContextProperty("Pointers", DependencyManager::get<PointerScriptingInterface>().data()); surfaceContext->setContextProperty("Pointers", DependencyManager::get<PointerScriptingInterface>().data());
surfaceContext->setContextProperty("Window", DependencyManager::get<WindowScriptingInterface>().data()); surfaceContext->setContextProperty("Window", DependencyManager::get<WindowScriptingInterface>().data());
surfaceContext->setContextProperty("Reticle", qApp->getApplicationCompositor().getReticleInterface()); surfaceContext->setContextProperty("Reticle", qApp->getApplicationCompositor().getReticleInterface());
surfaceContext->setContextProperty("HiFiAbout", AboutUtil::getInstance()); surfaceContext->setContextProperty("About", AboutUtil::getInstance());
surfaceContext->setContextProperty("HiFiAbout", AboutUtil::getInstance()); // Deprecated.
surfaceContext->setContextProperty("WalletScriptingInterface", DependencyManager::get<WalletScriptingInterface>().data()); surfaceContext->setContextProperty("WalletScriptingInterface", DependencyManager::get<WalletScriptingInterface>().data());
surfaceContext->setContextProperty("ResourceRequestObserver", DependencyManager::get<ResourceRequestObserver>().data()); surfaceContext->setContextProperty("ResourceRequestObserver", DependencyManager::get<ResourceRequestObserver>().data());
surfaceContext->setContextProperty("PlatformInfo", PlatformInfoScriptingInterface::getInstance()); surfaceContext->setContextProperty("PlatformInfo", PlatformInfoScriptingInterface::getInstance());
@ -7520,7 +7522,8 @@ void Application::registerScriptEngineWithApplicationServices(const ScriptEngine
scriptEngine->registerGlobalObject("ContextOverlay", DependencyManager::get<ContextOverlayInterface>().data()); scriptEngine->registerGlobalObject("ContextOverlay", DependencyManager::get<ContextOverlayInterface>().data());
scriptEngine->registerGlobalObject("WalletScriptingInterface", DependencyManager::get<WalletScriptingInterface>().data()); scriptEngine->registerGlobalObject("WalletScriptingInterface", DependencyManager::get<WalletScriptingInterface>().data());
scriptEngine->registerGlobalObject("AddressManager", DependencyManager::get<AddressManager>().data()); scriptEngine->registerGlobalObject("AddressManager", DependencyManager::get<AddressManager>().data());
scriptEngine->registerGlobalObject("HifiAbout", AboutUtil::getInstance()); scriptEngine->registerGlobalObject("About", AboutUtil::getInstance());
scriptEngine->registerGlobalObject("HifiAbout", AboutUtil::getInstance()); // Deprecated.
scriptEngine->registerGlobalObject("ResourceRequestObserver", DependencyManager::get<ResourceRequestObserver>().data()); scriptEngine->registerGlobalObject("ResourceRequestObserver", DependencyManager::get<ResourceRequestObserver>().data());
registerInteractiveWindowMetaType(scriptEngine.data()); registerInteractiveWindowMetaType(scriptEngine.data());

View file

@ -369,7 +369,7 @@
} }
} }
var THE_PLACE = (HifiAbout.buildVersion === "dev") ? "hifi://TheSpot-dev" : "hifi://TheSpot"; var THE_PLACE = (About.buildVersion === "dev") ? "hifi://TheSpot-dev" : "hifi://TheSpot";
function clickedOnOverlay(overlayID, event) { function clickedOnOverlay(overlayID, event) {
if (loadingToTheSpotHoverID === overlayID) { if (loadingToTheSpotHoverID === overlayID) {
location.handleLookupString(THE_PLACE); location.handleLookupString(THE_PLACE);