History

Merge branch 'master' of github.com:highfidelity/hifi into stt_parenting2

sabrina-shanman committed 8 years ago

Commit 67dc5262 parents b988382 0ef407a205 files · +4536 −1014Browse files

Showing the changes to interface/src/Application.cpp (1 of 205 files). Show all

Unified · Split

interface/src/Application.cpp+34−13
@@ -270,7 +270,7 @@ class RenderEventHandler : public QObject { · 269 unmodified lines
270270 public:
271271 RenderEventHandler() {
272272 // Transfer to a new thread
273− moveToNewNamedThread(this, "RenderThread", [this](QThread* renderThread) {
273+ moveToNewNamedThread(this, "RenderThread", [](QThread* renderThread) {
274274 hifi::qt::addBlockingForbiddenThread("Render", renderThread);
275275 qApp->_lastTimeRendered.start();
276276 }, 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
964964
965965 Setting::Handle<int> sessionRunTime{ "sessionRunTime", 0 };
966966
967−const float DEFAULT_HMD_TABLET_SCALE_PERCENT = 70.0f;
967+const float DEFAULT_HMD_TABLET_SCALE_PERCENT = 60.0f;
968968 const float DEFAULT_DESKTOP_TABLET_SCALE_PERCENT = 75.0f;
969969 const bool DEFAULT_DESKTOP_TABLET_BECOMES_TOOLBAR = true;
970970 const bool DEFAULT_HMD_TABLET_BECOMES_TOOLBAR = false;
@@ -997,7 +997,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 26 unmodified lines
997997 _enableProcessOctreeThread(true),
998998 _lastNackTime(usecTimestampNow()),
999999 _lastSendDownstreamAudioStats(usecTimestampNow()),
1000− _aboutToQuit(false),
10011000 _notifiedPacketVersionMismatchThisDomain(false),
10021001 _maxOctreePPS(maxOctreePacketsPerSecond.get()),
10031002 _lastFaceTrackerUpdate(0),
@@ -1237,7 +1236,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 233 unmodified lines
12371236 auto dialogsManager = DependencyManager::get<DialogsManager>();
12381237 #if defined(Q_OS_ANDROID)
12391238 connect(accountManager.data(), &AccountManager::authRequired, this, []() {
1240− AndroidHelper::instance().showLoginDialog();
1239+ auto addressManager = DependencyManager::get<AddressManager>();
1240+ AndroidHelper::instance().showLoginDialog(addressManager->currentAddress());
12411241 });
12421242 #else
12431243 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
16921692 return DependencyManager::get<OffscreenUi>()->navigationFocused() ? 1 : 0;
16931693 });
16941694 _applicationStateDevice->setInputVariant(STATE_PLATFORM_WINDOWS, []() -> float {
1695−#if defined(Q_OS_WIN)
1695+#if defined(Q_OS_WIN)
16961696 return 1;
16971697 #else
16981698 return 0;
16991699 #endif
17001700 });
17011701 _applicationStateDevice->setInputVariant(STATE_PLATFORM_MAC, []() -> float {
1702−#if defined(Q_OS_MAC)
1702+#if defined(Q_OS_MAC)
17031703 return 1;
17041704 #else
17051705 return 0;
17061706 #endif
17071707 });
17081708 _applicationStateDevice->setInputVariant(STATE_PLATFORM_ANDROID, []() -> float {
1709−#if defined(Q_OS_ANDROID)
1709+#if defined(Q_OS_ANDROID)
17101710 return 1;
17111711 #else
17121712 return 0;
@@ -1756,7 +1756,13 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 43 unmodified lines
17561756 // we can unlock the desktop repositioning code, since all the positions will be
17571757 // relative to the desktop size for this plugin
17581758 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+ });
17601766
17611767 // Make sure we don't time out during slow operations at startup
17621768 updateHeartbeat();
@@ -2315,7 +2321,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 552 unmodified lines
23152321 QTimer* checkLoginTimer = new QTimer(this);
23162322 checkLoginTimer->setInterval(CHECK_LOGIN_TIMER);
23172323 checkLoginTimer->setSingleShot(true);
2318− connect(checkLoginTimer, &QTimer::timeout, this, [this]() {
2324+ connect(checkLoginTimer, &QTimer::timeout, this, []() {
23192325 auto accountManager = DependencyManager::get<AccountManager>();
23202326 auto dialogsManager = DependencyManager::get<DialogsManager>();
23212327 if (!accountManager->isLoggedIn()) {
@@ -2889,9 +2895,10 @@ void Application::initializeUi() { · 567 unmodified lines
28892895 QUrl{ "hifi/commerce/common/CommerceLightbox.qml" },
28902896 QUrl{ "hifi/commerce/common/EmulatedMarketplaceHeader.qml" },
28912897 QUrl{ "hifi/commerce/common/FirstUseTutorial.qml" },
2892− QUrl{ "hifi/commerce/common/SortableListModel.qml" },
28932898 QUrl{ "hifi/commerce/common/sendAsset/SendAsset.qml" },
2899+ QUrl{ "hifi/commerce/common/SortableListModel.qml" },
28942900 QUrl{ "hifi/commerce/inspectionCertificate/InspectionCertificate.qml" },
2901+ QUrl{ "hifi/commerce/marketplaceItemTester/MarketplaceItemTester.qml"},
28952902 QUrl{ "hifi/commerce/purchases/PurchasedItem.qml" },
28962903 QUrl{ "hifi/commerce/purchases/Purchases.qml" },
28972904 QUrl{ "hifi/commerce/wallet/Help.qml" },
@@ -3435,7 +3442,12 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 537 unmodified lines
34353442 int urlIndex = arguments().indexOf(HIFI_URL_COMMAND_LINE_KEY);
34363443 QString addressLookupString;
34373444 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+ }
34393451 }
34403452
34413453 static const QString SENT_TO_PREVIOUS_LOCATION = "previous_location";
@@ -4673,8 +4685,14 @@ void Application::idle() { · 1231 unmodified lines
46734685
46744686 checkChangeCursor();
46754687
4676− Stats::getInstance()->updateStats();
4677− AnimStats::getInstance()->updateStats();
4688+ auto stats = Stats::getInstance();
4689+ if (stats) {
4690+ stats->updateStats();
4691+ }
4692+ auto animStats = AnimStats::getInstance();
4693+ if (animStats) {
4694+ animStats->updateStats();
4695+ }
46784696
46794697 // Normally we check PipelineWarnings, but since idle will often take more than 10ms we only show these idle timing
46804698 // 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
76837701 if (!url.isEmpty()) {
76847702 if (url.scheme() == URL_SCHEME_HIFI) {
76857703 DependencyManager::get<AddressManager>()->handleLookupString(url.toString());
7704+ } else if (url.scheme() == URL_SCHEME_HIFIAPP) {
7705+ QmlCommerce commerce;
7706+ commerce.openSystemApp(url.path());
76867707 } else {
76877708 // address manager did not handle - ask QDesktopServices to handle
76887709 QDesktopServices::openUrl(url);