Showing the changes to interface/src/Application.cpp (1 of 141 files). Show all
Unified · Split
| @@ -69,6 +69,7 @@ · 68 unmodified lines | ||
| 69 | 69 | #include <EntityScriptClient.h> |
| 70 | 70 | #include <EntityScriptServerLogClient.h> |
| 71 | 71 | #include <EntityScriptingInterface.h> |
| 72 | +#include <HoverOverlayInterface.h> | |
| 72 | 73 | #include <ErrorDialog.h> |
| 73 | 74 | #include <FileScriptingInterface.h> |
| 74 | 75 | #include <Finally.h> |
| @@ -590,6 +591,7 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 515 unmodified lines | ||
| 590 | 591 | DependencyManager::set<Snapshot>(); |
| 591 | 592 | DependencyManager::set<CloseEventSender>(); |
| 592 | 593 | DependencyManager::set<ResourceManager>(); |
| 594 | + DependencyManager::set<HoverOverlayInterface>(); | |
| 593 | 595 | |
| 594 | 596 | DependencyManager::set<LaserPointerScriptingInterface>(); |
| 595 | 597 | DependencyManager::set<LaserPointerManager>(); |
| @@ -1473,6 +1475,14 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 877 unmodified lines | ||
| 1473 | 1475 | properties["atp_mapping_requests"] = atpMappingRequests; |
| 1474 | 1476 | |
| 1475 | 1477 | properties["throttled"] = _displayPlugin ? _displayPlugin->isThrottled() : false; |
| 1478 | + | |
| 1479 | + QJsonObject bytesDownloaded; | |
| 1480 | + bytesDownloaded["atp"] = statTracker->getStat(STAT_ATP_RESOURCE_TOTAL_BYTES).toInt(); | |
| 1481 | + bytesDownloaded["http"] = statTracker->getStat(STAT_HTTP_RESOURCE_TOTAL_BYTES).toInt(); | |
| 1482 | + bytesDownloaded["file"] = statTracker->getStat(STAT_FILE_RESOURCE_TOTAL_BYTES).toInt(); | |
| 1483 | + bytesDownloaded["total"] = bytesDownloaded["atp"].toInt() + bytesDownloaded["http"].toInt() | |
| 1484 | + + bytesDownloaded["file"].toInt(); | |
| 1485 | + properties["bytesDownloaded"] = bytesDownloaded; | |
| 1476 | 1486 | |
| 1477 | 1487 | auto myAvatar = getMyAvatar(); |
| 1478 | 1488 | glm::vec3 avatarPosition = myAvatar->getPosition(); |
| @@ -1711,9 +1721,7 @@ QString Application::getUserAgent() { · 232 unmodified lines | ||
| 1711 | 1721 | void Application::toggleTabletUI(bool shouldOpen) const { |
| 1712 | 1722 | auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>(); |
| 1713 | 1723 | auto hmd = DependencyManager::get<HMDScriptingInterface>(); |
| 1714 | − TabletProxy* tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet(SYSTEM_TABLET)); | |
| 1715 | − bool messageOpen = tablet->isMessageDialogOpen(); | |
| 1716 | − if ((!messageOpen || (messageOpen && !hmd->getShouldShowTablet())) && !(shouldOpen && hmd->getShouldShowTablet())) { | |
| 1724 | + if (!(shouldOpen && hmd->getShouldShowTablet())) { | |
| 1717 | 1725 | auto HMD = DependencyManager::get<HMDScriptingInterface>(); |
| 1718 | 1726 | HMD->toggleShouldShowTablet(); |
| 1719 | 1727 | } |
| @@ -2122,6 +2130,7 @@ void Application::initializeUi() { · 402 unmodified lines | ||
| 2122 | 2130 | surfaceContext->setContextProperty("ApplicationCompositor", &getApplicationCompositor()); |
| 2123 | 2131 | |
| 2124 | 2132 | surfaceContext->setContextProperty("AvatarInputs", AvatarInputs::getInstance()); |
| 2133 | + surfaceContext->setContextProperty("HoverOverlay", DependencyManager::get<HoverOverlayInterface>().data()); | |
| 2125 | 2134 | |
| 2126 | 2135 | if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) { |
| 2127 | 2136 | surfaceContext->setContextProperty("Steam", new SteamScriptingInterface(engine, steamClient.get())); |
| @@ -2762,6 +2771,16 @@ bool Application::event(QEvent* event) { · 634 unmodified lines | ||
| 2762 | 2771 | static_cast<LambdaEvent*>(event)->call(); |
| 2763 | 2772 | return true; |
| 2764 | 2773 | |
| 2774 | + // Explicit idle keeps the idle running at a lower interval, but without any rendering | |
| 2775 | + // see (windowMinimizedChanged) | |
| 2776 | + case Event::Idle: | |
| 2777 | + { | |
| 2778 | + float nsecsElapsed = (float)_lastTimeUpdated.nsecsElapsed(); | |
| 2779 | + _lastTimeUpdated.start(); | |
| 2780 | + idle(nsecsElapsed); | |
| 2781 | + } | |
| 2782 | + return true; | |
| 2783 | + | |
| 2765 | 2784 | case Event::Present: |
| 2766 | 2785 | if (!_renderRequested) { |
| 2767 | 2786 | float nsecsElapsed = (float)_lastTimeUpdated.nsecsElapsed(); |
| @@ -5459,6 +5478,10 @@ void Application::updateWindowTitle() const { · 2691 unmodified lines | ||
| 5459 | 5478 | qCDebug(interfaceapp, "Application title set to: %s", title.toStdString().c_str()); |
| 5460 | 5479 | #endif |
| 5461 | 5480 | _window->setWindowTitle(title); |
| 5481 | + | |
| 5482 | + // updateTitleWindow gets called whenever there's a change regarding the domain, so rather | |
| 5483 | + // than placing this within domainChanged, it's placed here to cover the other potential cases. | |
| 5484 | + DependencyManager::get< MessagesClient >()->sendLocalMessage("Toolbar-DomainChanged", ""); | |
| 5462 | 5485 | } |
| 5463 | 5486 | |
| 5464 | 5487 | void Application::clearDomainOctreeDetails() { |
| @@ -5845,6 +5868,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri · 380 unmodified lines | ||
| 5845 | 5868 | auto entityScriptServerLog = DependencyManager::get<EntityScriptServerLogClient>(); |
| 5846 | 5869 | scriptEngine->registerGlobalObject("EntityScriptServerLog", entityScriptServerLog.data()); |
| 5847 | 5870 | scriptEngine->registerGlobalObject("AvatarInputs", AvatarInputs::getInstance()); |
| 5871 | + scriptEngine->registerGlobalObject("HoverOverlay", DependencyManager::get<HoverOverlayInterface>().data()); | |
| 5848 | 5872 | |
| 5849 | 5873 | scriptEngine->registerGlobalObject("RayPick", DependencyManager::get<RayPickManager>().data()); |
| 5850 | 5874 | |
| @@ -6618,11 +6642,11 @@ void Application::setPreviousScriptLocation(const QString& location) { · 767 unmodified lines | ||
| 6618 | 6642 | } |
| 6619 | 6643 | |
| 6620 | 6644 | void Application::loadScriptURLDialog() const { |
| 6621 | − auto newScript = OffscreenUi::getText(OffscreenUi::ICON_NONE, "Open and Run Script", "Script URL"); | |
| 6645 | + QString newScript = OffscreenUi::getText(OffscreenUi::ICON_NONE, "Open and Run Script", "Script URL"); | |
| 6622 | 6646 | if (QUrl(newScript).scheme() == "atp") { |
| 6623 | 6647 | OffscreenUi::warning("Error Loading Script", "Cannot load client script over ATP"); |
| 6624 | 6648 | } else if (!newScript.isEmpty()) { |
| 6625 | − DependencyManager::get<ScriptEngines>()->loadScript(newScript); | |
| 6649 | + DependencyManager::get<ScriptEngines>()->loadScript(newScript.trimmed()); | |
| 6626 | 6650 | } |
| 6627 | 6651 | } |
| 6628 | 6652 | |