Showing the changes to interface/src/scripting/WindowScriptingInterface.cpp (1 of 20 files). Show all
Unified · Split
| @@ -15,12 +15,13 @@ · 14 unmodified lines | ||
| 15 | 15 | #include <QtCore/QDir> |
| 16 | 16 | #include <QMessageBox> |
| 17 | 17 | #include <QScriptValue> |
| 18 | − | |
| 18 | +#include <QtGui/QDesktopServices> | |
| 19 | 19 | #include <shared/QtHelpers.h> |
| 20 | 20 | #include <SettingHandle.h> |
| 21 | 21 | |
| 22 | 22 | #include <display-plugins/CompositorHelper.h> |
| 23 | − | |
| 23 | +#include <AddressManager.h> | |
| 24 | +#include "AndroidHelper.h" | |
| 24 | 25 | #include "Application.h" |
| 25 | 26 | #include "DomainHandler.h" |
| 26 | 27 | #include "MainWindow.h" |
| @@ -131,6 +132,24 @@ void WindowScriptingInterface::disconnectedFromDomain() { · 104 unmodified lines | ||
| 131 | 132 | emit domainChanged(QUrl()); |
| 132 | 133 | } |
| 133 | 134 | |
| 135 | +void WindowScriptingInterface::openUrl(const QUrl& url) { | |
| 136 | + if (!url.isEmpty()) { | |
| 137 | + if (url.scheme() == URL_SCHEME_HIFI) { | |
| 138 | + DependencyManager::get<AddressManager>()->handleLookupString(url.toString()); | |
| 139 | + } else { | |
| 140 | + // address manager did not handle - ask QDesktopServices to handle | |
| 141 | + QDesktopServices::openUrl(url); | |
| 142 | + } | |
| 143 | + } | |
| 144 | +} | |
| 145 | + | |
| 146 | +void WindowScriptingInterface::openAndroidActivity(const QString& activityName, const bool backToScene) { | |
| 147 | +#if defined(Q_OS_ANDROID) | |
| 148 | + AndroidHelper::instance().requestActivity(activityName, backToScene); | |
| 149 | +#endif | |
| 150 | +} | |
| 151 | + | |
| 152 | + | |
| 134 | 153 | QString fixupPathForMac(const QString& directory) { |
| 135 | 154 | // On OS X `directory` does not work as expected unless a file is included in the path, so we append a bogus |
| 136 | 155 | // filename if the directory is valid. |