From 92bb7f2329df832ca6028c85b9b9ae2f4d3db19c Mon Sep 17 00:00:00 2001 From: druiz17 Date: Sun, 9 Apr 2017 18:55:53 -0700 Subject: [PATCH] saving work --- .../resources/qml/hifi/tablet/TabletRoot.qml | 20 ++++++++----------- .../tabletWindows/TabletPreferencesDialog.qml | 2 +- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/TabletRoot.qml b/interface/resources/qml/hifi/tablet/TabletRoot.qml index 8214c5452c..4bbcb201bc 100644 --- a/interface/resources/qml/hifi/tablet/TabletRoot.qml +++ b/interface/resources/qml/hifi/tablet/TabletRoot.qml @@ -61,33 +61,31 @@ Item { tabletApps.clear(); loader.source = ""; // make sure we load the qml fresh each time. loader.source = url; - //tabletApps.append({appUrl: url, isWebUrl: false, scriptUrl: ""}); } function loadQMLOnTop(url) { + console.log("[DR] -> loading the url: " + url); tabletApps.append({"appUrl": url, "isWebUrl": false, "scriptUrl": ""}); loader.source = ""; loader.source = tabletApps.get(currentApp).appUrl; } function loadWebOnTop(url, injectJavaScriptUrl) { + console.log("[DR] -> loading the url: " + url); tabletApps.append({"appUrl": loader.source, "isWebUrl": true, "scriptUrl": injectJavaScriptUrl, "appWebUrl": url}); loader.item.url = tabletApps.get(currentApp).appWebUrl; loader.item.scriptUrl = tabletApps.get(currentApp).scriptUrl; } function returnToPreviousApp() { - loader.source = ""; tabletApps.remove(currentApp); var isWebPage = tabletApps.get(currentApp).isWebUrl; console.log(isWebPage); if (isWebPage) { - console.log(tabletApps.get(currentApp).appUrl); - loader.source = tabletApps.get(currentApp).appUrl; - console.log(tabletApps.get(currentApp).appWebUrl); - console.log(tabletApps.get(currentApp).scriptUrl); - loader.item.url = tabletApps.get(currentApp).appWebUrl; - loader.item.scriptUrl = tabletApps.get(currentApp).scriptUrl; + var webUrl = tabletApps.get(currentApp).appWebUrl; + var scriptUrl = tabletApps.get(currentApp).scriptUrl; + loadSource("TabletWebView.qml"); + loadWebUrl(webUrl, scriptUrl); } else { console.log(tabletApps.get(currentApp).appUrl); loader.source = tabletApps.get(currentApp).appUrl; @@ -97,8 +95,7 @@ Item { function loadWebUrl(url, injectedJavaScriptUrl) { loader.item.url = url; loader.item.scriptURL = injectedJavaScriptUrl; - var appUrl = loader.source; - tabletApps.append({"appUrl": "Tablet.qml", "isWebUrl": true, "scriptUrl": injectedJavaScriptUrl, "appWebUrl": url}); + tabletApps.append({"appUrl": "TabletWebView.qml", "isWebUrl": true, "scriptUrl": injectedJavaScriptUrl, "appWebUrl": url}); } // used to send a message from qml to interface script. @@ -136,8 +133,7 @@ Item { ListModel { id: tabletApps onCountChanged: { - currentApp = count; - console.log("[DR] -> the currnet count: " + currentApp); + currentApp = count - 1 } } diff --git a/interface/resources/qml/hifi/tablet/tabletWindows/TabletPreferencesDialog.qml b/interface/resources/qml/hifi/tablet/tabletWindows/TabletPreferencesDialog.qml index c96099a78a..7ce0a6d714 100644 --- a/interface/resources/qml/hifi/tablet/tabletWindows/TabletPreferencesDialog.qml +++ b/interface/resources/qml/hifi/tablet/tabletWindows/TabletPreferencesDialog.qml @@ -55,7 +55,7 @@ Item { } function closeDialog() { - Tablet.getTablet("com.highfidelity.interface.tablet.system").gotoHomeScreen(); + Tablet.getTablet("com.highfidelity.interface.tablet.system").returnToPreviousApp(); } Rectangle {