saving work

This commit is contained in:
druiz17 2017-04-09 18:55:53 -07:00
parent 86c67a3017
commit 92bb7f2329
2 changed files with 9 additions and 13 deletions

View file

@ -61,33 +61,31 @@ Item {
tabletApps.clear(); tabletApps.clear();
loader.source = ""; // make sure we load the qml fresh each time. loader.source = ""; // make sure we load the qml fresh each time.
loader.source = url; loader.source = url;
//tabletApps.append({appUrl: url, isWebUrl: false, scriptUrl: ""});
} }
function loadQMLOnTop(url) { function loadQMLOnTop(url) {
console.log("[DR] -> loading the url: " + url);
tabletApps.append({"appUrl": url, "isWebUrl": false, "scriptUrl": ""}); tabletApps.append({"appUrl": url, "isWebUrl": false, "scriptUrl": ""});
loader.source = ""; loader.source = "";
loader.source = tabletApps.get(currentApp).appUrl; loader.source = tabletApps.get(currentApp).appUrl;
} }
function loadWebOnTop(url, injectJavaScriptUrl) { function loadWebOnTop(url, injectJavaScriptUrl) {
console.log("[DR] -> loading the url: " + url);
tabletApps.append({"appUrl": loader.source, "isWebUrl": true, "scriptUrl": injectJavaScriptUrl, "appWebUrl": url}); tabletApps.append({"appUrl": loader.source, "isWebUrl": true, "scriptUrl": injectJavaScriptUrl, "appWebUrl": url});
loader.item.url = tabletApps.get(currentApp).appWebUrl; loader.item.url = tabletApps.get(currentApp).appWebUrl;
loader.item.scriptUrl = tabletApps.get(currentApp).scriptUrl; loader.item.scriptUrl = tabletApps.get(currentApp).scriptUrl;
} }
function returnToPreviousApp() { function returnToPreviousApp() {
loader.source = "";
tabletApps.remove(currentApp); tabletApps.remove(currentApp);
var isWebPage = tabletApps.get(currentApp).isWebUrl; var isWebPage = tabletApps.get(currentApp).isWebUrl;
console.log(isWebPage); console.log(isWebPage);
if (isWebPage) { if (isWebPage) {
console.log(tabletApps.get(currentApp).appUrl); var webUrl = tabletApps.get(currentApp).appWebUrl;
loader.source = tabletApps.get(currentApp).appUrl; var scriptUrl = tabletApps.get(currentApp).scriptUrl;
console.log(tabletApps.get(currentApp).appWebUrl); loadSource("TabletWebView.qml");
console.log(tabletApps.get(currentApp).scriptUrl); loadWebUrl(webUrl, scriptUrl);
loader.item.url = tabletApps.get(currentApp).appWebUrl;
loader.item.scriptUrl = tabletApps.get(currentApp).scriptUrl;
} else { } else {
console.log(tabletApps.get(currentApp).appUrl); console.log(tabletApps.get(currentApp).appUrl);
loader.source = tabletApps.get(currentApp).appUrl; loader.source = tabletApps.get(currentApp).appUrl;
@ -97,8 +95,7 @@ Item {
function loadWebUrl(url, injectedJavaScriptUrl) { function loadWebUrl(url, injectedJavaScriptUrl) {
loader.item.url = url; loader.item.url = url;
loader.item.scriptURL = injectedJavaScriptUrl; loader.item.scriptURL = injectedJavaScriptUrl;
var appUrl = loader.source; tabletApps.append({"appUrl": "TabletWebView.qml", "isWebUrl": true, "scriptUrl": injectedJavaScriptUrl, "appWebUrl": url});
tabletApps.append({"appUrl": "Tablet.qml", "isWebUrl": true, "scriptUrl": injectedJavaScriptUrl, "appWebUrl": url});
} }
// used to send a message from qml to interface script. // used to send a message from qml to interface script.
@ -136,8 +133,7 @@ Item {
ListModel { ListModel {
id: tabletApps id: tabletApps
onCountChanged: { onCountChanged: {
currentApp = count; currentApp = count - 1
console.log("[DR] -> the currnet count: " + currentApp);
} }
} }

View file

@ -55,7 +55,7 @@ Item {
} }
function closeDialog() { function closeDialog() {
Tablet.getTablet("com.highfidelity.interface.tablet.system").gotoHomeScreen(); Tablet.getTablet("com.highfidelity.interface.tablet.system").returnToPreviousApp();
} }
Rectangle { Rectangle {