Final functionality for running scripts

This commit is contained in:
Brad Davis 2016-01-12 12:29:51 -08:00
parent a9eb5b8229
commit dcc6739bce
3 changed files with 43 additions and 13 deletions

View file

@ -47,8 +47,6 @@ Window {
}
}
Settings {
category: "Overlay.RunningScripts"
property alias x: root.x
@ -187,10 +185,13 @@ Window {
anchors.bottom: filterEdit.top
anchors.bottomMargin: 8
anchors.right: parent.right
Button { text: "from URL" }
Button {
text: "from URL";
onClicked: ApplicationInterface.loadScriptURLDialog();
}
Button {
text: "from Disk"
onClicked: fileDialogCreator.createObject(root);
onClicked: ApplicationInterface.loadDialog();
}
}
@ -207,7 +208,8 @@ Window {
TreeView {
id: treeView
height: 128
anchors.bottom: parent.bottom
anchors.bottom: loadButton.top
anchors.bottomMargin: 8
anchors.left: parent.left
anchors.right: parent.right
headerVisible: false
@ -232,6 +234,37 @@ Window {
model: scriptsModel
TableViewColumn { title: "Name"; role: "display"; }
}
TextField {
id: selectedScript
enabled: true
readOnly: true
anchors.left: parent.left
anchors.right: loadButton.left
anchors.rightMargin: 8
anchors.bottom: loadButton.bottom
anchors.top: loadButton.top
Connections {
target: treeView
onCurrentIndexChanged: {
var path = scriptsModel.data(treeView.currentIndex, 0x100)
if (path) {
selectedScript.text = path
} else {
selectedScript.text = ""
}
}
}
}
Button {
id: loadButton
anchors.bottom: parent.bottom
anchors.right: parent.right
text: "Load"
enabled: selectedScript.text != ""
}
}
}
}

View file

@ -977,12 +977,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) :
});
connect(this, &Application::applicationStateChanged, this, &Application::activeChanged);
// FIXME -- NOTE: This will call ProcessEvents() which can cause authentication signals to fire, which
// if not logged in can cause the login dialog to appear. As currently implemented, the login requires
// the offscreen UI to render, so this needs to be well after OffscreenUi is available
_runningScriptsWidget = new RunningScriptsWidget(_window);
qCDebug(interfaceapp, "Startup time: %4.2f seconds.", (double)startupTimer.elapsed() / 1000.0);
}
@ -1208,6 +1202,9 @@ void Application::initializeUi() {
qApp->quit();
});
// For some reason there is already an "Application" object in the QML context,
// though I can't find it. Hence, "ApplicationInterface"
rootContext->setContextProperty("ApplicationInterface", this);
rootContext->setContextProperty("AnimationCache", DependencyManager::get<AnimationCache>().data());
rootContext->setContextProperty("Audio", &AudioScriptingInterface::getInstance());
rootContext->setContextProperty("Controller", DependencyManager::get<controller::ScriptingInterface>().data());

View file

@ -245,8 +245,8 @@ public slots:
bool importEntities(const QString& url);
void setLowVelocityFilter(bool lowVelocityFilter);
void loadDialog();
void loadScriptURLDialog();
Q_INVOKABLE void loadDialog();
Q_INVOKABLE void loadScriptURLDialog();
void toggleLogDialog();
void toggleRunningScriptsWidget();