attempt to check version of interface

This commit is contained in:
Elisa Lupin-Jimenez 2017-08-17 18:16:41 -07:00
parent 2b44608ece
commit 4c28b9f09a
3 changed files with 27 additions and 1 deletions

View file

@ -264,6 +264,10 @@ void WindowScriptingInterface::showAssetServer(const QString& upload) {
QMetaObject::invokeMethod(qApp, "showAssetServerWidget", Qt::QueuedConnection, Q_ARG(QString, upload));
}
int WindowScriptingInterface::checkVersion() {
return QCoreApplication::applicationVersion().toInt();
}
int WindowScriptingInterface::getInnerWidth() {
return qApp->getWindow()->geometry().width();
}

View file

@ -58,6 +58,7 @@ public slots:
QScriptValue save(const QString& title = "", const QString& directory = "", const QString& nameFilter = "");
QScriptValue browseAssets(const QString& title = "", const QString& directory = "", const QString& nameFilter = "");
void showAssetServer(const QString& upload = "");
int checkVersion();
void copyToClipboard(const QString& text);
void takeSnapshot(bool notify = true, bool includeAnimated = false, float aspectRatio = 0.0f);
void takeSecondaryCameraSnapshot();

View file

@ -1,8 +1,29 @@
(function() {
///
/// blocksApp.js
/// A tablet app for downloading 3D assets from Google Blocks
///
/// Author: Elisa Lupin-Jimenez
/// Copyright High Fidelity 2017
///
/// Licensed under the Apache 2.0 License
/// See accompanying license file or http://apache.org/
///
/// All assets are under CC Attribution Non-Commerical
/// http://creativecommons.org/licenses/
///
(function () {
var APP_NAME = "BLOCKS";
var APP_URL = "https://vr.google.com/objects/";
var APP_ICON = "https://hifi-content.s3.amazonaws.com/elisalj/blocks/blocks-i.svg";
try {
print("Current Interface version: " + Script.checkVersion());
} catch(err) {
print("Outdated Interface version does not support Blocks");
APP_URL = null;
}
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
var button = tablet.addButton({
icon: APP_ICON,