mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 07:53:08 +02:00
Final functionality for running scripts
This commit is contained in:
parent
a9eb5b8229
commit
dcc6739bce
3 changed files with 43 additions and 13 deletions
|
@ -47,8 +47,6 @@ Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Settings {
|
Settings {
|
||||||
category: "Overlay.RunningScripts"
|
category: "Overlay.RunningScripts"
|
||||||
property alias x: root.x
|
property alias x: root.x
|
||||||
|
@ -187,10 +185,13 @@ Window {
|
||||||
anchors.bottom: filterEdit.top
|
anchors.bottom: filterEdit.top
|
||||||
anchors.bottomMargin: 8
|
anchors.bottomMargin: 8
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
Button { text: "from URL" }
|
Button {
|
||||||
|
text: "from URL";
|
||||||
|
onClicked: ApplicationInterface.loadScriptURLDialog();
|
||||||
|
}
|
||||||
Button {
|
Button {
|
||||||
text: "from Disk"
|
text: "from Disk"
|
||||||
onClicked: fileDialogCreator.createObject(root);
|
onClicked: ApplicationInterface.loadDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,7 +208,8 @@ Window {
|
||||||
TreeView {
|
TreeView {
|
||||||
id: treeView
|
id: treeView
|
||||||
height: 128
|
height: 128
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: loadButton.top
|
||||||
|
anchors.bottomMargin: 8
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
headerVisible: false
|
headerVisible: false
|
||||||
|
@ -232,6 +234,37 @@ Window {
|
||||||
model: scriptsModel
|
model: scriptsModel
|
||||||
TableViewColumn { title: "Name"; role: "display"; }
|
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 != ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -977,12 +977,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) :
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(this, &Application::applicationStateChanged, this, &Application::activeChanged);
|
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);
|
qCDebug(interfaceapp, "Startup time: %4.2f seconds.", (double)startupTimer.elapsed() / 1000.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1208,6 +1202,9 @@ void Application::initializeUi() {
|
||||||
qApp->quit();
|
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("AnimationCache", DependencyManager::get<AnimationCache>().data());
|
||||||
rootContext->setContextProperty("Audio", &AudioScriptingInterface::getInstance());
|
rootContext->setContextProperty("Audio", &AudioScriptingInterface::getInstance());
|
||||||
rootContext->setContextProperty("Controller", DependencyManager::get<controller::ScriptingInterface>().data());
|
rootContext->setContextProperty("Controller", DependencyManager::get<controller::ScriptingInterface>().data());
|
||||||
|
|
|
@ -245,8 +245,8 @@ public slots:
|
||||||
bool importEntities(const QString& url);
|
bool importEntities(const QString& url);
|
||||||
|
|
||||||
void setLowVelocityFilter(bool lowVelocityFilter);
|
void setLowVelocityFilter(bool lowVelocityFilter);
|
||||||
void loadDialog();
|
Q_INVOKABLE void loadDialog();
|
||||||
void loadScriptURLDialog();
|
Q_INVOKABLE void loadScriptURLDialog();
|
||||||
void toggleLogDialog();
|
void toggleLogDialog();
|
||||||
void toggleRunningScriptsWidget();
|
void toggleRunningScriptsWidget();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue