History

expose to scripts the ability to show dedicated qml windows such as preferences

howard-stearns committed 10 years ago

Commit 347b20e1 parent 2a099d52 files · +11 −0Browse files

Showing the changes to interface/src/scripting/DesktopScriptingInterface.cpp (1 of 2 files). Show all

Unified · Split

interface/src/scripting/DesktopScriptingInterface.cpp+10−0
@@ -17,6 +17,8 @@ · 16 unmodified lines
1717 #include "Application.h"
1818 #include "MainWindow.h"
1919 #include <display-plugins/CompositorHelper.h>
20+#include <DependencyManager.h>
21+#include <OffscreenUi.h>
2022
2123 int DesktopScriptingInterface::getWidth() {
2224 QSize size = qApp->getWindow()->windowHandle()->screen()->virtualSize();
@@ -31,3 +33,11 @@ void DesktopScriptingInterface::setOverlayAlpha(float alpha) { · 8 unmodified lines
3133 qApp->getApplicationCompositor().setAlpha(alpha);
3234 }
3335
36+void DesktopScriptingInterface::show(const QString& path, const QString& title) {
37+ if (QThread::currentThread() != thread()) {
38+ QMetaObject::invokeMethod(this, "show", Qt::QueuedConnection, Q_ARG(QString, path), Q_ARG(QString, title));
39+ return;
40+ }
41+ DependencyManager::get<OffscreenUi>()->show(path, title);
42+}
43+