Showing the changes to interface/src/scripting/WindowScriptingInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -34,8 +34,19 @@ WindowScriptingInterface::WindowScriptingInterface() : · 33 unmodified lines | |||
| 34 | { | 34 | { |
| 35 | const DomainHandler& domainHandler = DependencyManager::get<NodeList>()->getDomainHandler(); | 35 | const DomainHandler& domainHandler = DependencyManager::get<NodeList>()->getDomainHandler(); |
| 36 | connect(&domainHandler, &DomainHandler::connectedToDomain, this, &WindowScriptingInterface::domainChanged); | 36 | connect(&domainHandler, &DomainHandler::connectedToDomain, this, &WindowScriptingInterface::domainChanged); |
| 37 | connect(qApp, &Application::svoImportRequested, this, &WindowScriptingInterface::svoImportRequested); | ||
| 38 | connect(qApp, &Application::domainConnectionRefused, this, &WindowScriptingInterface::domainConnectionRefused); | 37 | connect(qApp, &Application::domainConnectionRefused, this, &WindowScriptingInterface::domainConnectionRefused); |
| 38 | |||
| 39 | connect(qApp, &Application::svoImportRequested, [this](const QString& urlString) { | ||
| 40 | static const QMetaMethod svoImportRequestedSignal = | ||
| 41 | QMetaMethod::fromSignal(&WindowScriptingInterface::svoImportRequested); | ||
| 42 | |||
| 43 | if (isSignalConnected(svoImportRequestedSignal)) { | ||
| 44 | QUrl url(urlString); | ||
| 45 | emit svoImportRequested(url.url()); | ||
| 46 | } else { | ||
| 47 | OffscreenUi::warning("Import SVO Error", "You need to be running edit.js to import entities."); | ||
| 48 | } | ||
| 49 | }); | ||
| 39 | } | 50 | } |
| 40 | 51 | ||
| 41 | WebWindowClass* WindowScriptingInterface::doCreateWebWindow(const QString& title, const QString& url, int width, int height) { | 52 | WebWindowClass* WindowScriptingInterface::doCreateWebWindow(const QString& title, const QString& url, int width, int height) { |