From fee3cc0aca2e60f8b7d896128f2824820ba37947 Mon Sep 17 00:00:00 2001 From: vladest Date: Tue, 15 May 2018 15:49:20 +0200 Subject: [PATCH] Implemented backend for About dialog --- cmake/macros/SetPackagingParameters.cmake | 2 ++ cmake/templates/BuildInfo.h.in | 2 ++ .../qml/hifi/dialogs/TabletAboutDialog.qml | 33 +++++-------------- interface/src/Application.cpp | 4 +++ interface/src/ui/overlays/Web3DOverlay.cpp | 2 ++ 5 files changed, 19 insertions(+), 24 deletions(-) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index 3ca5cb0e54..36e5a065df 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -73,6 +73,8 @@ macro(SET_PACKAGING_PARAMETERS) add_definitions(-DDEV_BUILD) endif () + string(TIMESTAMP BUILD_TIME "%d/%m/%Y") + if (DEPLOY_PACKAGE) # for deployed packages always grab the serverless content set(DOWNLOAD_SERVERLESS_CONTENT ON) diff --git a/cmake/templates/BuildInfo.h.in b/cmake/templates/BuildInfo.h.in index b0af1c0524..904d17293b 100644 --- a/cmake/templates/BuildInfo.h.in +++ b/cmake/templates/BuildInfo.h.in @@ -26,4 +26,6 @@ namespace BuildInfo { const QString VERSION = "@BUILD_VERSION@"; const QString BUILD_BRANCH = "@BUILD_BRANCH@"; const QString BUILD_GLOBAL_SERVICES = "@BUILD_GLOBAL_SERVICES@"; + const QString BUILD_TIME = "@BUILD_TIME@"; } + diff --git a/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml b/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml index 1a51c33368..34767c607d 100644 --- a/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml +++ b/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml @@ -9,7 +9,6 @@ // import QtQuick 2.5 - import "../../styles-uit" Rectangle { @@ -34,29 +33,15 @@ Rectangle { id: buildColumm anchors.left: parent.left anchors.leftMargin: 70 - Row { - RalewayRegular { - text: "Build" - size: 16 - color: "white" - } - RalewayRegular { - id: build - size: 16 - color: "white" - } + RalewayRegular { + text: "Build " + HiFiAbout.buildVersion + size: 16 + color: "white" } - Row { - RalewayRegular { - text: "Released" - size: 16 - color: "white" - } - RalewayRegular { - id: released - size: 16 - color: "white" - } + RalewayRegular { + text: "Released " + HiFiAbout.buildDate + size: 16 + color: "white" } } Item { height: 10; width: 1 } @@ -82,7 +67,7 @@ Rectangle { } RalewayRegular { color: "white" - text: "Built using Qt 5.10.1" + text: "Built using Qt " + HiFiAbout.qtVersion size: 12 anchors.verticalCenter: parent.verticalCenter } diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 13dea71ba4..a4df3880f1 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -220,6 +220,8 @@ #include "webbrowser/WebBrowserSuggestionsEngine.h" #include +#include "AboutUtil.h" + #if defined(Q_OS_WIN) #include @@ -2968,6 +2970,7 @@ void Application::onDesktopRootContextCreated(QQmlContext* surfaceContext) { surfaceContext->setContextProperty("Selection", DependencyManager::get().data()); surfaceContext->setContextProperty("ContextOverlay", DependencyManager::get().data()); surfaceContext->setContextProperty("Wallet", DependencyManager::get().data()); + surfaceContext->setContextProperty("HiFiAbout", AboutUtil::getInstance()); if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) { surfaceContext->setContextProperty("Steam", new SteamScriptingInterface(engine, steamClient.get())); @@ -6577,6 +6580,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe scriptEngine->registerGlobalObject("ContextOverlay", DependencyManager::get().data()); scriptEngine->registerGlobalObject("Wallet", DependencyManager::get().data()); scriptEngine->registerGlobalObject("AddressManager", DependencyManager::get().data()); + scriptEngine->registerGlobalObject("HifiAbout", AboutUtil::getInstance()); scriptEngine->registerGlobalObject("App", this); diff --git a/interface/src/ui/overlays/Web3DOverlay.cpp b/interface/src/ui/overlays/Web3DOverlay.cpp index a48e5eaf54..c678e3d2a2 100644 --- a/interface/src/ui/overlays/Web3DOverlay.cpp +++ b/interface/src/ui/overlays/Web3DOverlay.cpp @@ -57,6 +57,7 @@ #include "SoundCache.h" #include "raypick/PointerScriptingInterface.h" #include +#include "AboutUtil.h" static int MAX_WINDOW_SIZE = 4096; static const float METERS_TO_INCHES = 39.3701f; @@ -259,6 +260,7 @@ void Web3DOverlay::setupQmlSurface() { _webSurface->getSurfaceContext()->setContextProperty("Window", DependencyManager::get().data()); _webSurface->getSurfaceContext()->setContextProperty("Reticle", qApp->getApplicationCompositor().getReticleInterface()); _webSurface->getSurfaceContext()->setContextProperty("desktop", DependencyManager::get()->getDesktop()); + _webSurface->getSurfaceContext()->setContextProperty("HiFiAbout", AboutUtil::getInstance()); // Override min fps for tablet UI, for silky smooth scrolling setMaxFPS(90);