From bfb9b679687ae4a0e4a5dac2e167b162d5101cd1 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Tue, 21 Aug 2018 11:17:33 -0700 Subject: [PATCH 1/5] more debug statements --- interface/resources/qml/hifi/tablet/TabletHome.qml | 6 ++++++ scripts/system/menu.js | 1 + scripts/system/tablet-ui/tabletUI.js | 6 +++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/TabletHome.qml b/interface/resources/qml/hifi/tablet/TabletHome.qml index 1922b02f93..10a9f01337 100644 --- a/interface/resources/qml/hifi/tablet/TabletHome.qml +++ b/interface/resources/qml/hifi/tablet/TabletHome.qml @@ -117,6 +117,7 @@ Item { id: pageRepeater model: Math.ceil(tabletProxy.buttons.rowCount() / TabletEnums.ButtonsOnPage) onItemAdded: { + console.log("onItemAdded: " + tabletProxy.buttons.rowCount()); item.proxyModel.sourceModel = tabletProxy.buttons; item.proxyModel.pageIndex = index; } @@ -208,6 +209,7 @@ Item { Component.onCompleted: updateProperties() function updateProperties() { + console.log("updateProperties: " + tabletProxy.buttons.rowCount()); var keys = Object.keys(modelData.properties).forEach(function (key) { if (tabletButton[key] !== modelData.properties[key]) { tabletButton[key] = modelData.properties[key]; @@ -269,6 +271,10 @@ Item { anchors.bottom: parent.bottom anchors.horizontalCenter: parent.horizontalCenter count: swipeView.count + + Component.onCompleted: { + console.log("pageIndicator: " + pageIndicator.count); + } } } diff --git a/scripts/system/menu.js b/scripts/system/menu.js index d669d3d918..1db210216a 100644 --- a/scripts/system/menu.js +++ b/scripts/system/menu.js @@ -52,6 +52,7 @@ var HOME_BUTTON_TEXTURE = "http://hifi-content.s3.amazonaws.com/alan/dev/tablet- if (isHMDMode) { button = tablet.addButton(buttonProperties); button.clicked.connect(onClicked); + print("Adding menu button"); } else if (button) { button.clicked.disconnect(onClicked); tablet.removeButton(button); diff --git a/scripts/system/tablet-ui/tabletUI.js b/scripts/system/tablet-ui/tabletUI.js index f339475f72..c28040000b 100644 --- a/scripts/system/tablet-ui/tabletUI.js +++ b/scripts/system/tablet-ui/tabletUI.js @@ -22,7 +22,7 @@ var DEFAULT_TABLET_SCALE = 70; var preMakeTime = Date.now(); var validCheckTime = Date.now(); - var debugTablet = false; + var debugTablet = true; var tabletScalePercentage = 70.0; var UIWebTablet = null; var MSECS_PER_SEC = 1000.0; @@ -298,7 +298,7 @@ } wantsMenu = clicked; }); - + clickMapping.from(Controller.Standard.LeftSecondaryThumb).peek().to(function (clicked) { if (clicked) { //activeHudPoint2d(Controller.Standard.LeftHand); @@ -306,7 +306,7 @@ } wantsMenu = clicked; }); - + clickMapping.from(Controller.Standard.Start).peek().to(function (clicked) { if (clicked) { //activeHudPoint2dGamePad(); From 54aeac5d1f8b27717557ce546f020ef265a4505e Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Tue, 21 Aug 2018 15:55:00 -0700 Subject: [PATCH 2/5] adding fix --- libraries/ui/src/ui/TabletScriptingInterface.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/ui/src/ui/TabletScriptingInterface.cpp b/libraries/ui/src/ui/TabletScriptingInterface.cpp index 4e920e430b..1081f8c4e7 100644 --- a/libraries/ui/src/ui/TabletScriptingInterface.cpp +++ b/libraries/ui/src/ui/TabletScriptingInterface.cpp @@ -140,8 +140,7 @@ int TabletButtonsProxyModel::buttonIndex(const QString &uuid) { return -1; } -void TabletButtonsProxyModel::setPageIndex(int pageIndex) -{ +void TabletButtonsProxyModel::setPageIndex(int pageIndex) { if (_pageIndex == pageIndex) return; @@ -465,6 +464,9 @@ void TabletProxy::onTabletShown() { _showRunningScripts = false; pushOntoStack("hifi/dialogs/TabletRunningScripts.qml"); } + if (_currentPathLoaded == TABLET_HOME_SOURCE_URL) { + loadHomeScreen(true); + } } } From 81d0e212dd737b34f43f2f0fff845855a06ee0f9 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Tue, 21 Aug 2018 15:57:17 -0700 Subject: [PATCH 3/5] removing print statements --- interface/resources/qml/hifi/tablet/TabletHome.qml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/TabletHome.qml b/interface/resources/qml/hifi/tablet/TabletHome.qml index 10a9f01337..cccd37ad95 100644 --- a/interface/resources/qml/hifi/tablet/TabletHome.qml +++ b/interface/resources/qml/hifi/tablet/TabletHome.qml @@ -117,7 +117,6 @@ Item { id: pageRepeater model: Math.ceil(tabletProxy.buttons.rowCount() / TabletEnums.ButtonsOnPage) onItemAdded: { - console.log("onItemAdded: " + tabletProxy.buttons.rowCount()); item.proxyModel.sourceModel = tabletProxy.buttons; item.proxyModel.pageIndex = index; } @@ -209,7 +208,6 @@ Item { Component.onCompleted: updateProperties() function updateProperties() { - console.log("updateProperties: " + tabletProxy.buttons.rowCount()); var keys = Object.keys(modelData.properties).forEach(function (key) { if (tabletButton[key] !== modelData.properties[key]) { tabletButton[key] = modelData.properties[key]; @@ -272,9 +270,6 @@ Item { anchors.horizontalCenter: parent.horizontalCenter count: swipeView.count - Component.onCompleted: { - console.log("pageIndicator: " + pageIndicator.count); - } } } From bb176eb22834b01d6c1e89d38f18533240f5cef7 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Tue, 21 Aug 2018 16:00:01 -0700 Subject: [PATCH 4/5] trailing debug statements --- interface/resources/qml/hifi/tablet/TabletHome.qml | 1 - scripts/system/menu.js | 1 - scripts/system/tablet-ui/tabletUI.js | 4 +--- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/TabletHome.qml b/interface/resources/qml/hifi/tablet/TabletHome.qml index cccd37ad95..1922b02f93 100644 --- a/interface/resources/qml/hifi/tablet/TabletHome.qml +++ b/interface/resources/qml/hifi/tablet/TabletHome.qml @@ -269,7 +269,6 @@ Item { anchors.bottom: parent.bottom anchors.horizontalCenter: parent.horizontalCenter count: swipeView.count - } } diff --git a/scripts/system/menu.js b/scripts/system/menu.js index 1db210216a..d669d3d918 100644 --- a/scripts/system/menu.js +++ b/scripts/system/menu.js @@ -52,7 +52,6 @@ var HOME_BUTTON_TEXTURE = "http://hifi-content.s3.amazonaws.com/alan/dev/tablet- if (isHMDMode) { button = tablet.addButton(buttonProperties); button.clicked.connect(onClicked); - print("Adding menu button"); } else if (button) { button.clicked.disconnect(onClicked); tablet.removeButton(button); diff --git a/scripts/system/tablet-ui/tabletUI.js b/scripts/system/tablet-ui/tabletUI.js index c28040000b..d78e90b789 100644 --- a/scripts/system/tablet-ui/tabletUI.js +++ b/scripts/system/tablet-ui/tabletUI.js @@ -22,7 +22,7 @@ var DEFAULT_TABLET_SCALE = 70; var preMakeTime = Date.now(); var validCheckTime = Date.now(); - var debugTablet = true; + var debugTablet = false; var tabletScalePercentage = 70.0; var UIWebTablet = null; var MSECS_PER_SEC = 1000.0; @@ -298,7 +298,6 @@ } wantsMenu = clicked; }); - clickMapping.from(Controller.Standard.LeftSecondaryThumb).peek().to(function (clicked) { if (clicked) { //activeHudPoint2d(Controller.Standard.LeftHand); @@ -306,7 +305,6 @@ } wantsMenu = clicked; }); - clickMapping.from(Controller.Standard.Start).peek().to(function (clicked) { if (clicked) { //activeHudPoint2dGamePad(); From 4e9a5446187187ffcba87a846ec1b22f36cdbf15 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Tue, 21 Aug 2018 16:01:24 -0700 Subject: [PATCH 5/5] redoing newline --- scripts/system/tablet-ui/tabletUI.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/system/tablet-ui/tabletUI.js b/scripts/system/tablet-ui/tabletUI.js index d78e90b789..80ddbeca8b 100644 --- a/scripts/system/tablet-ui/tabletUI.js +++ b/scripts/system/tablet-ui/tabletUI.js @@ -298,6 +298,7 @@ } wantsMenu = clicked; }); + clickMapping.from(Controller.Standard.LeftSecondaryThumb).peek().to(function (clicked) { if (clicked) { //activeHudPoint2d(Controller.Standard.LeftHand); @@ -305,6 +306,7 @@ } wantsMenu = clicked; }); + clickMapping.from(Controller.Standard.Start).peek().to(function (clicked) { if (clicked) { //activeHudPoint2dGamePad();