Showing the changes to interface/src/Application.cpp (1 of 205 files). Show all
Unified · Split
| @@ -270,7 +270,7 @@ class RenderEventHandler : public QObject { · 269 unmodified lines | |||
| 270 | public: | 270 | public: |
| 271 | RenderEventHandler() { | 271 | RenderEventHandler() { |
| 272 | // Transfer to a new thread | 272 | // Transfer to a new thread |
| 273 | moveToNewNamedThread(this, "RenderThread", [this](QThread* renderThread) { | 273 | moveToNewNamedThread(this, "RenderThread", [](QThread* renderThread) { |
| 274 | hifi::qt::addBlockingForbiddenThread("Render", renderThread); | 274 | hifi::qt::addBlockingForbiddenThread("Render", renderThread); |
| 275 | qApp->_lastTimeRendered.start(); | 275 | qApp->_lastTimeRendered.start(); |
| 276 | }, std::bind(&RenderEventHandler::initialize, this), QThread::HighestPriority); | 276 | }, std::bind(&RenderEventHandler::initialize, this), QThread::HighestPriority); |
| @@ -964,7 +964,7 @@ Q_GUI_EXPORT void qt_gl_set_global_share_context(QOpenGLContext *context); · 687 unmodified lines | |||
| 964 | 964 | ||
| 965 | Setting::Handle<int> sessionRunTime{ "sessionRunTime", 0 }; | 965 | Setting::Handle<int> sessionRunTime{ "sessionRunTime", 0 }; |
| 966 | 966 | ||
| 967 | const float DEFAULT_HMD_TABLET_SCALE_PERCENT = 70.0f; | 967 | const float DEFAULT_HMD_TABLET_SCALE_PERCENT = 60.0f; |
| 968 | const float DEFAULT_DESKTOP_TABLET_SCALE_PERCENT = 75.0f; | 968 | const float DEFAULT_DESKTOP_TABLET_SCALE_PERCENT = 75.0f; |
| 969 | const bool DEFAULT_DESKTOP_TABLET_BECOMES_TOOLBAR = true; | 969 | const bool DEFAULT_DESKTOP_TABLET_BECOMES_TOOLBAR = true; |
| 970 | const bool DEFAULT_HMD_TABLET_BECOMES_TOOLBAR = false; | 970 | const bool DEFAULT_HMD_TABLET_BECOMES_TOOLBAR = false; |
| @@ -997,7 +997,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 26 unmodified lines | |||
| 997 | _enableProcessOctreeThread(true), | 997 | _enableProcessOctreeThread(true), |
| 998 | _lastNackTime(usecTimestampNow()), | 998 | _lastNackTime(usecTimestampNow()), |
| 999 | _lastSendDownstreamAudioStats(usecTimestampNow()), | 999 | _lastSendDownstreamAudioStats(usecTimestampNow()), |
| 1000 | _aboutToQuit(false), | ||
| 1001 | _notifiedPacketVersionMismatchThisDomain(false), | 1000 | _notifiedPacketVersionMismatchThisDomain(false), |
| 1002 | _maxOctreePPS(maxOctreePacketsPerSecond.get()), | 1001 | _maxOctreePPS(maxOctreePacketsPerSecond.get()), |
| 1003 | _lastFaceTrackerUpdate(0), | 1002 | _lastFaceTrackerUpdate(0), |
| @@ -1237,7 +1236,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 233 unmodified lines | |||
| 1237 | auto dialogsManager = DependencyManager::get<DialogsManager>(); | 1236 | auto dialogsManager = DependencyManager::get<DialogsManager>(); |
| 1238 | #if defined(Q_OS_ANDROID) | 1237 | #if defined(Q_OS_ANDROID) |
| 1239 | connect(accountManager.data(), &AccountManager::authRequired, this, []() { | 1238 | connect(accountManager.data(), &AccountManager::authRequired, this, []() { |
| 1240 | AndroidHelper::instance().showLoginDialog(); | 1239 | auto addressManager = DependencyManager::get<AddressManager>(); |
| 1240 | AndroidHelper::instance().showLoginDialog(addressManager->currentAddress()); | ||
| 1241 | }); | 1241 | }); |
| 1242 | #else | 1242 | #else |
| 1243 | connect(accountManager.data(), &AccountManager::authRequired, dialogsManager.data(), &DialogsManager::showLoginDialog); | 1243 | connect(accountManager.data(), &AccountManager::authRequired, dialogsManager.data(), &DialogsManager::showLoginDialog); |
| @@ -1692,21 +1692,21 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 448 unmodified lines | |||
| 1692 | return DependencyManager::get<OffscreenUi>()->navigationFocused() ? 1 : 0; | 1692 | return DependencyManager::get<OffscreenUi>()->navigationFocused() ? 1 : 0; |
| 1693 | }); | 1693 | }); |
| 1694 | _applicationStateDevice->setInputVariant(STATE_PLATFORM_WINDOWS, []() -> float { | 1694 | _applicationStateDevice->setInputVariant(STATE_PLATFORM_WINDOWS, []() -> float { |
| 1695 | #if defined(Q_OS_WIN) | 1695 | #if defined(Q_OS_WIN) |
| 1696 | return 1; | 1696 | return 1; |
| 1697 | #else | 1697 | #else |
| 1698 | return 0; | 1698 | return 0; |
| 1699 | #endif | 1699 | #endif |
| 1700 | }); | 1700 | }); |
| 1701 | _applicationStateDevice->setInputVariant(STATE_PLATFORM_MAC, []() -> float { | 1701 | _applicationStateDevice->setInputVariant(STATE_PLATFORM_MAC, []() -> float { |
| 1702 | #if defined(Q_OS_MAC) | 1702 | #if defined(Q_OS_MAC) |
| 1703 | return 1; | 1703 | return 1; |
| 1704 | #else | 1704 | #else |
| 1705 | return 0; | 1705 | return 0; |
| 1706 | #endif | 1706 | #endif |
| 1707 | }); | 1707 | }); |
| 1708 | _applicationStateDevice->setInputVariant(STATE_PLATFORM_ANDROID, []() -> float { | 1708 | _applicationStateDevice->setInputVariant(STATE_PLATFORM_ANDROID, []() -> float { |
| 1709 | #if defined(Q_OS_ANDROID) | 1709 | #if defined(Q_OS_ANDROID) |
| 1710 | return 1; | 1710 | return 1; |
| 1711 | #else | 1711 | #else |
| 1712 | return 0; | 1712 | return 0; |
| @@ -1756,7 +1756,13 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 43 unmodified lines | |||
| 1756 | // we can unlock the desktop repositioning code, since all the positions will be | 1756 | // we can unlock the desktop repositioning code, since all the positions will be |
| 1757 | // relative to the desktop size for this plugin | 1757 | // relative to the desktop size for this plugin |
| 1758 | auto offscreenUi = DependencyManager::get<OffscreenUi>(); | 1758 | auto offscreenUi = DependencyManager::get<OffscreenUi>(); |
| 1759 | offscreenUi->getDesktop()->setProperty("repositionLocked", false); | 1759 | connect(offscreenUi.data(), &OffscreenUi::desktopReady, []() { |
| 1760 | auto offscreenUi = DependencyManager::get<OffscreenUi>(); | ||
| 1761 | auto desktop = offscreenUi->getDesktop(); | ||
| 1762 | if (desktop) { | ||
| 1763 | desktop->setProperty("repositionLocked", false); | ||
| 1764 | } | ||
| 1765 | }); | ||
| 1760 | 1766 | ||
| 1761 | // Make sure we don't time out during slow operations at startup | 1767 | // Make sure we don't time out during slow operations at startup |
| 1762 | updateHeartbeat(); | 1768 | updateHeartbeat(); |
| @@ -2315,7 +2321,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 552 unmodified lines | |||
| 2315 | QTimer* checkLoginTimer = new QTimer(this); | 2321 | QTimer* checkLoginTimer = new QTimer(this); |
| 2316 | checkLoginTimer->setInterval(CHECK_LOGIN_TIMER); | 2322 | checkLoginTimer->setInterval(CHECK_LOGIN_TIMER); |
| 2317 | checkLoginTimer->setSingleShot(true); | 2323 | checkLoginTimer->setSingleShot(true); |
| 2318 | connect(checkLoginTimer, &QTimer::timeout, this, [this]() { | 2324 | connect(checkLoginTimer, &QTimer::timeout, this, []() { |
| 2319 | auto accountManager = DependencyManager::get<AccountManager>(); | 2325 | auto accountManager = DependencyManager::get<AccountManager>(); |
| 2320 | auto dialogsManager = DependencyManager::get<DialogsManager>(); | 2326 | auto dialogsManager = DependencyManager::get<DialogsManager>(); |
| 2321 | if (!accountManager->isLoggedIn()) { | 2327 | if (!accountManager->isLoggedIn()) { |
| @@ -2889,9 +2895,10 @@ void Application::initializeUi() { · 567 unmodified lines | |||
| 2889 | QUrl{ "hifi/commerce/common/CommerceLightbox.qml" }, | 2895 | QUrl{ "hifi/commerce/common/CommerceLightbox.qml" }, |
| 2890 | QUrl{ "hifi/commerce/common/EmulatedMarketplaceHeader.qml" }, | 2896 | QUrl{ "hifi/commerce/common/EmulatedMarketplaceHeader.qml" }, |
| 2891 | QUrl{ "hifi/commerce/common/FirstUseTutorial.qml" }, | 2897 | QUrl{ "hifi/commerce/common/FirstUseTutorial.qml" }, |
| 2892 | QUrl{ "hifi/commerce/common/SortableListModel.qml" }, | ||
| 2893 | QUrl{ "hifi/commerce/common/sendAsset/SendAsset.qml" }, | 2898 | QUrl{ "hifi/commerce/common/sendAsset/SendAsset.qml" }, |
| 2899 | QUrl{ "hifi/commerce/common/SortableListModel.qml" }, | ||
| 2894 | QUrl{ "hifi/commerce/inspectionCertificate/InspectionCertificate.qml" }, | 2900 | QUrl{ "hifi/commerce/inspectionCertificate/InspectionCertificate.qml" }, |
| 2901 | QUrl{ "hifi/commerce/marketplaceItemTester/MarketplaceItemTester.qml"}, | ||
| 2895 | QUrl{ "hifi/commerce/purchases/PurchasedItem.qml" }, | 2902 | QUrl{ "hifi/commerce/purchases/PurchasedItem.qml" }, |
| 2896 | QUrl{ "hifi/commerce/purchases/Purchases.qml" }, | 2903 | QUrl{ "hifi/commerce/purchases/Purchases.qml" }, |
| 2897 | QUrl{ "hifi/commerce/wallet/Help.qml" }, | 2904 | QUrl{ "hifi/commerce/wallet/Help.qml" }, |
| @@ -3435,7 +3442,12 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 537 unmodified lines | |||
| 3435 | int urlIndex = arguments().indexOf(HIFI_URL_COMMAND_LINE_KEY); | 3442 | int urlIndex = arguments().indexOf(HIFI_URL_COMMAND_LINE_KEY); |
| 3436 | QString addressLookupString; | 3443 | QString addressLookupString; |
| 3437 | if (urlIndex != -1) { | 3444 | if (urlIndex != -1) { |
| 3438 | addressLookupString = arguments().value(urlIndex + 1); | 3445 | QUrl url(arguments().value(urlIndex + 1)); |
| 3446 | if (url.scheme() == URL_SCHEME_HIFIAPP) { | ||
| 3447 | Setting::Handle<QVariant>("startUpApp").set(url.path()); | ||
| 3448 | } else { | ||
| 3449 | addressLookupString = url.toString(); | ||
| 3450 | } | ||
| 3439 | } | 3451 | } |
| 3440 | 3452 | ||
| 3441 | static const QString SENT_TO_PREVIOUS_LOCATION = "previous_location"; | 3453 | static const QString SENT_TO_PREVIOUS_LOCATION = "previous_location"; |
| @@ -4673,8 +4685,14 @@ void Application::idle() { · 1231 unmodified lines | |||
| 4673 | 4685 | ||
| 4674 | checkChangeCursor(); | 4686 | checkChangeCursor(); |
| 4675 | 4687 | ||
| 4676 | Stats::getInstance()->updateStats(); | 4688 | auto stats = Stats::getInstance(); |
| 4677 | AnimStats::getInstance()->updateStats(); | 4689 | if (stats) { |
| 4690 | stats->updateStats(); | ||
| 4691 | } | ||
| 4692 | auto animStats = AnimStats::getInstance(); | ||
| 4693 | if (animStats) { | ||
| 4694 | animStats->updateStats(); | ||
| 4695 | } | ||
| 4678 | 4696 | ||
| 4679 | // Normally we check PipelineWarnings, but since idle will often take more than 10ms we only show these idle timing | 4697 | // Normally we check PipelineWarnings, but since idle will often take more than 10ms we only show these idle timing |
| 4680 | // details if we're in ExtraDebugging mode. However, the ::update() and its subcomponents will show their timing | 4698 | // details if we're in ExtraDebugging mode. However, the ::update() and its subcomponents will show their timing |
| @@ -7683,6 +7701,9 @@ void Application::openUrl(const QUrl& url) const { · 3002 unmodified lines | |||
| 7683 | if (!url.isEmpty()) { | 7701 | if (!url.isEmpty()) { |
| 7684 | if (url.scheme() == URL_SCHEME_HIFI) { | 7702 | if (url.scheme() == URL_SCHEME_HIFI) { |
| 7685 | DependencyManager::get<AddressManager>()->handleLookupString(url.toString()); | 7703 | DependencyManager::get<AddressManager>()->handleLookupString(url.toString()); |
| 7704 | } else if (url.scheme() == URL_SCHEME_HIFIAPP) { | ||
| 7705 | QmlCommerce commerce; | ||
| 7706 | commerce.openSystemApp(url.path()); | ||
| 7686 | } else { | 7707 | } else { |
| 7687 | // address manager did not handle - ask QDesktopServices to handle | 7708 | // address manager did not handle - ask QDesktopServices to handle |
| 7688 | QDesktopServices::openUrl(url); | 7709 | QDesktopServices::openUrl(url); |