From 7bf1b176d72215077545d7fbac9743b24e26aa76 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Fri, 10 Nov 2017 12:34:52 -0800 Subject: [PATCH] Renaming Tablet API to Tablets, supporting dev-mode QML loading from filesystem --- interface/CMakeLists.txt | 8 +- .../qml/LoginDialog/LinkAccountBody.qml | 2 +- .../resources/qml/LoginDialog/SignUpBody.qml | 2 +- .../qml/LoginDialog/UsernameCollisionBody.qml | 2 +- .../resources/qml/controls-uit/Button.qml | 4 +- .../resources/qml/controls-uit/CheckBox.qml | 4 +- .../qml/controls-uit/CheckBoxQQC2.qml | 4 +- .../qml/controls-uit/GlyphButton.qml | 4 +- interface/resources/qml/controls-uit/Key.qml | 4 +- .../qml/controls-uit/RadioButton.qml | 4 +- .../qml/controls/FlickableWebViewCore.qml | 2 +- .../dialogs/TabletConnectionFailureDialog.qml | 2 +- .../qml/dialogs/TabletLoginDialog.qml | 4 +- .../dialogs/preferences/ButtonPreference.qml | 4 +- .../preferences/CheckBoxPreference.qml | 4 +- interface/resources/qml/hifi/Card.qml | 6 +- interface/resources/qml/hifi/audio/MicBar.qml | 4 +- .../qml/hifi/tablet/NewEntityButton.qml | 4 +- .../resources/qml/hifi/tablet/Tablet.qml | 280 ------------------ .../qml/hifi/tablet/TabletAddressDialog.qml | 4 +- .../hifi/tablet/TabletAttachmentsDialog.qml | 2 +- .../qml/hifi/tablet/TabletButton.qml | 5 +- .../resources/qml/hifi/tablet/TabletHome.qml | 159 ++++++++++ .../qml/hifi/tablet/TabletMenuView.qml | 4 +- .../tabletWindows/TabletPreferencesDialog.qml | 4 +- interface/src/Application.cpp | 10 +- interface/src/ui/overlays/Web3DOverlay.cpp | 4 - .../src/model-networking/TextureCache.cpp | 2 - libraries/octree/src/Octree.cpp | 4 - libraries/shared/src/PathUtils.cpp | 25 +- libraries/shared/src/PathUtils.h | 4 + libraries/ui/src/ui/OffscreenQmlSurface.cpp | 17 +- .../ui/src/ui/TabletScriptingInterface.cpp | 12 +- scripts/developer/EZrecord.js | 4 +- scripts/developer/inputRecording.js | 2 +- .../developer/tests/dynamics/dynamicsTests.js | 4 +- scripts/developer/tests/puck-attach.js | 2 +- scripts/developer/tests/sliderTestMain.js | 2 +- .../developer/tests/tabletEventBridgeTest.js | 4 +- scripts/developer/tests/tabletTest.js | 2 +- scripts/developer/utilities/audio/stats.js | 2 +- scripts/developer/utilities/render/luci.js | 2 +- .../render/photobooth/photoboothApp.js | 4 +- scripts/system/audio.js | 2 +- scripts/system/audioMuteOverlay.js | 2 +- scripts/system/audioScope.js | 4 +- scripts/system/bubble.js | 2 +- scripts/system/chat.js | 2 +- scripts/system/commerce/wallet.js | 2 +- scripts/system/controllers/godView.js | 4 +- scripts/system/edit.js | 14 +- scripts/system/fingerPaint.js | 4 +- scripts/system/generalSettings.js | 4 +- scripts/system/goto.js | 4 +- scripts/system/help.js | 4 +- scripts/system/hmd.js | 4 +- scripts/system/libraries/WebTablet.js | 6 +- scripts/system/libraries/entityList.js | 4 +- scripts/system/libraries/gridTool.js | 2 +- scripts/system/libraries/utils.js | 2 +- scripts/system/marketplaces/marketplace.js | 2 +- scripts/system/marketplaces/marketplaces.js | 4 +- scripts/system/menu.js | 2 +- scripts/system/mod.js | 2 +- scripts/system/notifications.js | 4 +- scripts/system/pal.js | 4 +- .../particle_explorer/particleExplorerTool.js | 2 +- scripts/system/snapshot.js | 4 +- scripts/system/tablet-goto.js | 4 +- scripts/system/tablet-ui/tabletUI.js | 6 +- scripts/system/tablet-users.js | 2 +- scripts/tutorials/createFloatingLanternBox.js | 2 +- scripts/tutorials/createTetherballStick.js | 2 +- .../entity_scripts/floatingLantern.js | 2 +- .../entity_scripts/floatingLanternBox.js | 2 +- .../entity_scripts/tetherballStick.js | 2 +- tests/shared/src/PathUtilsTests.cpp | 28 ++ tests/shared/src/PathUtilsTests.h | 20 ++ .../marketplace/blocks/blocksApp.js | 2 +- .../camera-move/app-camera-move.js | 4 +- .../marketplace/clap/clapApp.js | 2 +- .../app-doppleganger-attachments.js | 2 +- .../dist/app-doppleganger-marketplace.js | 2 +- .../doppleganger-mirror/app-doppleganger.js | 2 +- .../marketplace/emoji-tablet/emojiTablet.js | 2 +- .../marketplace/laser/laserPointerApp.js | 2 +- .../marketplace/record/record.js | 4 +- .../marketplace/shapes/shapes.js | 2 +- .../skyboxChanger/skyboxchanger.js | 2 +- .../spectator-camera/spectatorCamera.js | 4 +- .../tablet-raiseHand/tablet-raiseHand.js | 2 +- 91 files changed, 388 insertions(+), 436 deletions(-) delete mode 100644 interface/resources/qml/hifi/tablet/Tablet.qml create mode 100644 interface/resources/qml/hifi/tablet/TabletHome.qml create mode 100644 tests/shared/src/PathUtilsTests.cpp create mode 100644 tests/shared/src/PathUtilsTests.h diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 4c1b8d8d92..b3400c8dd0 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -12,8 +12,10 @@ function(JOIN VALUES GLUE OUTPUT) endfunction() -set(INTERFACE_QML_QRC ${CMAKE_CURRENT_BINARY_DIR}/qml.qrc) -generate_qrc(OUTPUT ${INTERFACE_QML_QRC} PATH ${CMAKE_CURRENT_SOURCE_DIR}/resources GLOBS *.qml *.qss *.js *.html *.ttf *.gif *.svg *.png *.jpg) +if (NOT DEV_BUILD) + set(INTERFACE_QML_QRC ${CMAKE_CURRENT_BINARY_DIR}/qml.qrc) + generate_qrc(OUTPUT ${INTERFACE_QML_QRC} PATH ${CMAKE_CURRENT_SOURCE_DIR}/resources GLOBS *.qml *.qss *.js *.html *.ttf *.gif *.svg *.png *.jpg) +endif() # set a default root dir for each of our optional externals if it was not passed set(OPTIONAL_EXTERNALS "LeapMotion") @@ -80,7 +82,9 @@ qt5_wrap_ui(QT_UI_HEADERS "${QT_UI_FILES}") # add them to the interface source files set(INTERFACE_SRCS ${INTERFACE_SRCS} "${QT_UI_HEADERS}" "${QT_RESOURCES}") +if (NOT DEV_BUILD) list(APPEND INTERFACE_SRCS ${INTERFACE_QML_QRC}) +endif() if (UNIX) install( diff --git a/interface/resources/qml/LoginDialog/LinkAccountBody.qml b/interface/resources/qml/LoginDialog/LinkAccountBody.qml index 300bcd46f0..552291c186 100644 --- a/interface/resources/qml/LoginDialog/LinkAccountBody.qml +++ b/interface/resources/qml/LoginDialog/LinkAccountBody.qml @@ -248,7 +248,7 @@ Item { //dont rise local keyboard keyboardEnabled = !root.isTablet && HMD.active; - //but rise Tablet's one instead for Tablet interface + //but rise Tablet's one instead for Tablets interface if (root.isTablet) { root.keyboardEnabled = HMD.active; root.keyboardRaised = Qt.binding( function() { return keyboardRaised; }) diff --git a/interface/resources/qml/LoginDialog/SignUpBody.qml b/interface/resources/qml/LoginDialog/SignUpBody.qml index 9d55998b40..e521e16a60 100644 --- a/interface/resources/qml/LoginDialog/SignUpBody.qml +++ b/interface/resources/qml/LoginDialog/SignUpBody.qml @@ -221,7 +221,7 @@ Item { root.iconText = "<" //dont rise local keyboard keyboardEnabled = !root.isTablet && HMD.active; - //but rise Tablet's one instead for Tablet interface + //but rise Tablet's one instead for Tablets interface if (root.isTablet) { root.keyboardEnabled = HMD.active; root.keyboardRaised = Qt.binding( function() { return keyboardRaised; }) diff --git a/interface/resources/qml/LoginDialog/UsernameCollisionBody.qml b/interface/resources/qml/LoginDialog/UsernameCollisionBody.qml index 5c212578b8..185cbd9d47 100644 --- a/interface/resources/qml/LoginDialog/UsernameCollisionBody.qml +++ b/interface/resources/qml/LoginDialog/UsernameCollisionBody.qml @@ -131,7 +131,7 @@ Item { root.iconText = "<" //dont rise local keyboard keyboardEnabled = !root.isTablet && HMD.active; - //but rise Tablet's one instead for Tablet interface + //but rise Tablet's one instead for Tablets interface if (root.isTablet) { root.keyboardEnabled = HMD.active; root.keyboardRaised = Qt.binding( function() { return keyboardRaised; }) diff --git a/interface/resources/qml/controls-uit/Button.qml b/interface/resources/qml/controls-uit/Button.qml index c068fdcfaf..a305bea8dc 100644 --- a/interface/resources/qml/controls-uit/Button.qml +++ b/interface/resources/qml/controls-uit/Button.qml @@ -29,12 +29,12 @@ Original.Button { onHoveredChanged: { if (hovered) { - tabletInterface.playSound(TabletEnums.ButtonHover); + Tablets.playSound(TabletEnums.ButtonHover); } } onClicked: { - tabletInterface.playSound(TabletEnums.ButtonClick); + Tablets.playSound(TabletEnums.ButtonClick); } style: ButtonStyle { diff --git a/interface/resources/qml/controls-uit/CheckBox.qml b/interface/resources/qml/controls-uit/CheckBox.qml index 22b25671c3..37bc936aa1 100644 --- a/interface/resources/qml/controls-uit/CheckBox.qml +++ b/interface/resources/qml/controls-uit/CheckBox.qml @@ -31,12 +31,12 @@ Original.CheckBox { activeFocusOnPress: true onClicked: { - tabletInterface.playSound(TabletEnums.ButtonClick); + Tablets.playSound(TabletEnums.ButtonClick); } // TODO: doesnt works for QQC1. check with QQC2 // onHovered: { -// tabletInterface.playSound(TabletEnums.ButtonHover); +// Tablets.playSound(TabletEnums.ButtonHover); // } style: CheckBoxStyle { diff --git a/interface/resources/qml/controls-uit/CheckBoxQQC2.qml b/interface/resources/qml/controls-uit/CheckBoxQQC2.qml index 32d69cf339..404d83ebd2 100644 --- a/interface/resources/qml/controls-uit/CheckBoxQQC2.qml +++ b/interface/resources/qml/controls-uit/CheckBoxQQC2.qml @@ -36,12 +36,12 @@ CheckBox { hoverEnabled: true onClicked: { - tabletInterface.playSound(TabletEnums.ButtonClick); + Tablets.playSound(TabletEnums.ButtonClick); } onHoveredChanged: { if (hovered) { - tabletInterface.playSound(TabletEnums.ButtonHover); + Tablets.playSound(TabletEnums.ButtonHover); } } diff --git a/interface/resources/qml/controls-uit/GlyphButton.qml b/interface/resources/qml/controls-uit/GlyphButton.qml index bc7bc636fe..d225c8e1d1 100644 --- a/interface/resources/qml/controls-uit/GlyphButton.qml +++ b/interface/resources/qml/controls-uit/GlyphButton.qml @@ -27,12 +27,12 @@ Original.Button { onHoveredChanged: { if (hovered) { - tabletInterface.playSound(TabletEnums.ButtonHover); + Tablets.playSound(TabletEnums.ButtonHover); } } onClicked: { - tabletInterface.playSound(TabletEnums.ButtonClick); + Tablets.playSound(TabletEnums.ButtonClick); } style: ButtonStyle { diff --git a/interface/resources/qml/controls-uit/Key.qml b/interface/resources/qml/controls-uit/Key.qml index e54250c872..3ec579a4eb 100644 --- a/interface/resources/qml/controls-uit/Key.qml +++ b/interface/resources/qml/controls-uit/Key.qml @@ -35,13 +35,13 @@ Item { onContainsMouseChanged: { if (containsMouse) { - tabletInterface.playSound(TabletEnums.ButtonHover); + Tablets.playSound(TabletEnums.ButtonHover); } } onClicked: { mouse.accepted = true; - tabletInterface.playSound(TabletEnums.ButtonClick); + Tablets.playSound(TabletEnums.ButtonClick); webEntity.synthesizeKeyPress(glyph); webEntity.synthesizeKeyPress(glyph, mirrorText); diff --git a/interface/resources/qml/controls-uit/RadioButton.qml b/interface/resources/qml/controls-uit/RadioButton.qml index 65d36d2dcb..da4e944f35 100644 --- a/interface/resources/qml/controls-uit/RadioButton.qml +++ b/interface/resources/qml/controls-uit/RadioButton.qml @@ -30,12 +30,12 @@ Original.RadioButton { readonly property int checkRadius: 2 onClicked: { - tabletInterface.playSound(TabletEnums.ButtonClick); + Tablets.playSound(TabletEnums.ButtonClick); } // TODO: doesnt works for QQC1. check with QQC2 // onHovered: { -// tabletInterface.playSound(TabletEnums.ButtonHover); +// Tablets.playSound(TabletEnums.ButtonHover); // } style: RadioButtonStyle { diff --git a/interface/resources/qml/controls/FlickableWebViewCore.qml b/interface/resources/qml/controls/FlickableWebViewCore.qml index cbc4d19334..9e1751ee51 100644 --- a/interface/resources/qml/controls/FlickableWebViewCore.qml +++ b/interface/resources/qml/controls/FlickableWebViewCore.qml @@ -41,7 +41,7 @@ Item { } if (WebEngineView.LoadFailedStatus === loadRequest.status) { - console.log(" Tablet WebEngineView failed to load url: " + loadRequest.url.toString()); + console.log("Tablet WebEngineView failed to load url: " + loadRequest.url.toString()); } if (WebEngineView.LoadSucceededStatus === loadRequest.status) { diff --git a/interface/resources/qml/dialogs/TabletConnectionFailureDialog.qml b/interface/resources/qml/dialogs/TabletConnectionFailureDialog.qml index 6d2ff36550..750ed0edd4 100644 --- a/interface/resources/qml/dialogs/TabletConnectionFailureDialog.qml +++ b/interface/resources/qml/dialogs/TabletConnectionFailureDialog.qml @@ -24,7 +24,7 @@ Item { }); object.selected.connect(function(button) { if (button === OriginalDialogs.StandardButton.Ok) { - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); tablet.gotoHomeScreen() } }); diff --git a/interface/resources/qml/dialogs/TabletLoginDialog.qml b/interface/resources/qml/dialogs/TabletLoginDialog.qml index 269788a808..5f1e9cd3bf 100644 --- a/interface/resources/qml/dialogs/TabletLoginDialog.qml +++ b/interface/resources/qml/dialogs/TabletLoginDialog.qml @@ -89,10 +89,10 @@ TabletModalWindow { //bodyLoader.active = false } if (gotoPreviousApp) { - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); tablet.returnToPreviousApp(); } else { - Tablet.getTablet("com.highfidelity.interface.tablet.system").gotoHomeScreen(); + Tablets.getTablet("com.highfidelity.interface.tablet.system").gotoHomeScreen(); } } diff --git a/interface/resources/qml/dialogs/preferences/ButtonPreference.qml b/interface/resources/qml/dialogs/preferences/ButtonPreference.qml index 3a5c850031..bae581a47f 100644 --- a/interface/resources/qml/dialogs/preferences/ButtonPreference.qml +++ b/interface/resources/qml/dialogs/preferences/ButtonPreference.qml @@ -25,13 +25,13 @@ Preference { id: button onHoveredChanged: { if (hovered) { - tabletInterface.playSound(TabletEnums.ButtonHover); + Tablets.playSound(TabletEnums.ButtonHover); } } onClicked: { preference.trigger(); - tabletInterface.playSound(TabletEnums.ButtonClick); + Tablets.playSound(TabletEnums.ButtonClick); } width: 180 anchors.bottom: parent.bottom diff --git a/interface/resources/qml/dialogs/preferences/CheckBoxPreference.qml b/interface/resources/qml/dialogs/preferences/CheckBoxPreference.qml index 8904896ab7..81884d9a72 100644 --- a/interface/resources/qml/dialogs/preferences/CheckBoxPreference.qml +++ b/interface/resources/qml/dialogs/preferences/CheckBoxPreference.qml @@ -41,12 +41,12 @@ Preference { id: checkBox onHoveredChanged: { if (hovered) { - tabletInterface.playSound(TabletEnums.ButtonHover); + Tablets.playSound(TabletEnums.ButtonHover); } } onClicked: { - tabletInterface.playSound(TabletEnums.ButtonClick); + Tablets.playSound(TabletEnums.ButtonClick); } anchors { diff --git a/interface/resources/qml/hifi/Card.qml b/interface/resources/qml/hifi/Card.qml index fc7b8c6200..8d69afab46 100644 --- a/interface/resources/qml/hifi/Card.qml +++ b/interface/resources/qml/hifi/Card.qml @@ -246,12 +246,12 @@ Item { anchors.fill: parent; acceptedButtons: Qt.LeftButton; onClicked: { - tabletInterface.playSound(TabletEnums.ButtonClick); + Tablets.playSound(TabletEnums.ButtonClick); goFunction("hifi://" + hifiUrl); } hoverEnabled: true; onEntered: { - tabletInterface.playSound(TabletEnums.ButtonHover); + Tablets.playSound(TabletEnums.ButtonHover); hoverThunk(); } onExited: unhoverThunk(); @@ -269,7 +269,7 @@ Item { } } function go() { - tabletInterface.playSound(TabletEnums.ButtonClick); + Tablets.playSound(TabletEnums.ButtonClick); goFunction(drillDownToPlace ? ("/places/" + placeName) : ("/user_stories/" + storyId)); } MouseArea { diff --git a/interface/resources/qml/hifi/audio/MicBar.qml b/interface/resources/qml/hifi/audio/MicBar.qml index b6699d6ceb..9ef8bf3698 100644 --- a/interface/resources/qml/hifi/audio/MicBar.qml +++ b/interface/resources/qml/hifi/audio/MicBar.qml @@ -61,12 +61,12 @@ Rectangle { scrollGestureEnabled: false; onClicked: { Audio.muted = !Audio.muted; - tabletInterface.playSound(TabletEnums.ButtonClick); + Tablets.playSound(TabletEnums.ButtonClick); } drag.target: dragTarget; onContainsMouseChanged: { if (containsMouse) { - tabletInterface.playSound(TabletEnums.ButtonHover); + Tablets.playSound(TabletEnums.ButtonHover); } } } diff --git a/interface/resources/qml/hifi/tablet/NewEntityButton.qml b/interface/resources/qml/hifi/tablet/NewEntityButton.qml index 7f838717df..49fdb4368f 100644 --- a/interface/resources/qml/hifi/tablet/NewEntityButton.qml +++ b/interface/resources/qml/hifi/tablet/NewEntityButton.qml @@ -123,11 +123,11 @@ Item { hoverEnabled: true enabled: true onClicked: { - tabletInterface.playSound(TabletEnums.ButtonClick); + Tablets.playSound(TabletEnums.ButtonClick); newEntityButton.clicked(); } onEntered: { - tabletInterface.playSound(TabletEnums.ButtonHover); + Tablets.playSound(TabletEnums.ButtonHover); newEntityButton.state = "hover state"; } onExited: { diff --git a/interface/resources/qml/hifi/tablet/Tablet.qml b/interface/resources/qml/hifi/tablet/Tablet.qml deleted file mode 100644 index b21bf9c506..0000000000 --- a/interface/resources/qml/hifi/tablet/Tablet.qml +++ /dev/null @@ -1,280 +0,0 @@ -import QtQuick 2.5 -import QtGraphicalEffects 1.0 -import QtQuick.Layouts 1.3 - -import "." -import "../../styles-uit" -import "../audio" as HifiAudio - -Item { - id: tablet - objectName: "tablet" - property int rowIndex: 0 - property int columnIndex: 0 - property int count: (flowMain.children.length - 1) - - Component { - id: buttonComponent - TabletButton { } - } - - Component.onCompleted: { - tablet.populateButtons(); - } - - function createClickedHandler(proxy) { - return function() { proxy.clicked(); } - } - - function populateButtons() { - var tabletProxy = Tablet.getTablet("com.highfidelity.interface.tablet.system"); - var buttons = tabletProxy.getButtons(); - for (var i = 0; i < buttons.length; i++) { - var proxy = buttons[i]; - var button = tablet.addButtonProxy(proxy.getProperties()); - button.clicked.connect(createClickedHandler(proxy)); - proxy.setQmlButton(button); - } - sortButtons(); - } - - // used to look up a button by its uuid - function findButtonIndex(uuid) { - if (!uuid) { - return -1; - } - - for (var i in flowMain.children) { - var child = flowMain.children[i]; - if (child.uuid === uuid) { - return i; - } - } - return -1; - } - - function sortButtons() { - var children = []; - for (var i = 0; i < flowMain.children.length; i++) { - children[i] = flowMain.children[i]; - } - - children.sort(function (a, b) { - if (a.sortOrder === b.sortOrder) { - // subsort by stableOrder, because JS sort is not stable in qml. - return a.stableOrder - b.stableOrder; - } else { - return a.sortOrder - b.sortOrder; - } - }); - - flowMain.children = children; - } - - // called by C++ code when a button should be added to the tablet - function addButtonProxy(properties) { - var button = buttonComponent.createObject(flowMain); - // copy all properites to button - var keys = Object.keys(properties).forEach(function (key) { - button[key] = properties[key]; - }); - - // pass a reference to the tabletRoot object to the button. - if (tabletRoot) { - button.tabletRoot = tabletRoot; - } else { - button.tabletRoot = parent.parent; - } - - return button; - } - - // called by C++ code when a button should be removed from the tablet - function removeButtonProxy(properties) { - var index = findButtonIndex(properties.uuid); - if (index < 0) { - console.log("Warning: Tablet.qml could not find button with uuid = " + properties.uuid); - } else { - flowMain.children[index].destroy(); - } - } - - Rectangle { - id: bgTopBar - height: 90 - - anchors { - top: parent.top - left: parent.left - right: parent.right - } - - gradient: Gradient { - GradientStop { - position: 0 - color: "#2b2b2b" - } - - GradientStop { - position: 1 - color: "#1e1e1e" - } - } - - HifiAudio.MicBar { - anchors { - left: parent.left - leftMargin: 30 - verticalCenter: parent.verticalCenter - } - } - - Item { - width: 150 - height: 50 - anchors.right: parent.right - anchors.rightMargin: 30 - anchors.verticalCenter: parent.verticalCenter - - ColumnLayout { - anchors.fill: parent - - RalewaySemiBold { - text: Account.loggedIn ? qsTr("Log out") : qsTr("Log in") - horizontalAlignment: Text.AlignRight - anchors.right: parent.right - font.pixelSize: 20 - color: "#afafaf" - } - - RalewaySemiBold { - visible: Account.loggedIn - height: Account.loggedIn ? parent.height/2 - parent.spacing/2 : 0 - text: Account.loggedIn ? "[" + tabletRoot.usernameShort + "]" : "" - horizontalAlignment: Text.AlignRight - anchors.right: parent.right - font.pixelSize: 20 - color: "#afafaf" - } - } - - MouseArea { - anchors.fill: parent - onClicked: { - if (!Account.loggedIn) { - DialogsManager.showLoginDialog() - } else { - Account.logOut() - } - } - } - } - } - - Rectangle { - id: bgMain - gradient: Gradient { - GradientStop { - position: 0 - color: "#2b2b2b" - } - - GradientStop { - position: 1 - color: "#0f212e" - } - } - anchors.bottom: parent.bottom - anchors.bottomMargin: 0 - anchors.right: parent.right - anchors.rightMargin: 0 - anchors.left: parent.left - anchors.leftMargin: 0 - anchors.top: bgTopBar.bottom - anchors.topMargin: 0 - - Flickable { - id: flickable - width: parent.width - height: parent.height - contentWidth: parent.width - contentHeight: flowMain.childrenRect.height + flowMain.anchors.topMargin + flowMain.anchors.bottomMargin + flowMain.spacing - clip: true - Flow { - id: flowMain - spacing: 16 - anchors.right: parent.right - anchors.rightMargin: 30 - anchors.left: parent.left - anchors.leftMargin: 30 - anchors.bottom: parent.bottom - anchors.bottomMargin: 30 - anchors.top: parent.top - anchors.topMargin: 30 - } - } - } - - function setCurrentItemState(state) { - var index = rowIndex + columnIndex; - - if (index >= 0 && index <= count ) { - flowMain.children[index].state = state; - } - } - - function nextItem() { - setCurrentItemState("base state"); - var nextColumnIndex = (columnIndex + 3 + 1) % 3; - var nextIndex = rowIndex + nextColumnIndex; - if(nextIndex <= count) { - columnIndex = nextColumnIndex; - }; - setCurrentItemState("hover state"); - } - - function previousItem() { - setCurrentItemState("base state"); - var prevIndex = (columnIndex + 3 - 1) % 3; - if((rowIndex + prevIndex) <= count){ - columnIndex = prevIndex; - } - setCurrentItemState("hover state"); - } - - function upItem() { - setCurrentItemState("base state"); - rowIndex = rowIndex - 3; - if (rowIndex < 0 ) { - rowIndex = (count - (count % 3)); - var index = rowIndex + columnIndex; - if(index > count) { - rowIndex = rowIndex - 3; - } - } - setCurrentItemState("hover state"); - } - - function downItem() { - setCurrentItemState("base state"); - rowIndex = rowIndex + 3; - var index = rowIndex + columnIndex; - if (index > count ) { - rowIndex = 0; - } - setCurrentItemState("hover state"); - } - - function selectItem() { - flowMain.children[rowIndex + columnIndex].clicked(); - if (tabletRoot) { - tabletRoot.playButtonClickSound(); - } - } - - Keys.onRightPressed: nextItem(); - Keys.onLeftPressed: previousItem(); - Keys.onDownPressed: downItem(); - Keys.onUpPressed: upItem(); - Keys.onReturnPressed: selectItem(); -} diff --git a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml index 4d9a83817a..3242de89b1 100644 --- a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml +++ b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml @@ -72,7 +72,7 @@ StackView { addressLine.focus = !HMD.active; root.parentChanged.connect(center); center(); - tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); } Component.onDestruction: { root.parentChanged.disconnect(center); @@ -149,7 +149,7 @@ StackView { onClicked: { addressBarDialog.loadHome(); tabletRoot.shown = false; - tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); tablet.gotoHomeScreen(); } anchors { diff --git a/interface/resources/qml/hifi/tablet/TabletAttachmentsDialog.qml b/interface/resources/qml/hifi/tablet/TabletAttachmentsDialog.qml index 19548365aa..14d7d09dba 100644 --- a/interface/resources/qml/hifi/tablet/TabletAttachmentsDialog.qml +++ b/interface/resources/qml/hifi/tablet/TabletAttachmentsDialog.qml @@ -37,7 +37,7 @@ Item { } function closeDialog() { - Tablet.getTablet("com.highfidelity.interface.tablet.system").gotoHomeScreen(); + Tablets.getTablet("com.highfidelity.interface.tablet.system").gotoHomeScreen(); } anchors.topMargin: hifi.dimensions.tabletMenuHeader // Space for header. diff --git a/interface/resources/qml/hifi/tablet/TabletButton.qml b/interface/resources/qml/hifi/tablet/TabletButton.qml index 169c7acec1..3a66738b82 100644 --- a/interface/resources/qml/hifi/tablet/TabletButton.qml +++ b/interface/resources/qml/hifi/tablet/TabletButton.qml @@ -121,7 +121,6 @@ Item { enabled: true preventStealing: true onClicked: { - console.log("Tablet Button Clicked!"); if (tabletButton.inDebugMode) { if (tabletButton.isActive) { tabletButton.isActive = false; @@ -131,12 +130,12 @@ Item { } tabletButton.clicked(); if (tabletRoot) { - tabletInterface.playSound(TabletEnums.ButtonClick); + Tablets.playSound(TabletEnums.ButtonClick); } } onEntered: { tabletButton.isEntered = true; - tabletInterface.playSound(TabletEnums.ButtonHover); + Tablets.playSound(TabletEnums.ButtonHover); if (tabletButton.isActive) { tabletButton.state = "hover active state"; diff --git a/interface/resources/qml/hifi/tablet/TabletHome.qml b/interface/resources/qml/hifi/tablet/TabletHome.qml new file mode 100644 index 0000000000..0b30496c44 --- /dev/null +++ b/interface/resources/qml/hifi/tablet/TabletHome.qml @@ -0,0 +1,159 @@ +import QtQuick 2.5 +import QtGraphicalEffects 1.0 +import QtQuick.Layouts 1.3 + +import "." +import "../../styles-uit" +import "../audio" as HifiAudio + +Item { + id: tablet + objectName: "tablet" + property var tabletProxy: Tablets.getTablet("com.highfidelity.interface.tablet.system"); + + Rectangle { + id: bgTopBar + height: 90 + + anchors { + top: parent.top + left: parent.left + right: parent.right + } + + gradient: Gradient { + GradientStop { + position: 0 + color: "#2b2b2b" + } + + GradientStop { + position: 1 + color: "#1e1e1e" + } + } + + HifiAudio.MicBar { + anchors { + left: parent.left + leftMargin: 30 + verticalCenter: parent.verticalCenter + } + } + + Item { + width: 150 + height: 50 + anchors.right: parent.right + anchors.rightMargin: 30 + anchors.verticalCenter: parent.verticalCenter + + ColumnLayout { + anchors.fill: parent + + RalewaySemiBold { + text: Account.loggedIn ? qsTr("Log out") : qsTr("Log in") + horizontalAlignment: Text.AlignRight + anchors.right: parent.right + font.pixelSize: 20 + color: "#afafaf" + } + + RalewaySemiBold { + visible: Account.loggedIn + height: Account.loggedIn ? parent.height/2 - parent.spacing/2 : 0 + text: Account.loggedIn ? "[" + tabletRoot.usernameShort + "]" : "" + horizontalAlignment: Text.AlignRight + anchors.right: parent.right + font.pixelSize: 20 + color: "#afafaf" + } + } + + MouseArea { + anchors.fill: parent + onClicked: { + if (!Account.loggedIn) { + DialogsManager.showLoginDialog() + } else { + Account.logOut() + } + } + } + } + } + + Rectangle { + id: bgMain + clip: true + gradient: Gradient { + GradientStop { + position: 0 + color: "#2b2b2b" + } + + GradientStop { + position: 1 + color: "#0f212e" + } + } + anchors.bottom: parent.bottom + anchors.right: parent.right + anchors.left: parent.left + anchors.top: bgTopBar.bottom + + GridView { + id: flickable + anchors.top: parent.top + anchors.topMargin: 15 + anchors.bottom: parent.bottom + anchors.horizontalCenter: parent.horizontalCenter + width: cellWidth * 3 + cellHeight: 145 + cellWidth: 145 + model: tabletProxy.buttons + delegate: Item { + width: flickable.cellWidth + height: flickable.cellHeight + property var proxy: modelData + + TabletButton { + id: tabletButton + anchors.centerIn: parent + onClicked: modelData.clicked() + state: wrapper.GridView.isCurrentItem ? "hover state" : "base state" + } + + Connections { + target: modelData; + onPropertiesChanged: { + updateProperties(); + } + } + + Component.onCompleted: updateProperties() + + function updateProperties() { + var keys = Object.keys(modelData.properties).forEach(function (key) { + if (tabletButton[key] !== modelData.properties[key]) { + tabletButton[key] = modelData.properties[key]; + } + }); + } + } + } + } + + Keys.onRightPressed: flickable.moveCurrentIndexRight(); + Keys.onLeftPressed: flickable.moveCurrentIndexLeft(); + Keys.onDownPressed: flickable.moveCurrentIndexDown(); + Keys.onUpPressed: flickable.moveCurrentIndexUp(); + Keys.onReturnPressed: { + if (flickable.currentItem) { + flickable.currentItem.proxy.clicked(); + if (tabletRoot) { + tabletRoot.playButtonClickSound(); + } + } + } +} diff --git a/interface/resources/qml/hifi/tablet/TabletMenuView.qml b/interface/resources/qml/hifi/tablet/TabletMenuView.qml index 4a4a6b7f87..e069ce8cb1 100644 --- a/interface/resources/qml/hifi/tablet/TabletMenuView.qml +++ b/interface/resources/qml/hifi/tablet/TabletMenuView.qml @@ -77,12 +77,12 @@ FocusScope { anchors.fill: parent hoverEnabled: true onEntered: { - tabletInterface.playSound(TabletEnums.ButtonHover); + Tablets.playSound(TabletEnums.ButtonHover); listView.currentIndex = index } onClicked: { - tabletInterface.playSound(TabletEnums.ButtonClick); + Tablets.playSound(TabletEnums.ButtonClick); root.selected(item); } } diff --git a/interface/resources/qml/hifi/tablet/tabletWindows/TabletPreferencesDialog.qml b/interface/resources/qml/hifi/tablet/tabletWindows/TabletPreferencesDialog.qml index fcb3e9ff92..0665b9971e 100644 --- a/interface/resources/qml/hifi/tablet/tabletWindows/TabletPreferencesDialog.qml +++ b/interface/resources/qml/hifi/tablet/tabletWindows/TabletPreferencesDialog.qml @@ -56,7 +56,7 @@ Item { } function closeDialog() { - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); if (gotoPreviousApp) { tablet.returnToPreviousApp(); @@ -206,7 +206,7 @@ Item { } Component.onCompleted: { - tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); keyboardEnabled = HMD.active; } diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 929184fc14..30d93482f8 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2214,12 +2214,12 @@ extern void setupPreferences(); void Application::initializeUi() { // Make sure all QML surfaces share the main thread GL context OffscreenQmlSurface::setSharedContext(_offscreenContext->getContext()); - OffscreenQmlSurface::addWhitelistContextHandler(QUrl{ "qrc:///qml/OverlayWindowTest.qml" }, + OffscreenQmlSurface::addWhitelistContextHandler(QUrl{ "OverlayWindowTest.qml" }, [](QQmlContext* context) { qDebug() << "Whitelist OverlayWindow worked"; context->setContextProperty("OverlayWindowTestString", "TestWorked"); }); - OffscreenQmlSurface::addWhitelistContextHandler(QUrl{ "qrc:///qml/hifi/audio/Audio.qml" }, + OffscreenQmlSurface::addWhitelistContextHandler(QUrl{ "hifi/audio/Audio.qml" }, [](QQmlContext* context) { qDebug() << "QQQ" << __FUNCTION__ << "Whitelist Audio worked"; }); @@ -2310,9 +2310,6 @@ void Application::initializeUi() { surfaceContext->setContextProperty("InputConfiguration", DependencyManager::get().data()); surfaceContext->setContextProperty("Account", AccountScriptingInterface::getInstance()); - surfaceContext->setContextProperty("Tablet", DependencyManager::get().data()); - // Tablet inteference with Tablet.qml. Need to avoid this in QML space - surfaceContext->setContextProperty("tabletInterface", DependencyManager::get().data()); surfaceContext->setContextProperty("DialogsManager", _dialogsManagerScriptingInterface); surfaceContext->setContextProperty("GlobalServices", GlobalServicesScriptingInterface::getInstance()); surfaceContext->setContextProperty("FaceTracker", DependencyManager::get().data()); @@ -5807,7 +5804,8 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe qScriptRegisterMetaType(scriptEngine.data(), wrapperToScriptValue, wrapperFromScriptValue); qScriptRegisterMetaType(scriptEngine.data(), wrapperToScriptValue, wrapperFromScriptValue); - // Tablet inteference with Tablet.qml. Need to avoid this in QML space + scriptEngine->registerGlobalObject("Tablets", DependencyManager::get().data()); + // FIXME remove these deprecated names for the tablet scripting interface scriptEngine->registerGlobalObject("tabletInterface", DependencyManager::get().data()); scriptEngine->registerGlobalObject("Tablet", DependencyManager::get().data()); diff --git a/interface/src/ui/overlays/Web3DOverlay.cpp b/interface/src/ui/overlays/Web3DOverlay.cpp index d418a79fbf..07a953c219 100644 --- a/interface/src/ui/overlays/Web3DOverlay.cpp +++ b/interface/src/ui/overlays/Web3DOverlay.cpp @@ -209,7 +209,6 @@ void Web3DOverlay::setupQmlSurface() { _webSurface->getSurfaceContext()->setContextProperty("fileDialogHelper", new FileDialogHelper()); _webSurface->getSurfaceContext()->setContextProperty("MyAvatar", DependencyManager::get()->getMyAvatar().get()); _webSurface->getSurfaceContext()->setContextProperty("ScriptDiscoveryService", DependencyManager::get().data()); - _webSurface->getSurfaceContext()->setContextProperty("Tablet", DependencyManager::get().data()); _webSurface->getSurfaceContext()->setContextProperty("Assets", DependencyManager::get().data()); _webSurface->getSurfaceContext()->setContextProperty("LODManager", DependencyManager::get().data()); _webSurface->getSurfaceContext()->setContextProperty("OctreeStats", DependencyManager::get().data()); @@ -228,9 +227,6 @@ void Web3DOverlay::setupQmlSurface() { _webSurface->getSurfaceContext()->setContextProperty("pathToFonts", "../../"); - // Tablet inteference with Tablet.qml. Need to avoid this in QML space - _webSurface->getSurfaceContext()->setContextProperty("tabletInterface", DependencyManager::get().data()); - tabletScriptingInterface->setQmlTabletRoot("com.highfidelity.interface.tablet.system", _webSurface.data()); // mark the TabletProxy object as cpp ownership. QObject* tablet = tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"); diff --git a/libraries/model-networking/src/model-networking/TextureCache.cpp b/libraries/model-networking/src/model-networking/TextureCache.cpp index 4184351c2d..092afe1a90 100644 --- a/libraries/model-networking/src/model-networking/TextureCache.cpp +++ b/libraries/model-networking/src/model-networking/TextureCache.cpp @@ -217,8 +217,6 @@ gpu::TexturePointer TextureCache::cacheTextureByHash(const std::string& hash, co if (!result) { _texturesByHashes[hash] = texture; result = texture; - } else { - qCWarning(modelnetworking) << "QQQ Swapping out texture with previous live texture in hash " << hash.c_str(); } } return result; diff --git a/libraries/octree/src/Octree.cpp b/libraries/octree/src/Octree.cpp index 7563122290..3190f25d7e 100644 --- a/libraries/octree/src/Octree.cpp +++ b/libraries/octree/src/Octree.cpp @@ -9,10 +9,6 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifdef _WIN32 -#define _USE_MATH_DEFINES -#endif - #include #include #include diff --git a/libraries/shared/src/PathUtils.cpp b/libraries/shared/src/PathUtils.cpp index 46613f1283..00a11ef06c 100644 --- a/libraries/shared/src/PathUtils.cpp +++ b/libraries/shared/src/PathUtils.cpp @@ -24,9 +24,30 @@ const QString& PathUtils::resourcesPath() { #ifdef Q_OS_MAC - static QString staticResourcePath = QCoreApplication::applicationDirPath() + "/../Resources/"; + static const QString staticResourcePath = QCoreApplication::applicationDirPath() + "/../Resources/"; #else - static QString staticResourcePath = QCoreApplication::applicationDirPath() + "/resources/"; + static const QString staticResourcePath = QCoreApplication::applicationDirPath() + "/resources/"; +#endif + return staticResourcePath; +} + +#ifdef DEV_BUILD +const QString& PathUtils::projectRootPath() { + static QString sourceFolder; + static std::once_flag once; + std::call_once(once, [&] { + QDir thisDir = QFileInfo(__FILE__).absoluteDir(); + sourceFolder = QDir::cleanPath(thisDir.absoluteFilePath("../../../")); + }); + return sourceFolder; +} +#endif + +const QString& PathUtils::qmlBasePath() { +#ifdef DEV_BUILD + static const QString staticResourcePath = QUrl::fromLocalFile(projectRootPath() + "/interface/resources/qml/").toString(); +#else + static const QString staticResourcePath = "qrc:///qml/"; #endif return staticResourcePath; diff --git a/libraries/shared/src/PathUtils.h b/libraries/shared/src/PathUtils.h index 8c4bcf2394..9b5b6ef67f 100644 --- a/libraries/shared/src/PathUtils.h +++ b/libraries/shared/src/PathUtils.h @@ -30,6 +30,10 @@ class PathUtils : public QObject, public Dependency { Q_PROPERTY(QUrl defaultScripts READ defaultScriptsLocation CONSTANT) public: static const QString& resourcesPath(); + static const QString& qmlBasePath(); +#ifdef DEV_BUILD + static const QString& projectRootPath(); +#endif static QString getAppDataPath(); static QString getAppLocalDataPath(); diff --git a/libraries/ui/src/ui/OffscreenQmlSurface.cpp b/libraries/ui/src/ui/OffscreenQmlSurface.cpp index 8711e52eff..aab89ccd4d 100644 --- a/libraries/ui/src/ui/OffscreenQmlSurface.cpp +++ b/libraries/ui/src/ui/OffscreenQmlSurface.cpp @@ -48,6 +48,7 @@ #include "types/SoundEffect.h" #include "TabletScriptingInterface.h" +#include "ToolbarScriptingInterface.h" #include "Logging.h" Q_LOGGING_CATEGORY(trace_render_qml, "trace.render.qml") @@ -62,7 +63,10 @@ public: void addWhitelistContextHandler(const std::initializer_list& urls, const QmlContextCallback& callback) { withWriteLock([&] { - for (const auto& url : urls) { + for (auto url : urls) { + if (url.isRelative()) { + url = QUrl(PathUtils::qmlBasePath() + url.toString()); + } _callbacks[url].push_back(callback); } }); @@ -382,6 +386,13 @@ void initializeQmlEngine(QQmlEngine* engine, QQuickWindow* window) { rootContext->setContextProperty("FileTypeProfile", new FileTypeProfile(rootContext)); rootContext->setContextProperty("HFWebEngineProfile", new HFWebEngineProfile(rootContext)); rootContext->setContextProperty("Paths", DependencyManager::get().data()); + static std::once_flag once; + std::call_once(once, [&] { + qRegisterMetaType(); + qRegisterMetaType(); + }); + rootContext->setContextProperty("Tablets", DependencyManager::get().data()); + rootContext->setContextProperty("Toolbars", DependencyManager::get().data()); } QQmlEngine* acquireEngine(QQuickWindow* window) { @@ -587,7 +598,7 @@ void OffscreenQmlSurface::create() { auto qmlEngine = acquireEngine(_quickWindow); _qmlContext = new QQmlContext(qmlEngine->rootContext()); - _qmlContext->setBaseUrl(QUrl{ "qrc:///qml/" }); + _qmlContext->setBaseUrl(QUrl{ PathUtils::qmlBasePath() }); _qmlContext->setContextProperty("offscreenWindow", QVariant::fromValue(getWindow())); _qmlContext->setContextProperty("eventBridge", this); _qmlContext->setContextProperty("webEntity", this); @@ -715,7 +726,6 @@ void OffscreenQmlSurface::load(const QUrl& qmlSource, bool createNewContext, con } void OffscreenQmlSurface::loadInternal(const QUrl& qmlSource, bool createNewContext, QQuickItem* parent, const QmlContextObjectCallback& onQmlLoadedCallback) { - qCDebug(uiLogging) << "QQQ" << __FUNCTION__ << qmlSource; if (QThread::currentThread() != thread()) { qCWarning(uiLogging) << "Called load on a non-surface thread"; } @@ -725,7 +735,6 @@ void OffscreenQmlSurface::loadInternal(const QUrl& qmlSource, bool createNewCont QUrl finalQmlSource = qmlSource; if ((qmlSource.isRelative() && !qmlSource.isEmpty()) || qmlSource.scheme() == QLatin1String("file")) { finalQmlSource = _qmlContext->resolvedUrl(qmlSource); - qCDebug(uiLogging) << "QQQ" << __FUNCTION__ << "resolved to " << finalQmlSource; } auto targetContext = contextForUrl(finalQmlSource, createNewContext); diff --git a/libraries/ui/src/ui/TabletScriptingInterface.cpp b/libraries/ui/src/ui/TabletScriptingInterface.cpp index 7440d0b5d0..93d493539e 100644 --- a/libraries/ui/src/ui/TabletScriptingInterface.cpp +++ b/libraries/ui/src/ui/TabletScriptingInterface.cpp @@ -210,7 +210,7 @@ QObject* TabletScriptingInterface::getFlags() { // TabletProxy // -static const char* TABLET_SOURCE_URL = "hifi/tablet/Tablet.qml"; +static const char* TABLET_HOME_SOURCE_URL = "hifi/tablet/TabletHome.qml"; static const char* WEB_VIEW_SOURCE_URL = "hifi/tablet/TabletWebView.qml"; static const char* VRMENU_SOURCE_URL = "hifi/tablet/TabletMenu.qml"; @@ -274,7 +274,7 @@ void TabletProxy::setToolbarMode(bool toolbarMode) { } else { removeButtonsFromToolbar(); - if (_currentPathLoaded == TABLET_SOURCE_URL) { + if (_currentPathLoaded == TABLET_HOME_SOURCE_URL) { // Tablet QML now pulls buttons from Tablet proxy } else { loadHomeScreen(true); @@ -408,7 +408,7 @@ void TabletProxy::setQmlTabletRoot(OffscreenQmlSurface* qmlOffscreenSurface) { }); if (_toolbarMode) { - QMetaObject::invokeMethod(_qmlTabletRoot, "loadSource", Q_ARG(const QVariant&, QVariant(TABLET_SOURCE_URL))); + QMetaObject::invokeMethod(_qmlTabletRoot, "loadSource", Q_ARG(const QVariant&, QVariant(TABLET_HOME_SOURCE_URL))); } // force to the tablet to go to the homescreen @@ -618,7 +618,7 @@ void TabletProxy::loadHomeScreen(bool forceOntoHomeScreen) { if ((_state != State::Home && _state != State::Uninitialized) || forceOntoHomeScreen) { if (!_toolbarMode && _qmlTabletRoot) { - QMetaObject::invokeMethod(_qmlTabletRoot, "loadSource", Q_ARG(const QVariant&, QVariant(TABLET_SOURCE_URL))); + QMetaObject::invokeMethod(_qmlTabletRoot, "loadSource", Q_ARG(const QVariant&, QVariant(TABLET_HOME_SOURCE_URL))); QMetaObject::invokeMethod(_qmlTabletRoot, "playButtonClickSound"); } else if (_toolbarMode && _desktopWindow) { // close desktop window @@ -627,8 +627,8 @@ void TabletProxy::loadHomeScreen(bool forceOntoHomeScreen) { } } _state = State::Home; - emit screenChanged(QVariant("Home"), QVariant(TABLET_SOURCE_URL)); - _currentPathLoaded = TABLET_SOURCE_URL; + emit screenChanged(QVariant("Home"), QVariant(TABLET_HOME_SOURCE_URL)); + _currentPathLoaded = TABLET_HOME_SOURCE_URL; } } diff --git a/scripts/developer/EZrecord.js b/scripts/developer/EZrecord.js index 7fdebada79..3cfc6e9928 100644 --- a/scripts/developer/EZrecord.js +++ b/scripts/developer/EZrecord.js @@ -227,14 +227,14 @@ } function setUp() { - tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); if (!tablet) { return; } Recorder.setUp(); - // Tablet/toolbar button. + // tablet/toolbar button. button = tablet.addButton({ icon: APP_ICON_INACTIVE, activeIcon: APP_ICON_ACTIVE, diff --git a/scripts/developer/inputRecording.js b/scripts/developer/inputRecording.js index 6fb8e471cd..574cbbeb3d 100644 --- a/scripts/developer/inputRecording.js +++ b/scripts/developer/inputRecording.js @@ -10,7 +10,7 @@ var recording = false; var onRecordingScreen = false; var passedSaveDirectory = false; - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var button = tablet.addButton({ text: "IRecord" }); diff --git a/scripts/developer/tests/dynamics/dynamicsTests.js b/scripts/developer/tests/dynamics/dynamicsTests.js index c0b001eab3..be22e2c5fb 100644 --- a/scripts/developer/tests/dynamics/dynamicsTests.js +++ b/scripts/developer/tests/dynamics/dynamicsTests.js @@ -11,14 +11,14 @@ "use strict"; -/* global Entities, Script, Tablet, MyAvatar, Vec3 */ +/* global Entities, Script, Tablets, MyAvatar, Vec3 */ (function() { // BEGIN LOCAL_SCOPE var DYNAMICS_TESTS_URL = Script.resolvePath("dynamics-tests.html"); var DEFAULT_LIFETIME = 120; // seconds - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var button = tablet.addButton({ icon: Script.resolvePath("dynamicsTests.svg"), diff --git a/scripts/developer/tests/puck-attach.js b/scripts/developer/tests/puck-attach.js index 04d5db5710..6971ec02cd 100644 --- a/scripts/developer/tests/puck-attach.js +++ b/scripts/developer/tests/puck-attach.js @@ -19,7 +19,7 @@ Script.include("/~/system/libraries/Xform.js"); var TABLET_BUTTON_NAME = "PUCKTACH"; var TABLET_APP_URL = "https://hifi-content.s3.amazonaws.com/seefo/production/puck-attach/puck-attach.html"; -var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); +var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var tabletButton = tablet.addButton({ text: TABLET_BUTTON_NAME, icon: "https://s3.amazonaws.com/hifi-public/tony/icons/puck-i.svg", diff --git a/scripts/developer/tests/sliderTestMain.js b/scripts/developer/tests/sliderTestMain.js index 22bf4fa911..e7542ef177 100644 --- a/scripts/developer/tests/sliderTestMain.js +++ b/scripts/developer/tests/sliderTestMain.js @@ -1,6 +1,6 @@ (function () { var HTML_URL = Script.resolvePath("sliderTest.html"); - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var button = tablet.addButton({ text: "SLIDER" }); diff --git a/scripts/developer/tests/tabletEventBridgeTest.js b/scripts/developer/tests/tabletEventBridgeTest.js index 83031741fc..3f988303f2 100644 --- a/scripts/developer/tests/tabletEventBridgeTest.js +++ b/scripts/developer/tests/tabletEventBridgeTest.js @@ -11,10 +11,10 @@ // Adds a button to the tablet that will switch to a web page. // This web page contains buttons that will use the event bridge to trigger sounds. -/* globals Tablet */ +/* globals Tablets */ -var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); +var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var tabletButton = tablet.addButton({ text: "SOUNDS", icon: "http://s3.amazonaws.com/hifi-public/tony/icons/trombone-i.png", diff --git a/scripts/developer/tests/tabletTest.js b/scripts/developer/tests/tabletTest.js index 438d0a4b99..9c1ce0e3bd 100644 --- a/scripts/developer/tests/tabletTest.js +++ b/scripts/developer/tests/tabletTest.js @@ -10,7 +10,7 @@ // Adds a BAM! button to the tablet ui. -var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); +var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var button = tablet.addButton({ text: "BAM!!!" }); diff --git a/scripts/developer/utilities/audio/stats.js b/scripts/developer/utilities/audio/stats.js index 382e14df5f..a828d79340 100644 --- a/scripts/developer/utilities/audio/stats.js +++ b/scripts/developer/utilities/audio/stats.js @@ -10,7 +10,7 @@ // if (HMD.active && !Settings.getValue("HUDUIEnabled")) { - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var qml = Script.resolvePath("TabletStats.qml"); tablet.loadQMLSource(qml); Script.stop(); diff --git a/scripts/developer/utilities/render/luci.js b/scripts/developer/utilities/render/luci.js index 1e2ac1261f..b2203ce72f 100644 --- a/scripts/developer/utilities/render/luci.js +++ b/scripts/developer/utilities/render/luci.js @@ -27,7 +27,7 @@ } } - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var button = tablet.addButton({ text: TABLET_BUTTON_NAME, icon: ICON_URL, diff --git a/scripts/developer/utilities/render/photobooth/photoboothApp.js b/scripts/developer/utilities/render/photobooth/photoboothApp.js index 154028f091..375a98e543 100644 --- a/scripts/developer/utilities/render/photobooth/photoboothApp.js +++ b/scripts/developer/utilities/render/photobooth/photoboothApp.js @@ -8,7 +8,7 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -/* globals Tablet, Toolbars, Script, HMD, Controller, Menu */ +/* globals Tablets, Toolbars, Script, HMD, Controller, Menu */ (function () { var SNAPSHOT_DELAY = 500; // 500ms var PHOTOBOOTH_WINDOW_HTML_URL = Script.resolvePath("./html/photobooth.html"); @@ -16,7 +16,7 @@ var MODEL_BOUNDING_BOX_DIMENSIONS = {x: 1.0174,y: 1.1925,z: 1.0165}; var PhotoBooth = {}; var photoboothCreated = false; - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var button = tablet.addButton({ icon: "icons/tablet-icons/snap-i.svg", text: "PHOTOBOOTH" diff --git a/scripts/system/audio.js b/scripts/system/audio.js index a93177ca38..ea0626a30c 100644 --- a/scripts/system/audio.js +++ b/scripts/system/audio.js @@ -54,7 +54,7 @@ function onScreenChanged(type, url) { button.editProperties({isActive: onAudioScreen}); } -var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); +var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var button = tablet.addButton({ icon: Audio.muted ? MUTE_ICONS.icon : UNMUTE_ICONS.icon, activeIcon: Audio.muted ? MUTE_ICONS.activeIcon : UNMUTE_ICONS.activeIcon, diff --git a/scripts/system/audioMuteOverlay.js b/scripts/system/audioMuteOverlay.js index 731d62017d..0db4edb85d 100644 --- a/scripts/system/audioMuteOverlay.js +++ b/scripts/system/audioMuteOverlay.js @@ -1,6 +1,6 @@ "use strict"; /* jslint vars: true, plusplus: true, forin: true*/ -/* globals Tablet, Script, AvatarList, Users, Entities, MyAvatar, Camera, Overlays, Vec3, Quat, Controller, print, getControllerWorldLocation */ +/* globals Tablets, Script, AvatarList, Users, Entities, MyAvatar, Camera, Overlays, Vec3, Quat, Controller, print, getControllerWorldLocation */ /* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */ // // audioMuteOverlay.js diff --git a/scripts/system/audioScope.js b/scripts/system/audioScope.js index 81d8e8fbd4..268c883983 100644 --- a/scripts/system/audioScope.js +++ b/scripts/system/audioScope.js @@ -9,7 +9,7 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -/* global Script, Tablet, AudioScope, Audio */ +/* global Script, Tablets, AudioScope, Audio */ (function () { // BEGIN LOCAL_SCOPE @@ -17,7 +17,7 @@ var scopePaused = AudioScope.getPause(); var autoPause = false; - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var showScopeButton = tablet.addButton({ icon: "icons/tablet-icons/scope.svg", text: "Audio Scope", diff --git a/scripts/system/bubble.js b/scripts/system/bubble.js index 4ea684ff06..2b6924d84f 100644 --- a/scripts/system/bubble.js +++ b/scripts/system/bubble.js @@ -183,7 +183,7 @@ // Setup the bubble button var buttonName = "BUBBLE"; - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); button = tablet.addButton({ icon: "icons/tablet-icons/bubble-i.svg", activeIcon: "icons/tablet-icons/bubble-a.svg", diff --git a/scripts/system/chat.js b/scripts/system/chat.js index fa997e20cc..220c87195a 100644 --- a/scripts/system/chat.js +++ b/scripts/system/chat.js @@ -19,7 +19,7 @@ var tabletButtonIcon = "icons/tablet-icons/menu-i.svg"; // Icon for chat button. var tabletButtonActiveIcon = "icons/tablet-icons/menu-a.svg"; // Active icon for chat button. var tabletButton = null; // The button we create in the tablet. - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); // The awesome tablet. + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); // The awesome tablet. var chatLog = []; // Array of chat messages in the form of [avatarID, displayName, message, data]. var avatarIdentifiers = {}; // Map of avatar ids to dict of identifierParams. var speechBubbleShowing = false; // Is the speech bubble visible? diff --git a/scripts/system/commerce/wallet.js b/scripts/system/commerce/wallet.js index 9b2367b762..7f05dcf3d8 100644 --- a/scripts/system/commerce/wallet.js +++ b/scripts/system/commerce/wallet.js @@ -148,7 +148,7 @@ var walletEnabled = Settings.getValue("commerce", false); function startup() { if (walletEnabled) { - tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); button = tablet.addButton({ text: buttonName, icon: "icons/tablet-icons/wallet-i.svg", diff --git a/scripts/system/controllers/godView.js b/scripts/system/controllers/godView.js index 4b406399fd..eb38308cb9 100644 --- a/scripts/system/controllers/godView.js +++ b/scripts/system/controllers/godView.js @@ -9,7 +9,7 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -/* globals HMD, Script, Menu, Tablet, Camera */ +/* globals HMD, Script, Menu, Tablets, Camera */ /* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */ (function() { // BEGIN LOCAL_SCOPE @@ -81,7 +81,7 @@ function endGodView() { } var button; -var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); +var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); function onClicked() { if (godView) { diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 2bbd422c65..abd69e2697 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -11,7 +11,7 @@ // /* global Script, SelectionDisplay, LightOverlayManager, CameraManager, Grid, GridTool, EntityListTool, Vec3, SelectionManager, Overlays, OverlayWebWindow, UserActivityLogger, - Settings, Entities, Tablet, Toolbars, Messages, Menu, Camera, progressDialog, tooltip, MyAvatar, Quat, Controller, Clipboard, HMD, UndoStack, ParticleExplorerTool */ + Settings, Entities, Tablets, Toolbars, Messages, Menu, Camera, progressDialog, tooltip, MyAvatar, Quat, Controller, Clipboard, HMD, UndoStack, ParticleExplorerTool */ (function() { // BEGIN LOCAL_SCOPE @@ -390,7 +390,7 @@ var toolBar = (function () { } function fromQml(message) { // messages are {method, params}, like json-rpc. See also sendToQml. - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); tablet.popFromStack(); switch (message.method) { case "newModelDialogAdd": @@ -417,7 +417,7 @@ var toolBar = (function () { var hasRezPermissions = (Entities.canRez() || Entities.canRezTmp() || Entities.canRezCertified() || Entities.canRezTmpCertified()); var createButtonIconRsrc = (hasRezPermissions ? CREATE_ENABLED_ICON : CREATE_DISABLED_ICON); - tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); activeButton = tablet.addButton({ captionColorOverride: hasRezPermissions ? "" : "#888888", icon: createButtonIconRsrc, @@ -463,7 +463,7 @@ var toolBar = (function () { var SHAPE_TYPE_DEFAULT = SHAPE_TYPE_STATIC_MESH; // tablet version of new-model dialog - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); tablet.pushOntoStack("NewModelDialog.qml"); }); @@ -644,7 +644,7 @@ var toolBar = (function () { isActive = active; activeButton.editProperties({isActive: isActive}); - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); if (!isActive) { entityListTool.setVisible(false); @@ -1850,7 +1850,7 @@ var PropertiesTool = function (opts) { var that = {}; var webView = null; - webView = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + webView = Tablets.getTablet("com.highfidelity.interface.tablet.system"); webView.setVisible = function(value) {}; var visible = false; @@ -2293,7 +2293,7 @@ function selectParticleEntity(entityID) { particleExplorerTool.webView.emitScriptEvent(JSON.stringify(particleData)); // Switch to particle explorer - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); tablet.sendToQml({method: 'selectTab', params: {id: 'particle'}}); } diff --git a/scripts/system/fingerPaint.js b/scripts/system/fingerPaint.js index 88245503e8..ad4973890b 100644 --- a/scripts/system/fingerPaint.js +++ b/scripts/system/fingerPaint.js @@ -414,12 +414,12 @@ } function setUp() { - tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); if (!tablet) { return; } - // Tablet button. + // Tablets button. button = tablet.addButton({ icon: "icons/tablet-icons/finger-paint-i.svg", activeIcon: "icons/tablet-icons/finger-paint-a.svg", diff --git a/scripts/system/generalSettings.js b/scripts/system/generalSettings.js index 082528ffc5..8a9001107a 100644 --- a/scripts/system/generalSettings.js +++ b/scripts/system/generalSettings.js @@ -10,7 +10,7 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -/* globals Tablet, Toolbars, Script, HMD, DialogsManager */ +/* globals Tablets, Toolbars, Script, HMD, DialogsManager */ (function() { // BEGIN LOCAL_SCOPE @@ -34,7 +34,7 @@ alpha: 0.9 }); } else { - tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); button = tablet.addButton({ icon: "icons/tablet-icons/goto-i.svg", text: buttonName, diff --git a/scripts/system/goto.js b/scripts/system/goto.js index d364bf579e..31394c8750 100644 --- a/scripts/system/goto.js +++ b/scripts/system/goto.js @@ -10,7 +10,7 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -/* globals Tablet, Toolbars, Script, HMD, DialogsManager */ +/* globals Tablets, Toolbars, Script, HMD, DialogsManager */ (function() { // BEGIN LOCAL_SCOPE @@ -37,7 +37,7 @@ if (Settings.getValue("HUDUIEnabled")) { alpha: 0.9 }); } else { - tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); button = tablet.addButton({ icon: "icons/tablet-icons/goto-i.svg", activeIcon: "icons/tablet-icons/goto-a.svg", diff --git a/scripts/system/help.js b/scripts/system/help.js index 9ab7fa3fb3..5687c8961f 100644 --- a/scripts/system/help.js +++ b/scripts/system/help.js @@ -10,14 +10,14 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -/* globals Tablet, Script, HMD, Controller, Menu */ +/* globals Tablets, Script, HMD, Controller, Menu */ (function() { // BEGIN LOCAL_SCOPE var HOME_BUTTON_TEXTURE = Script.resourcesPath() + "meshes/tablet-with-home-button.fbx/tablet-with-home-button.fbm/button-root.png"; var buttonName = "HELP"; var onHelpScreen = false; - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var button = tablet.addButton({ icon: "icons/tablet-icons/help-i.svg", activeIcon: "icons/tablet-icons/help-a.svg", diff --git a/scripts/system/hmd.js b/scripts/system/hmd.js index b9fd7f725c..a86bbd9a62 100644 --- a/scripts/system/hmd.js +++ b/scripts/system/hmd.js @@ -10,7 +10,7 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -/* globals HMD, Script, Menu, Tablet, Camera */ +/* globals HMD, Script, Menu, Tablets, Camera */ /* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */ (function() { // BEGIN LOCAL_SCOPE @@ -38,7 +38,7 @@ function updateControllerDisplay() { } var button; -var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); +var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); // Independent and Entity mode make people sick; disable them in hmd. var desktopOnlyViews = ['Independent Mode', 'Entity Mode']; diff --git a/scripts/system/libraries/WebTablet.js b/scripts/system/libraries/WebTablet.js index c46cfaa073..cd7c575205 100644 --- a/scripts/system/libraries/WebTablet.js +++ b/scripts/system/libraries/WebTablet.js @@ -7,7 +7,7 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -/* global getControllerWorldLocation, Tablet, WebTablet:true, HMD, Settings, Script, +/* global getControllerWorldLocation, Tablets, WebTablet:true, HMD, Settings, Script, Vec3, Quat, MyAvatar, Entities, Overlays, Camera, Messages, Xform, clamp, Controller, Mat4, resizeTablet */ Script.include(Script.resolvePath("../libraries/utils.js")); @@ -168,7 +168,7 @@ WebTablet = function (url, width, dpi, hand, clientOnly, location, visible) { this.receive = function (channel, senderID, senderUUID, localOnly) { if (_this.homeButtonID == senderID) { - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var onHomeScreen = tablet.onHomeScreen(); var isMessageOpen; if (onHomeScreen) { @@ -513,7 +513,7 @@ WebTablet.prototype.mousePressEvent = function (event) { entityPickResults.overlayID === this.tabletEntityID)) { var overlayPickResults = Overlays.findRayIntersection(pickRay, true, [this.webOverlayID, this.homeButtonID], []); if (overlayPickResults.intersects && overlayPickResults.overlayID === this.homeButtonID) { - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var onHomeScreen = tablet.onHomeScreen(); var isMessageOpen = tablet.isMessageDialogOpen(); if (onHomeScreen) { diff --git a/scripts/system/libraries/entityList.js b/scripts/system/libraries/entityList.js index 9d9689000e..a1f5d31a1a 100644 --- a/scripts/system/libraries/entityList.js +++ b/scripts/system/libraries/entityList.js @@ -8,14 +8,14 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -/* global EntityListTool, Tablet, selectionManager, Entities, Camera, MyAvatar, Vec3, Menu, Messages, +/* global EntityListTool, Tablets, selectionManager, Entities, Camera, MyAvatar, Vec3, Menu, Messages, cameraManager, MENU_EASE_ON_FOCUS, deleteSelectedEntities, toggleSelectedEntitiesLocked, toggleSelectedEntitiesVisible */ EntityListTool = function(opts) { var that = {}; var webView = null; - webView = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + webView = Tablets.getTablet("com.highfidelity.interface.tablet.system"); webView.setVisible = function(value) {}; var filterInView = false; diff --git a/scripts/system/libraries/gridTool.js b/scripts/system/libraries/gridTool.js index 2c417a9dde..41cbc59502 100644 --- a/scripts/system/libraries/gridTool.js +++ b/scripts/system/libraries/gridTool.js @@ -237,7 +237,7 @@ GridTool = function(opts) { var listeners = []; var webView = null; - webView = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + webView = Tablets.getTablet("com.highfidelity.interface.tablet.system"); webView.setVisible = function(value) {}; horizontalGrid.addListener(function(data) { diff --git a/scripts/system/libraries/utils.js b/scripts/system/libraries/utils.js index 76c248d880..8ea176bbd4 100644 --- a/scripts/system/libraries/utils.js +++ b/scripts/system/libraries/utils.js @@ -354,7 +354,7 @@ flatten = function(array) { getTabletWidthFromSettings = function () { var DEFAULT_TABLET_WIDTH = 0.4375; - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var toolbarMode = tablet.toolbarMode; var DEFAULT_TABLET_SCALE = 100; var tabletScalePercentage = DEFAULT_TABLET_SCALE; diff --git a/scripts/system/marketplaces/marketplace.js b/scripts/system/marketplaces/marketplace.js index d90695c767..6d6550ecbc 100644 --- a/scripts/system/marketplaces/marketplace.js +++ b/scripts/system/marketplaces/marketplace.js @@ -82,7 +82,7 @@ function toggleMarketplace() { } } -var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); +var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var browseExamplesButton = tablet.addButton({ icon: "icons/tablet-icons/market-i.svg", diff --git a/scripts/system/marketplaces/marketplaces.js b/scripts/system/marketplaces/marketplaces.js index b427739292..a831d761d2 100644 --- a/scripts/system/marketplaces/marketplaces.js +++ b/scripts/system/marketplaces/marketplaces.js @@ -8,7 +8,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -/* global Tablet, Script, HMD, UserActivityLogger, Entities */ +/* global Tablets, Script, HMD, UserActivityLogger, Entities */ /* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */ (function () { // BEGIN LOCAL_SCOPE @@ -81,7 +81,7 @@ } } - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var marketplaceButton = tablet.addButton({ icon: "icons/tablet-icons/market-i.svg", activeIcon: "icons/tablet-icons/market-a.svg", diff --git a/scripts/system/menu.js b/scripts/system/menu.js index c7a44d3e48..004ece17c3 100644 --- a/scripts/system/menu.js +++ b/scripts/system/menu.js @@ -13,7 +13,7 @@ var HOME_BUTTON_TEXTURE = "http://hifi-content.s3.amazonaws.com/alan/dev/tablet- // var HOME_BUTTON_TEXTURE = Script.resourcesPath() + "meshes/tablet-with-home-button.fbx/tablet-with-home-button.fbm/button-root.png"; (function() { - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var button = tablet.addButton({ icon: "icons/tablet-icons/menu-i.svg", activeIcon: "icons/tablet-icons/menu-a.svg", diff --git a/scripts/system/mod.js b/scripts/system/mod.js index a3b4974f8d..defdb662b3 100644 --- a/scripts/system/mod.js +++ b/scripts/system/mod.js @@ -18,7 +18,7 @@ Script.include("/~/system/libraries/controllers.js"); // grab the toolbar -var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); +var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var ASSETS_PATH = Script.resolvePath("assets"); var TOOLS_PATH = Script.resolvePath("assets/images/tools/"); diff --git a/scripts/system/notifications.js b/scripts/system/notifications.js index b6ddd9d33e..612c0e50e2 100644 --- a/scripts/system/notifications.js +++ b/scripts/system/notifications.js @@ -1,6 +1,6 @@ "use strict"; /*jslint vars:true, plusplus:true, forin:true*/ -/*global Script, Settings, Window, Controller, Overlays, SoundArray, LODManager, MyAvatar, Tablet, Camera, HMD, Menu, Quat, Vec3*/ +/*global Script, Settings, Window, Controller, Overlays, SoundArray, LODManager, MyAvatar, Tablets, Camera, HMD, Menu, Quat, Vec3*/ // // notifications.js // Version 0.801 @@ -696,7 +696,7 @@ Window.announcement.connect(onNotify); Window.notifyEditError = onEditError; Window.notify = onNotify; - Tablet.tabletNotification.connect(tabletNotification); + Tablets.tabletNotification.connect(tabletNotification); Wallet.walletNotSetup.connect(walletNotSetup); Messages.subscribe(NOTIFICATIONS_MESSAGE_CHANNEL); diff --git a/scripts/system/pal.js b/scripts/system/pal.js index 05a7dc8975..26bec518b4 100644 --- a/scripts/system/pal.js +++ b/scripts/system/pal.js @@ -1,6 +1,6 @@ "use strict"; /*jslint vars:true, plusplus:true, forin:true*/ -/*global Tablet, Settings, Script, AvatarList, Users, Entities, MyAvatar, Camera, Overlays, Vec3, Quat, HMD, Controller, Account, UserActivityLogger, Messages, Window, XMLHttpRequest, print, location, getControllerWorldLocation*/ +/*global Tablets, Settings, Script, AvatarList, Users, Entities, MyAvatar, Camera, Overlays, Vec3, Quat, HMD, Controller, Account, UserActivityLogger, Messages, Window, XMLHttpRequest, print, location, getControllerWorldLocation*/ /* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */ // // pal.js @@ -677,7 +677,7 @@ var buttonName = "PEOPLE"; var tablet = null; function startup() { - tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); button = tablet.addButton({ text: buttonName, icon: "icons/tablet-icons/people-i.svg", diff --git a/scripts/system/particle_explorer/particleExplorerTool.js b/scripts/system/particle_explorer/particleExplorerTool.js index d85fc169b1..c2231df406 100644 --- a/scripts/system/particle_explorer/particleExplorerTool.js +++ b/scripts/system/particle_explorer/particleExplorerTool.js @@ -17,7 +17,7 @@ var PARTICLE_EXPLORER_HTML_URL = Script.resolvePath('particleExplorer.html'); ParticleExplorerTool = function() { var that = {}; that.createWebView = function() { - that.webView = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + that.webView = Tablets.getTablet("com.highfidelity.interface.tablet.system"); that.webView.setVisible = function(value) {}; that.webView.webEventReceived.connect(that.webEventReceived); } diff --git a/scripts/system/snapshot.js b/scripts/system/snapshot.js index 9afdb4ec53..3f29238c24 100644 --- a/scripts/system/snapshot.js +++ b/scripts/system/snapshot.js @@ -7,7 +7,7 @@ // Distributed under the Apache License, Version 2.0 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -/* globals Tablet, Script, HMD, Settings, DialogsManager, Menu, Reticle, OverlayWebWindow, Desktop, Account, MyAvatar, Snapshot */ +/* globals Tablets, Script, HMD, Settings, DialogsManager, Menu, Reticle, OverlayWebWindow, Desktop, Account, MyAvatar, Snapshot */ /* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */ (function () { // BEGIN LOCAL_SCOPE @@ -22,7 +22,7 @@ var clearOverlayWhenMoving; var buttonName = "SNAP"; var buttonConnected = false; -var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); +var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var button = tablet.addButton({ icon: "icons/tablet-icons/snap-i.svg", activeIcon: "icons/tablet-icons/snap-a.svg", diff --git a/scripts/system/tablet-goto.js b/scripts/system/tablet-goto.js index 2a0e827932..41b7b84d4c 100644 --- a/scripts/system/tablet-goto.js +++ b/scripts/system/tablet-goto.js @@ -1,6 +1,6 @@ "use strict"; /*jslint vars:true, plusplus:true, forin:true*/ -/*global Window, Script, Tablet, HMD, Controller, Account, XMLHttpRequest, location, print*/ +/*global Window, Script, Tablets, HMD, Controller, Account, XMLHttpRequest, location, print*/ // // goto.js @@ -30,7 +30,7 @@ var shouldActivateButton = false; function ignore() { } - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var NORMAL_ICON = "icons/tablet-icons/goto-i.svg"; var NORMAL_ACTIVE = "icons/tablet-icons/goto-a.svg"; var WAITING_ICON = "icons/tablet-icons/goto-msg.svg"; diff --git a/scripts/system/tablet-ui/tabletUI.js b/scripts/system/tablet-ui/tabletUI.js index 17821c737e..0044ca0496 100644 --- a/scripts/system/tablet-ui/tabletUI.js +++ b/scripts/system/tablet-ui/tabletUI.js @@ -12,7 +12,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -/* global Script, HMD, WebTablet, UIWebTablet, UserActivityLogger, Settings, Entities, Messages, Tablet, Overlays, +/* global Script, HMD, WebTablet, UIWebTablet, UserActivityLogger, Settings, Entities, Messages, Tablets, Overlays, MyAvatar, Menu, AvatarInputs, Vec3 */ (function() { // BEGIN LOCAL_SCOPE @@ -33,7 +33,7 @@ function checkTablet() { if (gTablet === null) { - gTablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + gTablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); } } @@ -315,7 +315,7 @@ Script.scriptEnding.connect(function () { // if we reload scripts in tablet mode make sure we close the currently open window, by calling gotoHomeScreen - var tabletProxy = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tabletProxy = Tablets.getTablet("com.highfidelity.interface.tablet.system"); if (tabletProxy && tabletProxy.toolbarMode) { tabletProxy.gotoHomeScreen(); } diff --git a/scripts/system/tablet-users.js b/scripts/system/tablet-users.js index 6f37cd55eb..7efd49ae55 100644 --- a/scripts/system/tablet-users.js +++ b/scripts/system/tablet-users.js @@ -33,7 +33,7 @@ GlobalServices.findableBy = myVisibility; } - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var button = tablet.addButton({ icon: "icons/tablet-icons/users-i.svg", activeIcon: "icons/tablet-icons/users-a.svg", diff --git a/scripts/tutorials/createFloatingLanternBox.js b/scripts/tutorials/createFloatingLanternBox.js index c84214e295..c83535fa37 100644 --- a/scripts/tutorials/createFloatingLanternBox.js +++ b/scripts/tutorials/createFloatingLanternBox.js @@ -1,6 +1,6 @@ "use strict"; /* jslint vars: true, plusplus: true, forin: true*/ -/* globals Tablet, Script, AvatarList, Users, Entities, MyAvatar, Camera, Overlays, Vec3, Quat, Controller, print, getControllerWorldLocation */ +/* globals Tablets, Script, AvatarList, Users, Entities, MyAvatar, Camera, Overlays, Vec3, Quat, Controller, print, getControllerWorldLocation */ /* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */ // // createFloatinLanternBox.js diff --git a/scripts/tutorials/createTetherballStick.js b/scripts/tutorials/createTetherballStick.js index 35f5fb0344..3ad0939c2e 100644 --- a/scripts/tutorials/createTetherballStick.js +++ b/scripts/tutorials/createTetherballStick.js @@ -1,6 +1,6 @@ "use strict"; /* jslint vars: true, plusplus: true, forin: true*/ -/* globals Tablet, Script, AvatarList, Users, Entities, MyAvatar, Camera, Overlays, Vec3, Quat, Controller, print, getControllerWorldLocation */ +/* globals Tablets, Script, AvatarList, Users, Entities, MyAvatar, Camera, Overlays, Vec3, Quat, Controller, print, getControllerWorldLocation */ /* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */ // // createTetherballStick.js diff --git a/scripts/tutorials/entity_scripts/floatingLantern.js b/scripts/tutorials/entity_scripts/floatingLantern.js index aa25dc0003..c2a79c9c5b 100644 --- a/scripts/tutorials/entity_scripts/floatingLantern.js +++ b/scripts/tutorials/entity_scripts/floatingLantern.js @@ -1,6 +1,6 @@ "use strict"; /* jslint vars: true, plusplus: true, forin: true*/ -/* globals Tablet, Script, AvatarList, Users, Entities, MyAvatar, Camera, Overlays, Vec3, Quat, Controller, print, getControllerWorldLocation */ +/* globals Tablets, Script, AvatarList, Users, Entities, MyAvatar, Camera, Overlays, Vec3, Quat, Controller, print, getControllerWorldLocation */ /* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */ // // floatinLantern.js diff --git a/scripts/tutorials/entity_scripts/floatingLanternBox.js b/scripts/tutorials/entity_scripts/floatingLanternBox.js index b5fb0c27d9..b8e0fbda3e 100644 --- a/scripts/tutorials/entity_scripts/floatingLanternBox.js +++ b/scripts/tutorials/entity_scripts/floatingLanternBox.js @@ -1,6 +1,6 @@ "use strict"; /* jslint vars: true, plusplus: true, forin: true*/ -/* globals Tablet, Script, AvatarList, Users, Entities, MyAvatar, Camera, Overlays, Vec3, Quat, Controller, print, getControllerWorldLocation */ +/* globals Tablets, Script, AvatarList, Users, Entities, MyAvatar, Camera, Overlays, Vec3, Quat, Controller, print, getControllerWorldLocation */ /* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */ // // floatingLanternBox.js diff --git a/scripts/tutorials/entity_scripts/tetherballStick.js b/scripts/tutorials/entity_scripts/tetherballStick.js index 867074abd4..50bac88caf 100644 --- a/scripts/tutorials/entity_scripts/tetherballStick.js +++ b/scripts/tutorials/entity_scripts/tetherballStick.js @@ -1,6 +1,6 @@ "use strict"; /* jslint vars: true, plusplus: true, forin: true*/ -/* globals Tablet, Script, AvatarList, Users, Entities, MyAvatar, Camera, Overlays, Vec3, Quat, Controller, print, getControllerWorldLocation */ +/* globals Tablets, Script, AvatarList, Users, Entities, MyAvatar, Camera, Overlays, Vec3, Quat, Controller, print, getControllerWorldLocation */ /* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */ // // tetherballStick.js diff --git a/tests/shared/src/PathUtilsTests.cpp b/tests/shared/src/PathUtilsTests.cpp new file mode 100644 index 0000000000..fc31d475d0 --- /dev/null +++ b/tests/shared/src/PathUtilsTests.cpp @@ -0,0 +1,28 @@ +// +// Created by Bradley Austin Davis on 2017/11/08 +// Copyright 2013-2017 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + + +#include "PathUtilsTests.h" + +#include + +#include + + +QTEST_MAIN(PathUtilsTests) + +void PathUtilsTests::testPathUtils() { + QString result = PathUtils::qmlBasePath(); +#if DEV_BUILD + QVERIFY(result.startsWith("file:///")); +#else + QVERIFY(result.startsWith("qrc:///")); +#endif + QVERIFY(result.endsWith("/")); +} + diff --git a/tests/shared/src/PathUtilsTests.h b/tests/shared/src/PathUtilsTests.h new file mode 100644 index 0000000000..8ae410d6cb --- /dev/null +++ b/tests/shared/src/PathUtilsTests.h @@ -0,0 +1,20 @@ +// +// Created by Bradley Austin Davis on 2017/11/08 +// Copyright 2013-2017 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#ifndef hifi_PathUtilsTests_h +#define hifi_PathUtilsTests_h + +#include + +class PathUtilsTests : public QObject { + Q_OBJECT +private slots: + void testPathUtils(); +}; + +#endif // hifi_PathUtilsTests_h diff --git a/unpublishedScripts/marketplace/blocks/blocksApp.js b/unpublishedScripts/marketplace/blocks/blocksApp.js index c9e8682b23..8088f438de 100644 --- a/unpublishedScripts/marketplace/blocks/blocksApp.js +++ b/unpublishedScripts/marketplace/blocks/blocksApp.js @@ -26,7 +26,7 @@ APP_URL = APP_OUTDATED_URL; } - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var button = tablet.addButton({ icon: APP_ICON, activeIcon: APP_ICON_ACTIVE, diff --git a/unpublishedScripts/marketplace/camera-move/app-camera-move.js b/unpublishedScripts/marketplace/camera-move/app-camera-move.js index f58dd3d3bd..177565a332 100644 --- a/unpublishedScripts/marketplace/camera-move/app-camera-move.js +++ b/unpublishedScripts/marketplace/camera-move/app-camera-move.js @@ -162,7 +162,7 @@ var globalState = { function main() { log('initializing...', VERSION); - var tablet = Tablet.getTablet('com.highfidelity.interface.tablet.system'), + var tablet = Tablets.getTablet('com.highfidelity.interface.tablet.system'), button = tablet.addButton(BUTTON_CONFIG); Script.scriptEnding.connect(function() { @@ -601,7 +601,7 @@ function _patchCameraModeSetting() { } function getSystemMetadata() { - var tablet = Tablet.getTablet('com.highfidelity.interface.tablet.system'); + var tablet = Tablets.getTablet('com.highfidelity.interface.tablet.system'); return { mode: { hmd: HMD.active, diff --git a/unpublishedScripts/marketplace/clap/clapApp.js b/unpublishedScripts/marketplace/clap/clapApp.js index b2d8ce55db..a975d9d8b5 100644 --- a/unpublishedScripts/marketplace/clap/clapApp.js +++ b/unpublishedScripts/marketplace/clap/clapApp.js @@ -16,7 +16,7 @@ // Load up engine var APP_NAME = "CLAP"; var ClapEngine = Script.require(Script.resolvePath("scripts/ClapEngine.js?v9")); -var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); +var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); // Define Menu var blackIcon = Script.resolvePath("icons/tablet-icons/clap-a.svg?foxv2"); diff --git a/unpublishedScripts/marketplace/doppleganger-attachments/app-doppleganger-attachments.js b/unpublishedScripts/marketplace/doppleganger-attachments/app-doppleganger-attachments.js index c09ad602f8..278f4efbaa 100644 --- a/unpublishedScripts/marketplace/doppleganger-attachments/app-doppleganger-attachments.js +++ b/unpublishedScripts/marketplace/doppleganger-attachments/app-doppleganger-attachments.js @@ -45,7 +45,7 @@ var buttonConfig = utils.assign({ activeIcon: require('./doppleganger-a.svg.json'), }); -var tablet = Tablet.getTablet('com.highfidelity.interface.tablet.system'), +var tablet = Tablets.getTablet('com.highfidelity.interface.tablet.system'), button = tablet.addButton(buttonConfig); Script.scriptEnding.connect(function() { diff --git a/unpublishedScripts/marketplace/doppleganger-attachments/dist/app-doppleganger-marketplace.js b/unpublishedScripts/marketplace/doppleganger-attachments/dist/app-doppleganger-marketplace.js index bc5368ba5b..1cb7610ff3 100644 --- a/unpublishedScripts/marketplace/doppleganger-attachments/dist/app-doppleganger-marketplace.js +++ b/unpublishedScripts/marketplace/doppleganger-attachments/dist/app-doppleganger-marketplace.js @@ -905,7 +905,7 @@ var buttonConfig = utils.assign({ activeIcon: __webpack_require__(7), }); -var tablet = Tablet.getTablet('com.highfidelity.interface.tablet.system'), +var tablet = Tablets.getTablet('com.highfidelity.interface.tablet.system'), button = tablet.addButton(buttonConfig); Script.scriptEnding.connect(function() { diff --git a/unpublishedScripts/marketplace/doppleganger-mirror/app-doppleganger.js b/unpublishedScripts/marketplace/doppleganger-mirror/app-doppleganger.js index f4c7bf99c0..d02dd3e9ba 100644 --- a/unpublishedScripts/marketplace/doppleganger-mirror/app-doppleganger.js +++ b/unpublishedScripts/marketplace/doppleganger-mirror/app-doppleganger.js @@ -12,7 +12,7 @@ var DopplegangerClass = Script.require('./doppleganger.js'); -var tablet = Tablet.getTablet('com.highfidelity.interface.tablet.system'), +var tablet = Tablets.getTablet('com.highfidelity.interface.tablet.system'), button = tablet.addButton({ icon: Script.resolvePath('./doppleganger-i.svg'), activeIcon: Script.resolvePath('./doppleganger-a.svg'), diff --git a/unpublishedScripts/marketplace/emoji-tablet/emojiTablet.js b/unpublishedScripts/marketplace/emoji-tablet/emojiTablet.js index b4d01e77cf..687c9445cd 100644 --- a/unpublishedScripts/marketplace/emoji-tablet/emojiTablet.js +++ b/unpublishedScripts/marketplace/emoji-tablet/emojiTablet.js @@ -19,7 +19,7 @@ var lib = Script.require("https://hifi-content.s3.amazonaws.com/elisalj/emoji_sc var APP_NAME = "EMOJIS"; var APP_URL = "https://hifi-content.s3.amazonaws.com/elisalj/emoji_scripts/emojiTabletUI.html?" + Date.now(); var APP_ICON = "https://hifi-content.s3.amazonaws.com/elisalj/emoji_scripts/icons/emoji-i.svg"; - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var button = tablet.addButton({ icon: APP_ICON, diff --git a/unpublishedScripts/marketplace/laser/laserPointerApp.js b/unpublishedScripts/marketplace/laser/laserPointerApp.js index 515a2c3a76..32cc75dd42 100644 --- a/unpublishedScripts/marketplace/laser/laserPointerApp.js +++ b/unpublishedScripts/marketplace/laser/laserPointerApp.js @@ -17,7 +17,7 @@ var TRIGGER_PRESSURE = 0.95; - var tablet = Tablet.getTablet('com.highfidelity.interface.tablet.system'); + var tablet = Tablets.getTablet('com.highfidelity.interface.tablet.system'); var button = tablet.addButton({ icon: APP_ICON, diff --git a/unpublishedScripts/marketplace/record/record.js b/unpublishedScripts/marketplace/record/record.js index 68c7ea3f5a..6392f10892 100644 --- a/unpublishedScripts/marketplace/record/record.js +++ b/unpublishedScripts/marketplace/record/record.js @@ -631,7 +631,7 @@ } function setUp() { - tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); if (!tablet) { return; } @@ -694,7 +694,7 @@ } // FIXME: If setUp() is run immediately at Interface start-up, Interface hangs and crashes because of the line of code: - // tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + // tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); //setUp(); //Script.scriptEnding.connect(tearDown); Script.setTimeout(function () { diff --git a/unpublishedScripts/marketplace/shapes/shapes.js b/unpublishedScripts/marketplace/shapes/shapes.js index cd5f119588..de177f435e 100644 --- a/unpublishedScripts/marketplace/shapes/shapes.js +++ b/unpublishedScripts/marketplace/shapes/shapes.js @@ -1930,7 +1930,7 @@ function setUp() { var hasRezPermissions; - tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); if (!tablet) { App.log("ERROR: Tablet not found! App not started."); return; diff --git a/unpublishedScripts/marketplace/skyboxChanger/skyboxchanger.js b/unpublishedScripts/marketplace/skyboxChanger/skyboxchanger.js index 7bc65722cd..114bccb034 100644 --- a/unpublishedScripts/marketplace/skyboxChanger/skyboxchanger.js +++ b/unpublishedScripts/marketplace/skyboxChanger/skyboxchanger.js @@ -28,7 +28,7 @@ } } - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var button = tablet.addButton({ icon: ICONS.icon, activeIcon: ICONS.activeIcon, diff --git a/unpublishedScripts/marketplace/spectator-camera/spectatorCamera.js b/unpublishedScripts/marketplace/spectator-camera/spectatorCamera.js index 76044d2975..cc600632e5 100644 --- a/unpublishedScripts/marketplace/spectator-camera/spectatorCamera.js +++ b/unpublishedScripts/marketplace/spectator-camera/spectatorCamera.js @@ -1,6 +1,6 @@ "use strict"; /*jslint vars:true, plusplus:true, forin:true*/ -/*global Tablet, Script, */ +/*global Tablets, Script, */ /* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */ // // spectatorCamera.js @@ -188,7 +188,7 @@ // -tablet: The tablet instance to be modified. var tablet = null; function startup() { - tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); addOrRemoveButton(false, HMD.active); tablet.screenChanged.connect(onTabletScreenChanged); Window.domainChanged.connect(onDomainChanged); diff --git a/unpublishedScripts/marketplace/tablet-raiseHand/tablet-raiseHand.js b/unpublishedScripts/marketplace/tablet-raiseHand/tablet-raiseHand.js index f7702053a4..2f895d5f94 100644 --- a/unpublishedScripts/marketplace/tablet-raiseHand/tablet-raiseHand.js +++ b/unpublishedScripts/marketplace/tablet-raiseHand/tablet-raiseHand.js @@ -20,7 +20,7 @@ var isRaiseHandButtonActive = false; var animHandlerId; - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var tablet = Tablets.getTablet("com.highfidelity.interface.tablet.system"); var button = tablet.addButton({ text: BUTTON_NAME, icon: "icons/tablet-icons/raise-hand-i.svg",