Add "Load Defaults" button to Running Scripts dialog

And rename "Stop All" to "Remove All".
This commit is contained in:
David Rowe 2016-06-07 11:30:07 +12:00
parent 5190d8ab6b
commit b6af46cac9

View file

@ -23,9 +23,9 @@ Window {
title: "Running Scripts" title: "Running Scripts"
resizable: true resizable: true
destroyOnInvisible: true destroyOnInvisible: true
implicitWidth: 400 implicitWidth: 424
implicitHeight: isHMD ? 695 : 728 implicitHeight: isHMD ? 695 : 728
minSize: Qt.vector2d(200, 300) minSize: Qt.vector2d(424, 300)
HifiConstants { id: hifi } HifiConstants { id: hifi }
@ -83,6 +83,11 @@ Window {
scripts.reloadAllScripts(); scripts.reloadAllScripts();
} }
function loadDefaults() {
console.log("Load default scripts");
scripts.loadOneScript(scripts.defaultScriptsPath + "/defaultScripts.js");
}
function stopAll() { function stopAll() {
console.log("Stop all scripts"); console.log("Stop all scripts");
scripts.stopAllScripts(); scripts.stopAllScripts();
@ -101,13 +106,13 @@ Window {
spacing: hifi.dimensions.contentSpacing.x spacing: hifi.dimensions.contentSpacing.x
HifiControls.Button { HifiControls.Button {
text: "Reload all" text: "Reload All"
color: hifi.buttons.black color: hifi.buttons.black
onClicked: reloadAll() onClicked: reloadAll()
} }
HifiControls.Button { HifiControls.Button {
text: "Stop all" text: "Remove All"
color: hifi.buttons.red color: hifi.buttons.red
onClicked: stopAll() onClicked: stopAll()
} }
@ -215,7 +220,6 @@ Window {
Row { Row {
spacing: hifi.dimensions.contentSpacing.x spacing: hifi.dimensions.contentSpacing.x
anchors.right: parent.right
HifiControls.Button { HifiControls.Button {
text: "from URL" text: "from URL"
@ -253,6 +257,12 @@ Window {
onTriggered: ApplicationInterface.loadDialog(); onTriggered: ApplicationInterface.loadDialog();
} }
} }
HifiControls.Button {
text: "Load Defaults"
color: hifi.buttons.black
onClicked: loadDefaults()
}
} }
HifiControls.VerticalSpacer {} HifiControls.VerticalSpacer {}