Showing the changes to interface/src/Application.cpp (1 of 476 files). Show all
Unified · Split
| @@ -30,6 +30,7 @@ · 29 unmodified lines | ||
| 30 | 30 | #include <QtCore/QFileSelector> |
| 31 | 31 | #include <QtConcurrent/QtConcurrentRun> |
| 32 | 32 | |
| 33 | +#include <QtGui/QClipboard> | |
| 33 | 34 | #include <QtGui/QScreen> |
| 34 | 35 | #include <QtGui/QWindow> |
| 35 | 36 | #include <QtGui/QDesktopServices> |
| @@ -62,6 +63,7 @@ · 26 unmodified lines | ||
| 62 | 63 | #include <AddressManager.h> |
| 63 | 64 | #include <AnimDebugDraw.h> |
| 64 | 65 | #include <BuildInfo.h> |
| 66 | +#include <AnimationCacheScriptingInterface.h> | |
| 65 | 67 | #include <AssetClient.h> |
| 66 | 68 | #include <AssetUpload.h> |
| 67 | 69 | #include <AutoUpdater.h> |
| @@ -97,6 +99,8 @@ · 29 unmodified lines | ||
| 97 | 99 | #include <MainWindow.h> |
| 98 | 100 | #include <MappingRequest.h> |
| 99 | 101 | #include <MessagesClient.h> |
| 102 | +#include <model-networking/ModelCacheScriptingInterface.h> | |
| 103 | +#include <model-networking/TextureCacheScriptingInterface.h> | |
| 100 | 104 | #include <ModelEntityItem.h> |
| 101 | 105 | #include <NetworkAccessManager.h> |
| 102 | 106 | #include <NetworkingConstants.h> |
| @@ -126,9 +130,10 @@ · 23 unmodified lines | ||
| 126 | 130 | #include <ScriptEngines.h> |
| 127 | 131 | #include <ScriptCache.h> |
| 128 | 132 | #include <ShapeEntityItem.h> |
| 129 | −#include <SoundCache.h> | |
| 133 | +#include <SoundCacheScriptingInterface.h> | |
| 130 | 134 | #include <ui/TabletScriptingInterface.h> |
| 131 | 135 | #include <ui/ToolbarScriptingInterface.h> |
| 136 | +#include <InteractiveWindow.h> | |
| 132 | 137 | #include <Tooltip.h> |
| 133 | 138 | #include <udt/PacketHeaders.h> |
| 134 | 139 | #include <UserActivityLogger.h> |
| @@ -141,6 +146,7 @@ · 6 unmodified lines | ||
| 141 | 146 | #include <QmlFragmentClass.h> |
| 142 | 147 | #include <Preferences.h> |
| 143 | 148 | #include <display-plugins/CompositorHelper.h> |
| 149 | +#include <display-plugins/hmd/HmdDisplayPlugin.h> | |
| 144 | 150 | #include <trackers/EyeTracker.h> |
| 145 | 151 | #include <avatars-renderer/ScriptAvatar.h> |
| 146 | 152 | #include <RenderableEntityItem.h> |
| @@ -864,16 +870,20 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 717 unmodified lines | ||
| 864 | 870 | DependencyManager::set<recording::ClipCache>(); |
| 865 | 871 | DependencyManager::set<GeometryCache>(); |
| 866 | 872 | DependencyManager::set<ModelCache>(); |
| 873 | + DependencyManager::set<ModelCacheScriptingInterface>(); | |
| 867 | 874 | DependencyManager::set<ScriptCache>(); |
| 868 | 875 | DependencyManager::set<SoundCache>(); |
| 876 | + DependencyManager::set<SoundCacheScriptingInterface>(); | |
| 869 | 877 | DependencyManager::set<DdeFaceTracker>(); |
| 870 | 878 | DependencyManager::set<EyeTracker>(); |
| 871 | 879 | DependencyManager::set<AudioClient>(); |
| 872 | 880 | DependencyManager::set<AudioScope>(); |
| 873 | 881 | DependencyManager::set<DeferredLightingEffect>(); |
| 874 | 882 | DependencyManager::set<TextureCache>(); |
| 883 | + DependencyManager::set<TextureCacheScriptingInterface>(); | |
| 875 | 884 | DependencyManager::set<FramebufferCache>(); |
| 876 | 885 | DependencyManager::set<AnimationCache>(); |
| 886 | + DependencyManager::set<AnimationCacheScriptingInterface>(); | |
| 877 | 887 | DependencyManager::set<ModelBlender>(); |
| 878 | 888 | DependencyManager::set<UsersScriptingInterface>(); |
| 879 | 889 | DependencyManager::set<AvatarManager>(); |
| @@ -1072,6 +1082,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 192 unmodified lines | ||
| 1072 | 1082 | QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/Raleway-Regular.ttf"); |
| 1073 | 1083 | QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/Raleway-Bold.ttf"); |
| 1074 | 1084 | QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/Raleway-SemiBold.ttf"); |
| 1085 | + QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/Cairo-SemiBold.ttf"); | |
| 1075 | 1086 | _window->setWindowTitle("High Fidelity Interface"); |
| 1076 | 1087 | |
| 1077 | 1088 | Model::setAbstractViewStateInterface(this); // The model class will sometimes need to know view state details from us |
| @@ -1449,8 +1460,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 371 unmodified lines | ||
| 1449 | 1460 | // add firstRun flag from settings to launch event |
| 1450 | 1461 | Setting::Handle<bool> firstRun { Settings::firstRun, true }; |
| 1451 | 1462 | |
| 1452 | − QString machineFingerPrint = uuidStringWithoutCurlyBraces(FingerprintUtils::getMachineFingerprint()); | |
| 1453 | − | |
| 1454 | 1463 | auto& userActivityLogger = UserActivityLogger::getInstance(); |
| 1455 | 1464 | if (userActivityLogger.isEnabled()) { |
| 1456 | 1465 | // sessionRunTime will be reset soon by loadSettings. Grab it now to get previous session value. |
| @@ -1502,13 +1511,12 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 45 unmodified lines | ||
| 1502 | 1511 | properties["first_run"] = firstRun.get(); |
| 1503 | 1512 | |
| 1504 | 1513 | // add the user's machine ID to the launch event |
| 1514 | + QString machineFingerPrint = uuidStringWithoutCurlyBraces(FingerprintUtils::getMachineFingerprint()); | |
| 1505 | 1515 | properties["machine_fingerprint"] = machineFingerPrint; |
| 1506 | 1516 | |
| 1507 | 1517 | userActivityLogger.logAction("launch", properties); |
| 1508 | 1518 | } |
| 1509 | 1519 | |
| 1510 | − setCrashAnnotation("machine_fingerprint", machineFingerPrint.toStdString()); | |
| 1511 | − | |
| 1512 | 1520 | _entityEditSender.setMyAvatar(myAvatar.get()); |
| 1513 | 1521 | |
| 1514 | 1522 | // The entity octree will have to know about MyAvatar for the parentJointName import |
| @@ -2130,6 +2138,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 615 unmodified lines | ||
| 2130 | 2138 | || ((rightHandPose.valid || lastRightHandPose.valid) && (rightHandPose != lastRightHandPose)); |
| 2131 | 2139 | lastLeftHandPose = leftHandPose; |
| 2132 | 2140 | lastRightHandPose = rightHandPose; |
| 2141 | + properties["avatar_identity_requests_sent"] = DependencyManager::get<AvatarManager>()->getIdentityRequestsSent(); | |
| 2133 | 2142 | |
| 2134 | 2143 | UserActivityLogger::getInstance().logAction("stats", properties); |
| 2135 | 2144 | }); |
| @@ -2266,6 +2275,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 130 unmodified lines | ||
| 2266 | 2275 | qCDebug(interfaceapp) << "Metaverse session ID is" << uuidStringWithoutCurlyBraces(accountManager->getSessionID()); |
| 2267 | 2276 | |
| 2268 | 2277 | #if defined(Q_OS_ANDROID) |
| 2278 | + connect(&AndroidHelper::instance(), &AndroidHelper::beforeEnterBackground, this, &Application::beforeEnterBackground); | |
| 2269 | 2279 | connect(&AndroidHelper::instance(), &AndroidHelper::enterBackground, this, &Application::enterBackground); |
| 2270 | 2280 | connect(&AndroidHelper::instance(), &AndroidHelper::enterForeground, this, &Application::enterForeground); |
| 2271 | 2281 | AndroidHelper::instance().notifyLoadComplete(); |
| @@ -2575,12 +2585,18 @@ Application::~Application() { · 303 unmodified lines | ||
| 2575 | 2585 | |
| 2576 | 2586 | DependencyManager::destroy<CompositorHelper>(); // must be destroyed before the FramebufferCache |
| 2577 | 2587 | |
| 2588 | + DependencyManager::destroy<SoundCacheScriptingInterface>(); | |
| 2589 | + | |
| 2578 | 2590 | DependencyManager::destroy<AvatarManager>(); |
| 2591 | + DependencyManager::destroy<AnimationCacheScriptingInterface>(); | |
| 2579 | 2592 | DependencyManager::destroy<AnimationCache>(); |
| 2580 | 2593 | DependencyManager::destroy<FramebufferCache>(); |
| 2594 | + DependencyManager::destroy<TextureCacheScriptingInterface>(); | |
| 2581 | 2595 | DependencyManager::destroy<TextureCache>(); |
| 2596 | + DependencyManager::destroy<ModelCacheScriptingInterface>(); | |
| 2582 | 2597 | DependencyManager::destroy<ModelCache>(); |
| 2583 | 2598 | DependencyManager::destroy<ScriptCache>(); |
| 2599 | + DependencyManager::destroy<SoundCacheScriptingInterface>(); | |
| 2584 | 2600 | DependencyManager::destroy<SoundCache>(); |
| 2585 | 2601 | DependencyManager::destroy<OctreeStatsProvider>(); |
| 2586 | 2602 | DependencyManager::destroy<GeometryCache>(); |
| @@ -2730,6 +2746,10 @@ void Application::initializeDisplayPlugins() { · 143 unmodified lines | ||
| 2730 | 2746 | QObject::connect(displayPlugin.get(), &DisplayPlugin::recommendedFramebufferSizeChanged, |
| 2731 | 2747 | [this](const QSize& size) { resizeGL(); }); |
| 2732 | 2748 | QObject::connect(displayPlugin.get(), &DisplayPlugin::resetSensorsRequested, this, &Application::requestReset); |
| 2749 | + if (displayPlugin->isHmd()) { | |
| 2750 | + QObject::connect(dynamic_cast<HmdDisplayPlugin*>(displayPlugin.get()), &HmdDisplayPlugin::hmdMountedChanged, | |
| 2751 | + DependencyManager::get<HMDScriptingInterface>().data(), &HMDScriptingInterface::mountedChanged); | |
| 2752 | + } | |
| 2733 | 2753 | } |
| 2734 | 2754 | |
| 2735 | 2755 | // The default display plugin needs to be activated first, otherwise the display plugin thread |
| @@ -2994,6 +3014,7 @@ void Application::onDesktopRootContextCreated(QQmlContext* surfaceContext) { · 258 unmodified lines | ||
| 2994 | 3014 | |
| 2995 | 3015 | surfaceContext->setContextProperty("Overlays", &_overlays); |
| 2996 | 3016 | surfaceContext->setContextProperty("Window", DependencyManager::get<WindowScriptingInterface>().data()); |
| 3017 | + surfaceContext->setContextProperty("Desktop", DependencyManager::get<DesktopScriptingInterface>().data()); | |
| 2997 | 3018 | surfaceContext->setContextProperty("MenuInterface", MenuScriptingInterface::getInstance()); |
| 2998 | 3019 | surfaceContext->setContextProperty("Settings", SettingsScriptingInterface::getInstance()); |
| 2999 | 3020 | surfaceContext->setContextProperty("ScriptDiscoveryService", DependencyManager::get<ScriptEngines>().data()); |
| @@ -3001,10 +3022,11 @@ void Application::onDesktopRootContextCreated(QQmlContext* surfaceContext) { · 1 unmodified line | ||
| 3001 | 3022 | surfaceContext->setContextProperty("LocationBookmarks", DependencyManager::get<LocationBookmarks>().data()); |
| 3002 | 3023 | |
| 3003 | 3024 | // Caches |
| 3004 | − surfaceContext->setContextProperty("AnimationCache", DependencyManager::get<AnimationCache>().data()); | |
| 3005 | − surfaceContext->setContextProperty("TextureCache", DependencyManager::get<TextureCache>().data()); | |
| 3006 | − surfaceContext->setContextProperty("ModelCache", DependencyManager::get<ModelCache>().data()); | |
| 3007 | − surfaceContext->setContextProperty("SoundCache", DependencyManager::get<SoundCache>().data()); | |
| 3025 | + surfaceContext->setContextProperty("AnimationCache", DependencyManager::get<AnimationCacheScriptingInterface>().data()); | |
| 3026 | + surfaceContext->setContextProperty("TextureCache", DependencyManager::get<TextureCacheScriptingInterface>().data()); | |
| 3027 | + surfaceContext->setContextProperty("ModelCache", DependencyManager::get<ModelCacheScriptingInterface>().data()); | |
| 3028 | + surfaceContext->setContextProperty("SoundCache", DependencyManager::get<SoundCacheScriptingInterface>().data()); | |
| 3029 | + | |
| 3008 | 3030 | surfaceContext->setContextProperty("InputConfiguration", DependencyManager::get<InputConfiguration>().data()); |
| 3009 | 3031 | |
| 3010 | 3032 | surfaceContext->setContextProperty("Account", AccountServicesScriptingInterface::getInstance()); // DEPRECATED - TO BE REMOVED |
| @@ -3233,6 +3255,7 @@ void Application::setSettingConstrainToolbarPosition(bool setting) { · 222 unmodified lines | ||
| 3233 | 3255 | void Application::showHelp() { |
| 3234 | 3256 | static const QString HAND_CONTROLLER_NAME_VIVE = "vive"; |
| 3235 | 3257 | static const QString HAND_CONTROLLER_NAME_OCULUS_TOUCH = "oculus"; |
| 3258 | + static const QString HAND_CONTROLLER_NAME_WINDOWS_MR = "windowsMR"; | |
| 3236 | 3259 | |
| 3237 | 3260 | static const QString TAB_KEYBOARD_MOUSE = "kbm"; |
| 3238 | 3261 | static const QString TAB_GAMEPAD = "gamepad"; |
| @@ -3247,9 +3270,13 @@ void Application::showHelp() { · 8 unmodified lines | ||
| 3247 | 3270 | } else if (PluginUtils::isOculusTouchControllerAvailable()) { |
| 3248 | 3271 | defaultTab = TAB_HAND_CONTROLLERS; |
| 3249 | 3272 | handControllerName = HAND_CONTROLLER_NAME_OCULUS_TOUCH; |
| 3273 | + } else if (qApp->getActiveDisplayPlugin()->getName() == "WindowMS") { | |
| 3274 | + defaultTab = TAB_HAND_CONTROLLERS; | |
| 3275 | + handControllerName = HAND_CONTROLLER_NAME_WINDOWS_MR; | |
| 3250 | 3276 | } else if (PluginUtils::isXboxControllerAvailable()) { |
| 3251 | 3277 | defaultTab = TAB_GAMEPAD; |
| 3252 | 3278 | } |
| 3279 | + // TODO need some way to detect windowsMR to load controls reference default tab in Help > Controls Reference menu. | |
| 3253 | 3280 | |
| 3254 | 3281 | QUrlQuery queryString; |
| 3255 | 3282 | queryString.addQueryItem("handControllerName", handControllerName); |
| @@ -3274,13 +3301,22 @@ void Application::resizeGL() { · 18 unmodified lines | ||
| 3274 | 3301 | // Set the desired FBO texture size. If it hasn't changed, this does nothing. |
| 3275 | 3302 | // Otherwise, it must rebuild the FBOs |
| 3276 | 3303 | uvec2 framebufferSize = displayPlugin->getRecommendedRenderSize(); |
| 3277 | − float renderResolutionScale = getRenderResolutionScale(); | |
| 3278 | − uvec2 renderSize = uvec2(vec2(framebufferSize) * renderResolutionScale); | |
| 3304 | + uvec2 renderSize = uvec2(framebufferSize); | |
| 3279 | 3305 | if (_renderResolution != renderSize) { |
| 3280 | 3306 | _renderResolution = renderSize; |
| 3281 | 3307 | DependencyManager::get<FramebufferCache>()->setFrameBufferSize(fromGlm(renderSize)); |
| 3282 | 3308 | } |
| 3283 | 3309 | |
| 3310 | + auto renderResolutionScale = getRenderResolutionScale(); | |
| 3311 | + if (displayPlugin->getRenderResolutionScale() != renderResolutionScale) { | |
| 3312 | + auto renderConfig = _renderEngine->getConfiguration(); | |
| 3313 | + assert(renderConfig); | |
| 3314 | + auto mainView = renderConfig->getConfig("RenderMainView.RenderDeferredTask"); | |
| 3315 | + assert(mainView); | |
| 3316 | + mainView->setProperty("resolutionScale", renderResolutionScale); | |
| 3317 | + displayPlugin->setRenderResolutionScale(renderResolutionScale); | |
| 3318 | + } | |
| 3319 | + | |
| 3284 | 3320 | // FIXME the aspect ratio for stereo displays is incorrect based on this. |
| 3285 | 3321 | float aspectRatio = displayPlugin->getRecommendedAspectRatio(); |
| 3286 | 3322 | _myCamera.setProjection(glm::perspective(glm::radians(_fieldOfView.get()), aspectRatio, |
| @@ -3292,7 +3328,6 @@ void Application::resizeGL() { · 5 unmodified lines | ||
| 3292 | 3328 | } |
| 3293 | 3329 | |
| 3294 | 3330 | DependencyManager::get<OffscreenUi>()->resize(fromGlm(displayPlugin->getRecommendedUiSize())); |
| 3295 | − displayPlugin->setRenderResolutionScale(renderResolutionScale); | |
| 3296 | 3331 | } |
| 3297 | 3332 | |
| 3298 | 3333 | void Application::handleSandboxStatus(QNetworkReply* reply) { |
| @@ -3652,6 +3687,10 @@ bool Application::event(QEvent* event) { · 353 unmodified lines | ||
| 3652 | 3687 | |
| 3653 | 3688 | bool Application::eventFilter(QObject* object, QEvent* event) { |
| 3654 | 3689 | |
| 3690 | + if (_aboutToQuit) { | |
| 3691 | + return true; | |
| 3692 | + } | |
| 3693 | + | |
| 3655 | 3694 | if (event->type() == QEvent::Leave) { |
| 3656 | 3695 | getApplicationCompositor().handleLeaveEvent(); |
| 3657 | 3696 | } |
| @@ -4031,7 +4070,18 @@ void Application::mousePressEvent(QMouseEvent* event) { · 373 unmodified lines | ||
| 4031 | 4070 | return; |
| 4032 | 4071 | } |
| 4033 | 4072 | |
| 4073 | +#if defined(Q_OS_MAC) | |
| 4074 | + // Fix for OSX right click dragging on window when coming from a native window | |
| 4075 | + bool isFocussed = hasFocus(); | |
| 4076 | + if (!isFocussed && event->button() == Qt::MouseButton::RightButton) { | |
| 4077 | + setFocus(); | |
| 4078 | + isFocussed = true; | |
| 4079 | + } | |
| 4080 | + | |
| 4081 | + if (isFocussed) { | |
| 4082 | +#else | |
| 4034 | 4083 | if (hasFocus()) { |
| 4084 | +#endif | |
| 4035 | 4085 | if (_keyboardMouseDevice->isActive()) { |
| 4036 | 4086 | _keyboardMouseDevice->mousePressEvent(event); |
| 4037 | 4087 | } |
| @@ -4818,6 +4868,7 @@ void Application::loadSettings() { · 780 unmodified lines | ||
| 4818 | 4868 | } |
| 4819 | 4869 | |
| 4820 | 4870 | isFirstPerson = (qApp->isHMDMode()); |
| 4871 | + | |
| 4821 | 4872 | } else { |
| 4822 | 4873 | // if this is not the first run, the camera will be initialized differently depending on user settings |
| 4823 | 4874 | |
| @@ -5265,7 +5316,7 @@ void Application::setKeyboardFocusHighlight(const glm::vec3& position, const glm · 441 unmodified lines | ||
| 5265 | 5316 | _keyboardFocusHighlight->setPulseMin(0.5); |
| 5266 | 5317 | _keyboardFocusHighlight->setPulseMax(1.0); |
| 5267 | 5318 | _keyboardFocusHighlight->setColorPulse(1.0); |
| 5268 | − _keyboardFocusHighlight->setIgnoreRayIntersection(true); | |
| 5319 | + _keyboardFocusHighlight->setIgnorePickIntersection(true); | |
| 5269 | 5320 | _keyboardFocusHighlight->setDrawInFront(false); |
| 5270 | 5321 | _keyboardFocusHighlightID = getOverlays().addOverlay(_keyboardFocusHighlight); |
| 5271 | 5322 | } |
| @@ -6169,6 +6220,9 @@ PickRay Application::computePickRay(float x, float y) const { · 897 unmodified lines | ||
| 6169 | 6220 | getApplicationCompositor().computeHmdPickRay(pickPoint, result.origin, result.direction); |
| 6170 | 6221 | } else { |
| 6171 | 6222 | pickPoint /= getCanvasSize(); |
| 6223 | + if (_myCamera.getMode() == CameraMode::CAMERA_MODE_MIRROR) { | |
| 6224 | + pickPoint.x = 1.0f - pickPoint.x; | |
| 6225 | + } | |
| 6172 | 6226 | QMutexLocker viewLocker(&_viewMutex); |
| 6173 | 6227 | _viewFrustum.computePickRay(pickPoint.x, pickPoint.y, result.origin, result.direction); |
| 6174 | 6228 | } |
| @@ -6504,9 +6558,6 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe · 329 unmodified lines | ||
| 6504 | 6558 | entityScriptingInterface->setPacketSender(&_entityEditSender); |
| 6505 | 6559 | entityScriptingInterface->setEntityTree(getEntities()->getTree()); |
| 6506 | 6560 | |
| 6507 | − // give the script engine to the RecordingScriptingInterface for its callbacks | |
| 6508 | − DependencyManager::get<RecordingScriptingInterface>()->setScriptEngine(scriptEngine); | |
| 6509 | − | |
| 6510 | 6561 | if (property(hifi::properties::TEST).isValid()) { |
| 6511 | 6562 | scriptEngine->registerGlobalObject("Test", TestScriptingInterface::getInstance()); |
| 6512 | 6563 | } |
| @@ -6580,10 +6631,10 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe · 67 unmodified lines | ||
| 6580 | 6631 | scriptEngine->registerGlobalObject("Pointers", DependencyManager::get<PointerScriptingInterface>().data()); |
| 6581 | 6632 | |
| 6582 | 6633 | // Caches |
| 6583 | − scriptEngine->registerGlobalObject("AnimationCache", DependencyManager::get<AnimationCache>().data()); | |
| 6584 | − scriptEngine->registerGlobalObject("TextureCache", DependencyManager::get<TextureCache>().data()); | |
| 6585 | − scriptEngine->registerGlobalObject("ModelCache", DependencyManager::get<ModelCache>().data()); | |
| 6586 | − scriptEngine->registerGlobalObject("SoundCache", DependencyManager::get<SoundCache>().data()); | |
| 6634 | + scriptEngine->registerGlobalObject("AnimationCache", DependencyManager::get<AnimationCacheScriptingInterface>().data()); | |
| 6635 | + scriptEngine->registerGlobalObject("TextureCache", DependencyManager::get<TextureCacheScriptingInterface>().data()); | |
| 6636 | + scriptEngine->registerGlobalObject("ModelCache", DependencyManager::get<ModelCacheScriptingInterface>().data()); | |
| 6637 | + scriptEngine->registerGlobalObject("SoundCache", DependencyManager::get<SoundCacheScriptingInterface>().data()); | |
| 6587 | 6638 | |
| 6588 | 6639 | scriptEngine->registerGlobalObject("DialogsManager", _dialogsManagerScriptingInterface); |
| 6589 | 6640 | |
| @@ -6642,6 +6693,8 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe · 52 unmodified lines | ||
| 6642 | 6693 | |
| 6643 | 6694 | qScriptRegisterMetaType(scriptEngine.data(), OverlayIDtoScriptValue, OverlayIDfromScriptValue); |
| 6644 | 6695 | |
| 6696 | + registerInteractiveWindowMetaType(scriptEngine.data()); | |
| 6697 | + | |
| 6645 | 6698 | DependencyManager::get<PickScriptingInterface>()->registerMetaTypes(scriptEngine.data()); |
| 6646 | 6699 | |
| 6647 | 6700 | // connect this script engines printedMessage signal to the global ScriptEngines these various messages |
| @@ -7622,7 +7675,6 @@ void Application::toggleEntityScriptServerLogDialog() { · 974 unmodified lines | ||
| 7622 | 7675 | |
| 7623 | 7676 | void Application::loadAddAvatarBookmarkDialog() const { |
| 7624 | 7677 | auto avatarBookmarks = DependencyManager::get<AvatarBookmarks>(); |
| 7625 | − avatarBookmarks->addBookmark(); | |
| 7626 | 7678 | } |
| 7627 | 7679 | |
| 7628 | 7680 | void Application::loadAvatarBrowser() const { |
| @@ -8304,7 +8356,24 @@ void Application::saveNextPhysicsStats(QString filename) { · 675 unmodified lines | ||
| 8304 | 8356 | _physicsEngine->saveNextPhysicsStats(filename); |
| 8305 | 8357 | } |
| 8306 | 8358 | |
| 8359 | +void Application::copyToClipboard(const QString& text) { | |
| 8360 | + if (QThread::currentThread() != qApp->thread()) { | |
| 8361 | + QMetaObject::invokeMethod(this, "copyToClipboard"); | |
| 8362 | + return; | |
| 8363 | + } | |
| 8364 | + | |
| 8365 | + // assume that the address is being copied because the user wants a shareable address | |
| 8366 | + QApplication::clipboard()->setText(text); | |
| 8367 | +} | |
| 8368 | + | |
| 8307 | 8369 | #if defined(Q_OS_ANDROID) |
| 8370 | +void Application::beforeEnterBackground() { | |
| 8371 | + auto nodeList = DependencyManager::get<NodeList>(); | |
| 8372 | + nodeList->setSendDomainServerCheckInEnabled(false); | |
| 8373 | + nodeList->reset(true); | |
| 8374 | + clearDomainOctreeDetails(); | |
| 8375 | +} | |
| 8376 | + | |
| 8308 | 8377 | void Application::enterBackground() { |
| 8309 | 8378 | QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(), |
| 8310 | 8379 | "stop", Qt::BlockingQueuedConnection); |
| @@ -8319,6 +8388,8 @@ void Application::enterForeground() { · 8 unmodified lines | ||
| 8319 | 8388 | if (!getActiveDisplayPlugin() || getActiveDisplayPlugin()->isActive() || !getActiveDisplayPlugin()->activate()) { |
| 8320 | 8389 | qWarning() << "Could not re-activate display plugin"; |
| 8321 | 8390 | } |
| 8391 | + auto nodeList = DependencyManager::get<NodeList>(); | |
| 8392 | + nodeList->setSendDomainServerCheckInEnabled(true); | |
| 8322 | 8393 | } |
| 8323 | 8394 | #endif |
| 8324 | 8395 | |