Showing the changes to interface/src/scripting/WindowScriptingInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -645,12 +645,16 @@ void WindowScriptingInterface::setActiveDisplayPlugin(int index) { · 644 unmodified lines | |||
| 645 | qApp->setActiveDisplayPlugin(name); | 645 | qApp->setActiveDisplayPlugin(name); |
| 646 | } | 646 | } |
| 647 | 647 | ||
| 648 | void WindowScriptingInterface::openWebBrowser() { | 648 | void WindowScriptingInterface::openWebBrowser(const QString& url) { |
| 649 | if (QThread::currentThread() != thread()) { | 649 | if (QThread::currentThread() != thread()) { |
| 650 | QMetaObject::invokeMethod(this, "openWebBrowser", Qt::QueuedConnection); | 650 | QMetaObject::invokeMethod(this, "openWebBrowser", Q_ARG(const QString&, url)); |
| 651 | return; | 651 | return; |
| 652 | } | 652 | } |
| 653 | 653 | ||
| 654 | auto offscreenUi = DependencyManager::get<OffscreenUi>(); | 654 | auto offscreenUi = DependencyManager::get<OffscreenUi>(); |
| 655 | offscreenUi->load("Browser.qml"); | 655 | offscreenUi->load("Browser.qml", [=](QQmlContext* context, QObject* newObject) { |
| 656 | if (!url.isEmpty()) { | ||
| 657 | newObject->setProperty("url", url); | ||
| 658 | } | ||
| 659 | }); | ||
| 656 | } | 660 | } |