From 6f020a7ec8685683660bc448309584f0f530803d Mon Sep 17 00:00:00 2001 From: Liv Date: Sun, 8 Apr 2018 19:30:56 -0700 Subject: [PATCH 1/5] return tablet to home on change domain --- scripts/system/edit.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/system/edit.js b/scripts/system/edit.js index fd7a488eb7..352db696fb 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -457,6 +457,7 @@ var toolBar = (function () { Window.domainChanged.connect(function () { that.setActive(false); that.clearEntityList(); + tablet.gotoHomeScreen(); }); Entities.canAdjustLocksChanged.connect(function (canAdjustLocks) { From 7f01dded79f4f977524de389678d1ef40431e3a9 Mon Sep 17 00:00:00 2001 From: Liv Date: Sun, 8 Apr 2018 19:32:39 -0700 Subject: [PATCH 2/5] add handler to refused domain change connections --- scripts/system/edit.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 352db696fb..554e0b9d72 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -460,6 +460,10 @@ var toolBar = (function () { tablet.gotoHomeScreen(); }); + Window.domainConnectionRefused.connect(function() { + tablet.gotoHomeScreen(); + }); + Entities.canAdjustLocksChanged.connect(function (canAdjustLocks) { if (isActive && !canAdjustLocks) { that.setActive(false); From 7a7438b648048572900dd1dfe3e1d7c9e3262b10 Mon Sep 17 00:00:00 2001 From: Liv Date: Sun, 8 Apr 2018 19:36:51 -0700 Subject: [PATCH 3/5] space for synxtax --- scripts/system/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 554e0b9d72..bfea26d869 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -460,7 +460,7 @@ var toolBar = (function () { tablet.gotoHomeScreen(); }); - Window.domainConnectionRefused.connect(function() { + Window.domainConnectionRefused.connect(function () { tablet.gotoHomeScreen(); }); From 071396bed001eaa9369de40c7603b4f802476edc Mon Sep 17 00:00:00 2001 From: Liv Date: Mon, 9 Apr 2018 18:34:53 -0700 Subject: [PATCH 4/5] move logic for disconnecting out of initalize() and into setActive() --- scripts/system/edit.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/system/edit.js b/scripts/system/edit.js index bfea26d869..c3854ca80b 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -452,16 +452,15 @@ var toolBar = (function () { } } + function clearWindow() { + tablet.gotoHomeScreen(); + }; + function initialize() { Script.scriptEnding.connect(cleanup); Window.domainChanged.connect(function () { that.setActive(false); that.clearEntityList(); - tablet.gotoHomeScreen(); - }); - - Window.domainConnectionRefused.connect(function () { - tablet.gotoHomeScreen(); }); Entities.canAdjustLocksChanged.connect(function (canAdjustLocks) { @@ -723,6 +722,8 @@ var toolBar = (function () { cameraManager.disable(); selectionDisplay.triggerMapping.disable(); tablet.landscape = false; + Window.domainChanged.disconnect(clearWindow); + Window.domainConnectionRefused.disconnect(clearWindow); } else { tablet.loadQMLSource("hifi/tablet/Edit.qml", true); UserActivityLogger.enabledEdit(); @@ -734,6 +735,8 @@ var toolBar = (function () { print("starting tablet in landscape mode"); tablet.landscape = true; entityIconOverlayManager.setIconsSelectable(null,false); + Window.domainChanged.connect(clearWindow); + Window.domainConnectionRefused.connect(clearWindow); // Not sure what the following was meant to accomplish, but it currently causes // everybody else to think that Interface has lost focus overall. fogbugzid:558 // Window.setFocus(); From abe8a3e6d9bc9d3ad52d55620b842dde2ca2c9f8 Mon Sep 17 00:00:00 2001 From: Liv Erickson Date: Tue, 17 Apr 2018 15:27:07 -0700 Subject: [PATCH 5/5] correct implementation that doesn't interfere with other app status --- scripts/system/edit.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts/system/edit.js b/scripts/system/edit.js index c3854ca80b..467842c712 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -452,13 +452,12 @@ var toolBar = (function () { } } - function clearWindow() { - tablet.gotoHomeScreen(); - }; - function initialize() { Script.scriptEnding.connect(cleanup); Window.domainChanged.connect(function () { + if (isActive) { + tablet.gotoHomeScreen(); + } that.setActive(false); that.clearEntityList(); }); @@ -722,8 +721,6 @@ var toolBar = (function () { cameraManager.disable(); selectionDisplay.triggerMapping.disable(); tablet.landscape = false; - Window.domainChanged.disconnect(clearWindow); - Window.domainConnectionRefused.disconnect(clearWindow); } else { tablet.loadQMLSource("hifi/tablet/Edit.qml", true); UserActivityLogger.enabledEdit(); @@ -735,8 +732,6 @@ var toolBar = (function () { print("starting tablet in landscape mode"); tablet.landscape = true; entityIconOverlayManager.setIconsSelectable(null,false); - Window.domainChanged.connect(clearWindow); - Window.domainConnectionRefused.connect(clearWindow); // Not sure what the following was meant to accomplish, but it currently causes // everybody else to think that Interface has lost focus overall. fogbugzid:558 // Window.setFocus();