From 886772eb39331ebd21a1f86944f1273be9f9280e Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Wed, 22 May 2019 11:27:14 -0700 Subject: [PATCH 01/17] only worry about Ubuntu major versions when selecting Qt package --- hifi_vcpkg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index 3df714e6f9..ee42eef14f 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -265,10 +265,10 @@ endif() #url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-macos.tar.gz?versionId=QrGxwssB.WwU_z3QCyG7ghP1_VjTkQeK' url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-macos.tar.gz' elif platform.system() == 'Linux': - if platform.linux_distribution()[1] == '16.04': + if platform.linux_distribution()[1][:3] == '16.': #url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-16.04.tar.gz?versionId=c9j7PW4uBDPLif7DKmgIhorh9WBMjZRB' url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-16.04.tar.gz' - elif platform.linux_distribution()[1] == '18.04': + elif platform.linux_distribution()[1][:3] == '18.': #url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-18.04.tar.gz?versionId=Z3TojPFdb5pXdahF3oi85jjKocpL0xqw' url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-18.04.tar.gz' else: From 206e35326462de92f9e47daded61b6f0c9f24829 Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Wed, 22 May 2019 16:18:30 -0700 Subject: [PATCH 02/17] Pass tokens as params for automatic login --- interface/src/main.cpp | 18 +++++- libraries/networking/src/AccountManager.cpp | 63 +++++++++++++++++++++ libraries/networking/src/AccountManager.h | 5 ++ 3 files changed, 85 insertions(+), 1 deletion(-) diff --git a/interface/src/main.cpp b/interface/src/main.cpp index 9d8b733ba7..303d7f210b 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -83,6 +83,7 @@ int main(int argc, const char* argv[]) { QCommandLineOption allowMultipleInstancesOption("allowMultipleInstances", "Allow multiple instances to run"); QCommandLineOption overrideAppLocalDataPathOption("cache", "set test cache ", "dir"); QCommandLineOption overrideScriptsPathOption(SCRIPTS_SWITCH, "set scripts ", "path"); + QCommandLineOption responseTokensOption("tokens", "set response tokens ", "json"); parser.addOption(urlOption); parser.addOption(noLauncherOption); @@ -93,6 +94,7 @@ int main(int argc, const char* argv[]) { parser.addOption(overrideAppLocalDataPathOption); parser.addOption(overrideScriptsPathOption); parser.addOption(allowMultipleInstancesOption); + parser.addOption(responseTokensOption); if (!parser.parse(arguments)) { std::cout << parser.errorText().toStdString() << std::endl; // Avoid Qt log spam @@ -121,7 +123,7 @@ int main(int argc, const char* argv[]) { static const QString APPLICATION_CONFIG_FILENAME = "config.json"; QDir applicationDir(applicationPath); QFile configFile(applicationDir.filePath(APPLICATION_CONFIG_FILENAME)); - + bool isConfigFileValid = false; if (configFile.exists()) { if (!configFile.open(QIODevice::ReadOnly)) { qWarning() << "Found application config, but could not open it"; @@ -136,6 +138,7 @@ int main(int argc, const char* argv[]) { static const QString LAUNCHER_PATH_KEY = "launcherPath"; QString launcherPath = doc.object()[LAUNCHER_PATH_KEY].toString(); if (!launcherPath.isEmpty()) { + isConfigFileValid = true; if (!parser.isSet(noLauncherOption)) { qDebug() << "Found a launcherPath in application config. Starting launcher."; QProcess launcher; @@ -146,6 +149,7 @@ int main(int argc, const char* argv[]) { qDebug() << "Found a launcherPath in application config, but the launcher" " has been suppressed. Continuing normal execution."; } + configFile.close(); } } } @@ -398,6 +402,18 @@ int main(int argc, const char* argv[]) { printSystemInformation(); + if (isConfigFileValid || parser.isSet(responseTokensOption)) { + auto accountManager = DependencyManager::get(); + if (!accountManager.isNull()) { + if (parser.isSet(responseTokensOption)) { + QString tokens = QString(parser.value(responseTokensOption)); + accountManager->setAccessTokens(tokens); + } else if (isConfigFileValid) { + accountManager->setConfigFileURL(configFile.fileName()); + } + } + } + QTranslator translator; translator.load("i18n/interface_en"); app.installTranslator(&translator); diff --git a/libraries/networking/src/AccountManager.cpp b/libraries/networking/src/AccountManager.cpp index 226433e388..014ae62aff 100644 --- a/libraries/networking/src/AccountManager.cpp +++ b/libraries/networking/src/AccountManager.cpp @@ -97,6 +97,7 @@ void AccountManager::logout() { // remove this account from the account settings file removeAccountFromFile(); + saveLoginStatus(false); emit logoutComplete(); // the username has changed to blank @@ -650,6 +651,39 @@ void AccountManager::refreshAccessToken() { } } +void AccountManager::setAccessTokens(const QString& response) { + QJsonDocument jsonResponse = QJsonDocument::fromJson(response.toUtf8()); + const QJsonObject& rootObject = jsonResponse.object(); + + if (!rootObject.contains("error")) { + // construct an OAuthAccessToken from the json object + + if (!rootObject.contains("access_token") || !rootObject.contains("expires_in") + || !rootObject.contains("token_type")) { + // TODO: error handling - malformed token response + qCDebug(networking) << "Received a response for password grant that is missing one or more expected values."; + } else { + // clear the path from the response URL so we have the right root URL for this access token + QUrl rootURL = rootObject.contains("url") ? rootObject["url"].toString() : _authURL; + rootURL.setPath(""); + + qCDebug(networking) << "Storing an account with access-token for" << qPrintable(rootURL.toString()); + + _accountInfo = DataServerAccountInfo(); + _accountInfo.setAccessTokenFromJSON(rootObject); + emit loginComplete(rootURL); + + persistAccountToFile(); + + requestProfile(); + } + } else { + // TODO: error handling + qCDebug(networking) << "Error in response for password grant -" << rootObject["error_description"].toString(); + emit loginFailed(); + } +} + void AccountManager::requestAccessTokenFinished() { QNetworkReply* requestReply = reinterpret_cast(sender()); @@ -895,3 +929,32 @@ void AccountManager::handleKeypairGenerationError() { void AccountManager::setLimitedCommerce(bool isLimited) { _limitedCommerce = isLimited; } + +void AccountManager::saveLoginStatus(bool isLoggedIn) { + if (_configFileURL.isValid()) { + QFile configFile(_configFileURL.toString()); + configFile.open(QIODevice::ReadOnly | QIODevice::Text); + QJsonParseError error; + QJsonDocument jsonDocument = QJsonDocument::fromJson(configFile.readAll(), &error); + configFile.close(); + QString launcherPath; + if (error.error == QJsonParseError::NoError) { + QJsonObject rootObject = jsonDocument.object(); + if (rootObject.contains("loggedIn")) { + rootObject["loggedIn"] = isLoggedIn; + } + if (rootObject.contains("laucherPath")) { + launcherPath = rootObject["launcherPath"].isString(); + } + } + configFile.open(QFile::WriteOnly | QFile::Text | QFile::Truncate); + configFile.write(jsonDocument.toJson()); + configFile.close(); + if (!isLoggedIn && !launcherPath.isEmpty()) { + QProcess launcher; + launcher.setProgram(launcherPath); + launcher.startDetached(); + qApp->quit(); + } + } +} \ No newline at end of file diff --git a/libraries/networking/src/AccountManager.h b/libraries/networking/src/AccountManager.h index 8732042e93..3fcbff4f99 100644 --- a/libraries/networking/src/AccountManager.h +++ b/libraries/networking/src/AccountManager.h @@ -102,6 +102,10 @@ public: bool getLimitedCommerce() { return _limitedCommerce; } void setLimitedCommerce(bool isLimited); + void setAccessTokens(const QString& response); + void setConfigFileURL(const QUrl& fileURL) { _configFileURL = fileURL; } + void saveLoginStatus(bool isLoggedIn); + public slots: void requestAccessToken(const QString& login, const QString& password); void requestAccessTokenWithSteam(QByteArray authSessionTicket); @@ -162,6 +166,7 @@ private: QUuid _sessionID { QUuid::createUuid() }; bool _limitedCommerce { false }; + QUrl _configFileURL; }; #endif // hifi_AccountManager_h From d75fe040385b5e42dc103260cc41b83e1ec9b237 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Wed, 22 May 2019 16:24:40 -0700 Subject: [PATCH 03/17] Fix BUGZ-311 --- interface/resources/qml/hifi/simplifiedUI/settingsApp/vr/VR.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interface/resources/qml/hifi/simplifiedUI/settingsApp/vr/VR.qml b/interface/resources/qml/hifi/simplifiedUI/settingsApp/vr/VR.qml index 96dbc5e180..fc11451b5b 100644 --- a/interface/resources/qml/hifi/simplifiedUI/settingsApp/vr/VR.qml +++ b/interface/resources/qml/hifi/simplifiedUI/settingsApp/vr/VR.qml @@ -216,6 +216,7 @@ Flickable { width: parent.width - inputLevel.width checked: selectedHMD text: model.devicename + wrapLabel: false ButtonGroup.group: inputDeviceButtonGroup onClicked: { AudioScriptingInterface.setStereoInput(false); // the next selected audio device might not support stereo @@ -315,6 +316,7 @@ Flickable { width: parent.width checked: selectedDesktop text: model.devicename + wrapLabel: false ButtonGroup.group: outputDeviceButtonGroup onClicked: { AudioScriptingInterface.setOutputDevice(model.info, true); // `false` argument for Desktop mode setting From 6d824ff22d1931342a53e55b9ea0fdc22575a98a Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Wed, 22 May 2019 20:27:42 -0700 Subject: [PATCH 04/17] Fix logout --- interface/src/main.cpp | 18 ++++++++++-------- libraries/networking/src/AccountManager.cpp | 14 ++++++++------ libraries/networking/src/AccountManager.h | 4 ++-- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/interface/src/main.cpp b/interface/src/main.cpp index 303d7f210b..80d88c9303 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -122,8 +122,10 @@ int main(int argc, const char* argv[]) { static const QString APPLICATION_CONFIG_FILENAME = "config.json"; QDir applicationDir(applicationPath); - QFile configFile(applicationDir.filePath(APPLICATION_CONFIG_FILENAME)); - bool isConfigFileValid = false; + QString configFileName = applicationDir.filePath(APPLICATION_CONFIG_FILENAME); + QFile configFile(configFileName); + QString launcherPath; + if (configFile.exists()) { if (!configFile.open(QIODevice::ReadOnly)) { qWarning() << "Found application config, but could not open it"; @@ -136,9 +138,8 @@ int main(int argc, const char* argv[]) { qWarning() << "Found application config, but could not parse it: " << error.errorString(); } else { static const QString LAUNCHER_PATH_KEY = "launcherPath"; - QString launcherPath = doc.object()[LAUNCHER_PATH_KEY].toString(); + launcherPath = doc.object()[LAUNCHER_PATH_KEY].toString(); if (!launcherPath.isEmpty()) { - isConfigFileValid = true; if (!parser.isSet(noLauncherOption)) { qDebug() << "Found a launcherPath in application config. Starting launcher."; QProcess launcher; @@ -402,15 +403,16 @@ int main(int argc, const char* argv[]) { printSystemInformation(); - if (isConfigFileValid || parser.isSet(responseTokensOption)) { + if (!launcherPath.isEmpty() || parser.isSet(responseTokensOption)) { auto accountManager = DependencyManager::get(); if (!accountManager.isNull()) { + if (!launcherPath.isEmpty()) { + accountManager->setConfigFileURL(configFileName); + } if (parser.isSet(responseTokensOption)) { QString tokens = QString(parser.value(responseTokensOption)); accountManager->setAccessTokens(tokens); - } else if (isConfigFileValid) { - accountManager->setConfigFileURL(configFile.fileName()); - } + } } } diff --git a/libraries/networking/src/AccountManager.cpp b/libraries/networking/src/AccountManager.cpp index 014ae62aff..3a7d3e0a67 100644 --- a/libraries/networking/src/AccountManager.cpp +++ b/libraries/networking/src/AccountManager.cpp @@ -674,7 +674,7 @@ void AccountManager::setAccessTokens(const QString& response) { emit loginComplete(rootURL); persistAccountToFile(); - + saveLoginStatus(true); requestProfile(); } } else { @@ -931,8 +931,8 @@ void AccountManager::setLimitedCommerce(bool isLimited) { } void AccountManager::saveLoginStatus(bool isLoggedIn) { - if (_configFileURL.isValid()) { - QFile configFile(_configFileURL.toString()); + if (!_configFileURL.isEmpty()) { + QFile configFile(_configFileURL); configFile.open(QIODevice::ReadOnly | QIODevice::Text); QJsonParseError error; QJsonDocument jsonDocument = QJsonDocument::fromJson(configFile.readAll(), &error); @@ -940,12 +940,14 @@ void AccountManager::saveLoginStatus(bool isLoggedIn) { QString launcherPath; if (error.error == QJsonParseError::NoError) { QJsonObject rootObject = jsonDocument.object(); + if (rootObject.contains("launcherPath")) { + launcherPath = rootObject["launcherPath"].toString(); + } if (rootObject.contains("loggedIn")) { rootObject["loggedIn"] = isLoggedIn; } - if (rootObject.contains("laucherPath")) { - launcherPath = rootObject["launcherPath"].isString(); - } + jsonDocument = QJsonDocument(rootObject); + } configFile.open(QFile::WriteOnly | QFile::Text | QFile::Truncate); configFile.write(jsonDocument.toJson()); diff --git a/libraries/networking/src/AccountManager.h b/libraries/networking/src/AccountManager.h index 3fcbff4f99..c2187f79cb 100644 --- a/libraries/networking/src/AccountManager.h +++ b/libraries/networking/src/AccountManager.h @@ -103,7 +103,7 @@ public: void setLimitedCommerce(bool isLimited); void setAccessTokens(const QString& response); - void setConfigFileURL(const QUrl& fileURL) { _configFileURL = fileURL; } + void setConfigFileURL(const QString& fileURL) { _configFileURL = fileURL; } void saveLoginStatus(bool isLoggedIn); public slots: @@ -166,7 +166,7 @@ private: QUuid _sessionID { QUuid::createUuid() }; bool _limitedCommerce { false }; - QUrl _configFileURL; + QString _configFileURL; }; #endif // hifi_AccountManager_h From 0d0a9fbd09881a02ceb6a28a40a0999df408dcb3 Mon Sep 17 00:00:00 2001 From: Ken Cooke Date: Thu, 23 May 2019 07:54:08 -0700 Subject: [PATCH 05/17] Never return more than maxSamples from the audio ringbuffer --- libraries/audio/src/InboundAudioStream.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/audio/src/InboundAudioStream.cpp b/libraries/audio/src/InboundAudioStream.cpp index 5ac3996029..3964c9a6ed 100644 --- a/libraries/audio/src/InboundAudioStream.cpp +++ b/libraries/audio/src/InboundAudioStream.cpp @@ -366,8 +366,9 @@ int InboundAudioStream::popSamples(int maxSamples, bool allOrNothing) { _consecutiveNotMixedCount++; //Kick PLC to generate a filler frame, reducing 'click' lostAudioData(allOrNothing ? (maxSamples - samplesAvailable) / _ringBuffer.getNumFrameSamples() : 1); - samplesPopped = _ringBuffer.samplesAvailable(); - if (samplesPopped) { + samplesAvailable = _ringBuffer.samplesAvailable(); + if (samplesAvailable > 0) { + samplesPopped = std::min(samplesAvailable, maxSamples); popSamplesNoCheck(samplesPopped); } else { // No samples available means a packet is currently being From ba3282e12b034e2b2ec48a6b579b763b7a7dbc58 Mon Sep 17 00:00:00 2001 From: Ken Cooke Date: Thu, 23 May 2019 08:03:59 -0700 Subject: [PATCH 06/17] Fix rounding error in allOrNothing mode --- libraries/audio/src/InboundAudioStream.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libraries/audio/src/InboundAudioStream.cpp b/libraries/audio/src/InboundAudioStream.cpp index 3964c9a6ed..7a81b8a67a 100644 --- a/libraries/audio/src/InboundAudioStream.cpp +++ b/libraries/audio/src/InboundAudioStream.cpp @@ -364,9 +364,17 @@ int InboundAudioStream::popSamples(int maxSamples, bool allOrNothing) { // buffer calculations. setToStarved(); _consecutiveNotMixedCount++; - //Kick PLC to generate a filler frame, reducing 'click' - lostAudioData(allOrNothing ? (maxSamples - samplesAvailable) / _ringBuffer.getNumFrameSamples() : 1); + + // use PLC to generate extrapolated audio data, to reduce clicking + if (allOrNothing) { + int samplesNeeded = maxSamples - samplesAvailable; + int packetsNeeded = (samplesNeeded + _ringBuffer.getNumFrameSamples() - 1) / _ringBuffer.getNumFrameSamples(); + lostAudioData(packetsNeeded); + } else { + lostAudioData(1); + } samplesAvailable = _ringBuffer.samplesAvailable(); + if (samplesAvailable > 0) { samplesPopped = std::min(samplesAvailable, maxSamples); popSamplesNoCheck(samplesPopped); From 135dc7f2b18dbbd34c8d01ac07631c5f58224c17 Mon Sep 17 00:00:00 2001 From: Ken Cooke Date: Thu, 23 May 2019 08:54:47 -0700 Subject: [PATCH 07/17] assert() on over-filling the audio callback buffer --- libraries/audio-client/src/AudioClient.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp index cef6adcab0..da948f9917 100644 --- a/libraries/audio-client/src/AudioClient.cpp +++ b/libraries/audio-client/src/AudioClient.cpp @@ -2162,6 +2162,8 @@ qint64 AudioClient::AudioOutputIODevice::readData(char * data, qint64 maxSize) { } bytesWritten = framesPopped * AudioConstants::SAMPLE_SIZE * deviceChannelCount; + assert(bytesWritten <= maxSize); + } else { // nothing on network, don't grab anything from injectors, and just return 0s memset(data, 0, maxSize); @@ -2174,7 +2176,6 @@ qint64 AudioClient::AudioOutputIODevice::readData(char * data, qint64 maxSize) { _audio->_audioFileWav.addRawAudioChunk(reinterpret_cast(scratchBuffer), bytesWritten); } - int bytesAudioOutputUnplayed = _audio->_audioOutput->bufferSize() - _audio->_audioOutput->bytesFree(); float msecsAudioOutputUnplayed = bytesAudioOutputUnplayed / (float)_audio->_outputFormat.bytesForDuration(USECS_PER_MSEC); _audio->_stats.updateOutputMsUnplayed(msecsAudioOutputUnplayed); From 8db3d03772fad935013f3ba8cda22e91fd807a5c Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Thu, 23 May 2019 10:21:47 -0700 Subject: [PATCH 08/17] add display name as param --- interface/src/Application.cpp | 10 ++++++++++ interface/src/Application.h | 4 ++++ interface/src/main.cpp | 24 ++++++++++++++---------- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 0dba4498d5..ca171aa8b9 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -9355,6 +9355,16 @@ void Application::showUrlHandler(const QUrl& url) { }); } +void Application::forceDisplayName(const QString& displayName) { + getMyAvatar()->setDisplayName(displayName); +} +void Application::forceLogginWithTokens(const QString& tokens) { + DependencyManager::get()->setAccessTokens(tokens); +} +void Application::setConfigFileURL(const QString& fileUrl) { + DependencyManager::get()->setConfigFileURL(fileUrl); +} + #if defined(Q_OS_ANDROID) void Application::beforeEnterBackground() { auto nodeList = DependencyManager::get(); diff --git a/interface/src/Application.h b/interface/src/Application.h index 210039beba..2eac2bc885 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -356,6 +356,10 @@ public: void openDirectory(const QString& path); + void forceDisplayName(const QString& displayName); + void forceLogginWithTokens(const QString& tokens); + void setConfigFileURL(const QString& fileUrl); + signals: void svoImportRequested(const QString& url); diff --git a/interface/src/main.cpp b/interface/src/main.cpp index 80d88c9303..140b79584c 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -84,6 +84,7 @@ int main(int argc, const char* argv[]) { QCommandLineOption overrideAppLocalDataPathOption("cache", "set test cache ", "dir"); QCommandLineOption overrideScriptsPathOption(SCRIPTS_SWITCH, "set scripts ", "path"); QCommandLineOption responseTokensOption("tokens", "set response tokens ", "json"); + QCommandLineOption displayNameOption("displayName", "set user display name ", "string"); parser.addOption(urlOption); parser.addOption(noLauncherOption); @@ -95,6 +96,7 @@ int main(int argc, const char* argv[]) { parser.addOption(overrideScriptsPathOption); parser.addOption(allowMultipleInstancesOption); parser.addOption(responseTokensOption); + parser.addOption(displayNameOption); if (!parser.parse(arguments)) { std::cout << parser.errorText().toStdString() << std::endl; // Avoid Qt log spam @@ -403,16 +405,18 @@ int main(int argc, const char* argv[]) { printSystemInformation(); - if (!launcherPath.isEmpty() || parser.isSet(responseTokensOption)) { - auto accountManager = DependencyManager::get(); - if (!accountManager.isNull()) { - if (!launcherPath.isEmpty()) { - accountManager->setConfigFileURL(configFileName); - } - if (parser.isSet(responseTokensOption)) { - QString tokens = QString(parser.value(responseTokensOption)); - accountManager->setAccessTokens(tokens); - } + auto appPointer = dynamic_cast(&app); + if (appPointer) { + if (parser.isSet(displayNameOption)) { + QString displayName = QString(parser.value(displayNameOption)); + appPointer->forceDisplayName(displayName); + } + if (!launcherPath.isEmpty()) { + appPointer->setConfigFileURL(configFileName); + } + if (parser.isSet(responseTokensOption)) { + QString tokens = QString(parser.value(responseTokensOption)); + appPointer->forceLogginWithTokens(tokens); } } From cdf71f40d5643c211cad6c247192f44bb6c976a3 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Wed, 22 May 2019 15:05:27 -0700 Subject: [PATCH 09/17] Add postbuild script for CI server --- tools/ci-scripts/postbuild.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tools/ci-scripts/postbuild.py diff --git a/tools/ci-scripts/postbuild.py b/tools/ci-scripts/postbuild.py new file mode 100644 index 0000000000..a1561f6203 --- /dev/null +++ b/tools/ci-scripts/postbuild.py @@ -0,0 +1,20 @@ +# Post build script +import os +import sys + +SOURCE_PATH = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '..', '..')) +BUILD_PATH = os.path.join(SOURCE_PATH, 'build') + +# FIXME move the helper python modules somewher other than the root of the repo +sys.path.append(SOURCE_PATH) + +import hifi_utils + +#for var in sys.argv: +# print("{}".format(var)) + +#for var in os.environ: +# print("{} = {}".format(var, os.environ[var])) + +print("Create ZIP version of installer archive") +hifi_utils.executeSubprocess(['cpack', '-G', 'ZIP'], folder=BUILD_PATH) From 053576e29fd09f275b87c7a6ce689b845af2fc72 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Thu, 23 May 2019 11:31:42 -0700 Subject: [PATCH 10/17] Move SimplifiedUI folder and create new defaultScripts.js --- scripts/simplifiedUI/defaultScripts.js | 41 +++++++++++++++++++ .../simplifiedUI/images/inputDeviceMuted.svg | 0 .../simplifiedUI/images/outputDeviceMuted.svg | 0 .../modules/defaultLocalEntityProps.js | 0 .../resources/modules/entityMaker.js | 0 .../resources/modules/nameTagListManager.js | 0 .../resources/modules/objectAssign.js | 0 .../resources/modules/pickRayController.js | 0 .../resources/modules/textHelper.js | 0 .../simplifiedNametag/simplifiedNametag.js | 0 .../simplifiedStatusIndicator.js | 0 .../{system => }/simplifiedUI/simplifiedUI.js | 2 +- 12 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 scripts/simplifiedUI/defaultScripts.js rename scripts/{system => }/simplifiedUI/images/inputDeviceMuted.svg (100%) rename scripts/{system => }/simplifiedUI/images/outputDeviceMuted.svg (100%) rename scripts/{system => }/simplifiedUI/simplifiedNametag/resources/modules/defaultLocalEntityProps.js (100%) rename scripts/{system => }/simplifiedUI/simplifiedNametag/resources/modules/entityMaker.js (100%) rename scripts/{system => }/simplifiedUI/simplifiedNametag/resources/modules/nameTagListManager.js (100%) rename scripts/{system => }/simplifiedUI/simplifiedNametag/resources/modules/objectAssign.js (100%) rename scripts/{system => }/simplifiedUI/simplifiedNametag/resources/modules/pickRayController.js (100%) rename scripts/{system => }/simplifiedUI/simplifiedNametag/resources/modules/textHelper.js (100%) rename scripts/{system => }/simplifiedUI/simplifiedNametag/simplifiedNametag.js (100%) rename scripts/{system => }/simplifiedUI/simplifiedStatusIndicator/simplifiedStatusIndicator.js (100%) rename scripts/{system => }/simplifiedUI/simplifiedUI.js (99%) diff --git a/scripts/simplifiedUI/defaultScripts.js b/scripts/simplifiedUI/defaultScripts.js new file mode 100644 index 0000000000..0911c6518a --- /dev/null +++ b/scripts/simplifiedUI/defaultScripts.js @@ -0,0 +1,41 @@ +"use strict"; +/* jslint vars: true, plusplus: true */ + +// +// defaultScripts.js +// +// Authors: Zach Fox +// Created: 2019-05-23 +// Copyright 2019 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// +var DEFAULT_SCRIPTS_PATH_PREFIX = ScriptDiscoveryService.defaultScriptsPath + "/"; + + +var DEFAULT_SCRIPTS_SEPARATE = [ + DEFAULT_SCRIPTS_PATH_PREFIX + "system/controllers/controllerScripts.js", + Script.resolvePath("simplifiedUI.js") +]; +function loadSeparateDefaults() { + for (var i in DEFAULT_SCRIPTS_SEPARATE) { + Script.load(DEFAULT_SCRIPTS_SEPARATE[i]); + } +} + + +var DEFAULT_SCRIPTS_COMBINED = [ + DEFAULT_SCRIPTS_PATH_PREFIX + "system/request-service.js", + DEFAULT_SCRIPTS_PATH_PREFIX + "system/progress.js", + DEFAULT_SCRIPTS_PATH_PREFIX + "system/away.js" +]; +function runDefaultsTogether() { + for (var i in DEFAULT_SCRIPTS_COMBINED) { + Script.include(DEFAULT_SCRIPTS_COMBINED[i]); + } + loadSeparateDefaults(); +} + + +runDefaultsTogether(); diff --git a/scripts/system/simplifiedUI/images/inputDeviceMuted.svg b/scripts/simplifiedUI/images/inputDeviceMuted.svg similarity index 100% rename from scripts/system/simplifiedUI/images/inputDeviceMuted.svg rename to scripts/simplifiedUI/images/inputDeviceMuted.svg diff --git a/scripts/system/simplifiedUI/images/outputDeviceMuted.svg b/scripts/simplifiedUI/images/outputDeviceMuted.svg similarity index 100% rename from scripts/system/simplifiedUI/images/outputDeviceMuted.svg rename to scripts/simplifiedUI/images/outputDeviceMuted.svg diff --git a/scripts/system/simplifiedUI/simplifiedNametag/resources/modules/defaultLocalEntityProps.js b/scripts/simplifiedUI/simplifiedNametag/resources/modules/defaultLocalEntityProps.js similarity index 100% rename from scripts/system/simplifiedUI/simplifiedNametag/resources/modules/defaultLocalEntityProps.js rename to scripts/simplifiedUI/simplifiedNametag/resources/modules/defaultLocalEntityProps.js diff --git a/scripts/system/simplifiedUI/simplifiedNametag/resources/modules/entityMaker.js b/scripts/simplifiedUI/simplifiedNametag/resources/modules/entityMaker.js similarity index 100% rename from scripts/system/simplifiedUI/simplifiedNametag/resources/modules/entityMaker.js rename to scripts/simplifiedUI/simplifiedNametag/resources/modules/entityMaker.js diff --git a/scripts/system/simplifiedUI/simplifiedNametag/resources/modules/nameTagListManager.js b/scripts/simplifiedUI/simplifiedNametag/resources/modules/nameTagListManager.js similarity index 100% rename from scripts/system/simplifiedUI/simplifiedNametag/resources/modules/nameTagListManager.js rename to scripts/simplifiedUI/simplifiedNametag/resources/modules/nameTagListManager.js diff --git a/scripts/system/simplifiedUI/simplifiedNametag/resources/modules/objectAssign.js b/scripts/simplifiedUI/simplifiedNametag/resources/modules/objectAssign.js similarity index 100% rename from scripts/system/simplifiedUI/simplifiedNametag/resources/modules/objectAssign.js rename to scripts/simplifiedUI/simplifiedNametag/resources/modules/objectAssign.js diff --git a/scripts/system/simplifiedUI/simplifiedNametag/resources/modules/pickRayController.js b/scripts/simplifiedUI/simplifiedNametag/resources/modules/pickRayController.js similarity index 100% rename from scripts/system/simplifiedUI/simplifiedNametag/resources/modules/pickRayController.js rename to scripts/simplifiedUI/simplifiedNametag/resources/modules/pickRayController.js diff --git a/scripts/system/simplifiedUI/simplifiedNametag/resources/modules/textHelper.js b/scripts/simplifiedUI/simplifiedNametag/resources/modules/textHelper.js similarity index 100% rename from scripts/system/simplifiedUI/simplifiedNametag/resources/modules/textHelper.js rename to scripts/simplifiedUI/simplifiedNametag/resources/modules/textHelper.js diff --git a/scripts/system/simplifiedUI/simplifiedNametag/simplifiedNametag.js b/scripts/simplifiedUI/simplifiedNametag/simplifiedNametag.js similarity index 100% rename from scripts/system/simplifiedUI/simplifiedNametag/simplifiedNametag.js rename to scripts/simplifiedUI/simplifiedNametag/simplifiedNametag.js diff --git a/scripts/system/simplifiedUI/simplifiedStatusIndicator/simplifiedStatusIndicator.js b/scripts/simplifiedUI/simplifiedStatusIndicator/simplifiedStatusIndicator.js similarity index 100% rename from scripts/system/simplifiedUI/simplifiedStatusIndicator/simplifiedStatusIndicator.js rename to scripts/simplifiedUI/simplifiedStatusIndicator/simplifiedStatusIndicator.js diff --git a/scripts/system/simplifiedUI/simplifiedUI.js b/scripts/simplifiedUI/simplifiedUI.js similarity index 99% rename from scripts/system/simplifiedUI/simplifiedUI.js rename to scripts/simplifiedUI/simplifiedUI.js index 351372613b..d3bc2830cd 100644 --- a/scripts/system/simplifiedUI/simplifiedUI.js +++ b/scripts/simplifiedUI/simplifiedUI.js @@ -5,7 +5,7 @@ // simplifiedUI.js // // Authors: Wayne Chen & Zach Fox -// Created on: 5/1/2019 +// Created: 2019-05-01 // Copyright 2019 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. From dc370d676acc520aea8b4b50a2dcba1e58ccaa35 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Thu, 23 May 2019 13:07:47 -0700 Subject: [PATCH 11/17] Fix BUGZ-203 --- scripts/simplifiedUI/simplifiedUI.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/simplifiedUI/simplifiedUI.js b/scripts/simplifiedUI/simplifiedUI.js index d3bc2830cd..a6183c5ab9 100644 --- a/scripts/simplifiedUI/simplifiedUI.js +++ b/scripts/simplifiedUI/simplifiedUI.js @@ -103,6 +103,8 @@ var AVATAR_APP_PRESENTATION_MODE = Desktop.PresentationMode.NATIVE; var AVATAR_APP_WIDTH_PX = 480; var AVATAR_APP_HEIGHT_PX = 615; var avatarAppWindow = false; +var POPOUT_SAFE_MARGIN_X = 30; +var POPOUT_SAFE_MARGIN_Y = 30; function toggleAvatarApp() { if (avatarAppWindow) { avatarAppWindow.close(); @@ -119,6 +121,10 @@ function toggleAvatarApp() { size: { x: AVATAR_APP_WIDTH_PX, y: AVATAR_APP_HEIGHT_PX + }, + position: { + x: Math.max(Window.x + POPOUT_SAFE_MARGIN_X, Window.x + Window.innerWidth / 2 - AVATAR_APP_WIDTH_PX / 2), + y: Math.max(Window.y + POPOUT_SAFE_MARGIN_Y, Window.y + Window.innerHeight / 2 - AVATAR_APP_HEIGHT_PX / 2) } }); @@ -181,6 +187,10 @@ function toggleSettingsApp() { size: { x: SETTINGS_APP_WIDTH_PX, y: SETTINGS_APP_HEIGHT_PX + }, + position: { + x: Math.max(Window.x + POPOUT_SAFE_MARGIN_X, Window.x + Window.innerWidth / 2 - SETTINGS_APP_WIDTH_PX / 2), + y: Math.max(Window.y + POPOUT_SAFE_MARGIN_Y, Window.y + Window.innerHeight / 2 - SETTINGS_APP_HEIGHT_PX / 2) } }); From da011fd042a63df1719f7c27301a39f1d3c83015 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Thu, 23 May 2019 13:37:25 -0700 Subject: [PATCH 12/17] Fix BUGZ-312; fix BUGZ-311 --- .../simplifiedUI/settingsApp/audio/Audio.qml | 23 +++++++------------ .../hifi/simplifiedUI/settingsApp/vr/VR.qml | 14 +++++------ 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/interface/resources/qml/hifi/simplifiedUI/settingsApp/audio/Audio.qml b/interface/resources/qml/hifi/simplifiedUI/settingsApp/audio/Audio.qml index 9ac72fa3cd..1b5f571d96 100644 --- a/interface/resources/qml/hifi/simplifiedUI/settingsApp/audio/Audio.qml +++ b/interface/resources/qml/hifi/simplifiedUI/settingsApp/audio/Audio.qml @@ -60,7 +60,7 @@ Flickable { HifiStylesUit.GraphikRegular { id: volumeControlsTitle text: "Volume Controls" - Layout.maximumWidth: parent.width + Layout.preferredWidth: parent.width height: paintedHeight size: 22 color: simplifiedUI.colors.text.white @@ -68,8 +68,7 @@ Flickable { SimplifiedControls.Slider { id: peopleVolume - anchors.left: parent.left - anchors.right: parent.right + Layout.preferredWidth: parent.width Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin height: 30 labelText: "People Volume" @@ -96,8 +95,7 @@ Flickable { SimplifiedControls.Slider { id: environmentVolume - anchors.left: parent.left - anchors.right: parent.right + Layout.preferredWidth: parent.width Layout.topMargin: 2 height: 30 labelText: "Environment Volume" @@ -125,8 +123,7 @@ Flickable { SimplifiedControls.Slider { id: systemSoundVolume - anchors.left: parent.left - anchors.right: parent.right + Layout.preferredWidth: parent.width Layout.topMargin: 2 height: 30 labelText: "System Sound Volume" @@ -212,8 +209,7 @@ Flickable { ListView { id: inputDeviceListView - anchors.left: parent.left - anchors.right: parent.right + Layout.preferredWidth: parent.width Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin interactive: false height: contentItem.height @@ -228,7 +224,7 @@ Flickable { id: inputDeviceCheckbox anchors.left: parent.left width: parent.width - inputLevel.width - height: paintedHeight + height: 16 wrapLabel: false checked: selectedDesktop text: model.devicename @@ -278,7 +274,6 @@ Flickable { id: testYourMicButton enabled: !HMD.active - anchors.left: parent.left Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin width: 160 height: 32 @@ -313,8 +308,7 @@ Flickable { ListView { id: outputDeviceListView - anchors.left: parent.left - anchors.right: parent.right + Layout.preferredWidth: parent.width Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin interactive: false height: contentItem.height @@ -329,7 +323,7 @@ Flickable { id: outputDeviceCheckbox anchors.left: parent.left width: parent.width - height: paintedHeight + height: 16 checked: selectedDesktop text: model.devicename wrapLabel: false @@ -381,7 +375,6 @@ Flickable { id: testYourSoundButton enabled: !HMD.active - anchors.left: parent.left Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin width: 160 height: 32 diff --git a/interface/resources/qml/hifi/simplifiedUI/settingsApp/vr/VR.qml b/interface/resources/qml/hifi/simplifiedUI/settingsApp/vr/VR.qml index fc11451b5b..d869f82e12 100644 --- a/interface/resources/qml/hifi/simplifiedUI/settingsApp/vr/VR.qml +++ b/interface/resources/qml/hifi/simplifiedUI/settingsApp/vr/VR.qml @@ -198,8 +198,7 @@ Flickable { ListView { id: inputDeviceListView - anchors.left: parent.left - anchors.right: parent.right + Layout.preferredWidth: parent.width Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin interactive: false height: contentItem.height @@ -214,6 +213,7 @@ Flickable { id: inputDeviceCheckbox anchors.left: parent.left width: parent.width - inputLevel.width + height: 16 checked: selectedHMD text: model.devicename wrapLabel: false @@ -263,7 +263,6 @@ Flickable { id: testYourMicButton enabled: HMD.active - anchors.left: parent.left Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin width: 160 height: 32 @@ -298,8 +297,7 @@ Flickable { ListView { id: outputDeviceListView - anchors.left: parent.left - anchors.right: parent.right + Layout.preferredWidth: parent.width Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin interactive: false height: contentItem.height @@ -314,12 +312,13 @@ Flickable { id: outputDeviceCheckbox anchors.left: parent.left width: parent.width - checked: selectedDesktop + height: 16 + checked: selectedHMD text: model.devicename wrapLabel: false ButtonGroup.group: outputDeviceButtonGroup onClicked: { - AudioScriptingInterface.setOutputDevice(model.info, true); // `false` argument for Desktop mode setting + AudioScriptingInterface.setOutputDevice(model.info, true); // `true` argument for VR mode setting } } } @@ -365,7 +364,6 @@ Flickable { id: testYourSoundButton enabled: HMD.active - anchors.left: parent.left Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin width: 160 height: 32 From 940c122f461f4b363c10503d772b312962a2346f Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 23 May 2019 13:38:54 -0700 Subject: [PATCH 13/17] clear _otherAvatarsToChangeInPhysics after processing it --- interface/src/avatar/AvatarManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interface/src/avatar/AvatarManager.cpp b/interface/src/avatar/AvatarManager.cpp index 80b9762213..f153f66799 100755 --- a/interface/src/avatar/AvatarManager.cpp +++ b/interface/src/avatar/AvatarManager.cpp @@ -521,6 +521,7 @@ void AvatarManager::buildPhysicsTransaction(PhysicsEngine::Transaction& transact } } } + _otherAvatarsToChangeInPhysics.clear(); } void AvatarManager::handleProcessedPhysicsTransaction(PhysicsEngine::Transaction& transaction) { @@ -645,7 +646,7 @@ void AvatarManager::clearOtherAvatars() { } void AvatarManager::deleteAllAvatars() { - assert(_otherAvatarsToChangeInPhysics.empty()); + _otherAvatarsToChangeInPhysics.clear(); QReadLocker locker(&_hashLock); AvatarHash::iterator avatarIterator = _avatarHash.begin(); while (avatarIterator != _avatarHash.end()) { From a7874fa55605b844836ef4915c6ac117ef836187 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Thu, 23 May 2019 14:10:06 -0700 Subject: [PATCH 14/17] Update windows build with symbols for release qt-5.12.3 hifi_vcpkg.py will now download a new version of qt that contains release symbols. made minor changes to bullet3/portfile.cmake to trigger a new vkpkg hash. --- cmake/ports/bullet3/portfile.cmake | 5 +- hifi_vcpkg.py | 7 +- tools/qt-builder/README.md | 408 ++++++++++++++--------------- tools/qt-builder/qt5vars.bat | 2 +- 4 files changed, 208 insertions(+), 214 deletions(-) diff --git a/cmake/ports/bullet3/portfile.cmake b/cmake/ports/bullet3/portfile.cmake index d4e7aaf787..9318385de0 100644 --- a/cmake/ports/bullet3/portfile.cmake +++ b/cmake/ports/bullet3/portfile.cmake @@ -25,14 +25,13 @@ vcpkg_from_github( HEAD_REF master ) - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON -DUSE_MSVC_RUNTIME_LIBRARY_DLL=ON - -DUSE_GLUT=0 - -DUSE_DX11=0 + -DUSE_GLUT=0 + -DUSE_DX11=0 -DBUILD_DEMOS=OFF -DBUILD_OPENGL3_DEMOS=OFF -DBUILD_BULLET3=OFF diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index 3df714e6f9..9bc1878f94 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -258,18 +258,13 @@ endif() url = 'NOT DEFINED' if platform.system() == 'Windows': - # TODO: figure out how to download with versionId - #url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-windows.tar.gz?versionId=Etx8novAe0.IxQ7AosLFtop7fZur.cx9' - url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-windows.tar.gz' + url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-windows2.tar.gz' elif platform.system() == 'Darwin': - #url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-macos.tar.gz?versionId=QrGxwssB.WwU_z3QCyG7ghP1_VjTkQeK' url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-macos.tar.gz' elif platform.system() == 'Linux': if platform.linux_distribution()[1] == '16.04': - #url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-16.04.tar.gz?versionId=c9j7PW4uBDPLif7DKmgIhorh9WBMjZRB' url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-16.04.tar.gz' elif platform.linux_distribution()[1] == '18.04': - #url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-18.04.tar.gz?versionId=Z3TojPFdb5pXdahF3oi85jjKocpL0xqw' url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-18.04.tar.gz' else: print('UNKNOWN LINUX VERSION!!!') diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index 4cd49ce865..b7861a5e53 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -1,235 +1,235 @@ # General This document describes the process to build Qt 5.12.3. -Note that there are two patches. The first (to qfloat16.h) is needed to compile QT 5.12.3 on Visual Studio 2017 due to a bug in Visual Studio (*bitset* will not compile. Note that there is a change in CMakeLists.txt to support this. +Note that there are two patches. The first (to qfloat16.h) is needed to compile QT 5.12.3 on Visual Studio 2017 due to a bug in Visual Studio (*bitset* will not compile. Note that there is a change in CMakeLists.txt to support this. The second patch is to OpenSL ES audio. ## Requirements ### Windows -1. Visual Studio 2017 - If you don’t have Community or Professional edition of Visual Studio 2017, download [Visual Studio Community 2017](https://www.visualstudio.com/downloads/). +1. Visual Studio 2017 + If you don’t have Community or Professional edition of Visual Studio 2017, download [Visual Studio Community 2017](https://www.visualstudio.com/downloads/). Install with defaults 1. python 2.7.16 -Check if needed running `python --version` - should return python 2.7.x -Install from https://www.python.org/ftp/python/2.7.16/python-2.7.16.amd64.msi +Check if needed running `python --version` - should return python 2.7.x +Install from https://www.python.org/ftp/python/2.7.16/python-2.7.16.amd64.msi Add path to python executable to PATH. NOTE: REMOVE python 3 from PATH. Our regular build uses python 3. This will still work, because HIFI_PYTHON_EXEC points to the python 3 executable. -Verify that python runs python 2.7 (run “python --version”) -1. git >= 1.6 -Check if needed `git --version` -Download from https://git-scm.com/download/win -Verify by entering `git --version` -1. perl >= 5.14 -Install from Strawberry Perl - http://strawberryperl.com/ - 5.28.1.1 64 bit to C:\Strawberry\ -Verify by running `perl --version` -1. flex and bison -Download from https://sourceforge.net/projects/winflexbison/files/latest/download -Uncompress in C:\flex_bison -Rename win-bison.exe to bison.exe and win-flex.exe to flex.exe -Add C:\flex_bison to PATH -Verify by running `flex --version` -Verify by running `bison --version` -1. gperf -Install from http://gnuwin32.sourceforge.net/downlinks/gperf.php -Add C:\Program Files (x86)\GnuWin32\bin to PATH -Verify by running `gperf --version` -1. 7-zip -Download from https://www.7-zip.org/download.html -1. Bash shell -From *Settings* select *Update & Security* -Select *For Developers* -Enable *Developer mode* -Restart PC -Open Control Panel and select *Programs and Features* -Select *Turn Windows features on or off* -Check *Windows Subsystem for Linux* -Click *Restart now* -Download from the Microsoft Store - Search for *bash* and choose the latest Ubuntu version -[First run will take a few minutes] -Enter a user name - all small letters (this is used for *sudo* commands) -Choose a password +Verify that python runs python 2.7 (run “python --version”) +1. git >= 1.6 +Check if needed `git --version` +Download from https://git-scm.com/download/win +Verify by entering `git --version` +1. perl >= 5.14 +Install from Strawberry Perl - http://strawberryperl.com/ - 5.28.1.1 64 bit to C:\Strawberry\ +Verify by running `perl --version` +1. flex and bison +Download from https://sourceforge.net/projects/winflexbison/files/latest/download +Uncompress in C:\flex_bison +Rename win-bison.exe to bison.exe and win-flex.exe to flex.exe +Add C:\flex_bison to PATH +Verify by running `flex --version` +Verify by running `bison --version` +1. gperf +Install from http://gnuwin32.sourceforge.net/downlinks/gperf.php +Add C:\Program Files (x86)\GnuWin32\bin to PATH +Verify by running `gperf --version` +1. 7-zip +Download from https://www.7-zip.org/download.html +1. Bash shell +From *Settings* select *Update & Security* +Select *For Developers* +Enable *Developer mode* +Restart PC +Open Control Panel and select *Programs and Features* +Select *Turn Windows features on or off* +Check *Windows Subsystem for Linux* +Click *Restart now* +Download from the Microsoft Store - Search for *bash* and choose the latest Ubuntu version +[First run will take a few minutes] +Enter a user name - all small letters (this is used for *sudo* commands) +Choose a password ### Linux -Tested on Ubuntu 16.04 and 18.04. +Tested on Ubuntu 16.04 and 18.04. **16.04 NEEDED FOR JENKINS~~ ** -1. qt5 requirements -edit /etc/apt/sources.list (edit as root) -replace all *# deb-src* with *deb-src* (in vi `1,$s/# deb-src/deb-src/`) -`sudo apt-get update -y` -`sudo apt-get upgrade -y` -`sudo apt-get build-dep qt5-default -y` -1. git >= 1.6 -Check if needed `git --version` -`sudo apt-get install git -y` -Verify again -1. python -Check if needed `python --version` - should return python 2.7.x -`sudo apt-get install python -y` (not python 3!) -Verify again -1. gperf -Check if needed `gperf --version` -`sudo apt-get install gperf -y` -Verify again -1. bison and flex -Check if needed `flex --version` and `bison --version` -`sudo apt-get install flex bison -y` -Verify again -1. pkg-config (needed for qtwebengine) -Check if needed `pkg-config --version` -`sudo apt-get install pkg-config -y` -Verify again -1. OpenGL -Verify (first install mesa-utils - `sudo apt install mesa-utils -y`) by `glxinfo | grep "OpenGL version"` -`sudo apt-get install libgl1-mesa-dev -y` -`sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.346.35 /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0` -Verify again -1. make -Check if needed `make --version` -`sudo apt-get install make -y` -Verify again -1. g++ -Check if needed - `g++ --version` -`sudo apt-get install g++ -y` -Verify again -1. dbus-1 (needed for qtwebengine) -`sudo apt-get install libdbus-glib-1-dev -y` -1. nss (needed for qtwebengine) -`sudo apt-get install libnss3-dev -y` +1. qt5 requirements +edit /etc/apt/sources.list (edit as root) +replace all *# deb-src* with *deb-src* (in vi `1,$s/# deb-src/deb-src/`) +`sudo apt-get update -y` +`sudo apt-get upgrade -y` +`sudo apt-get build-dep qt5-default -y` +1. git >= 1.6 +Check if needed `git --version` +`sudo apt-get install git -y` +Verify again +1. python +Check if needed `python --version` - should return python 2.7.x +`sudo apt-get install python -y` (not python 3!) +Verify again +1. gperf +Check if needed `gperf --version` +`sudo apt-get install gperf -y` +Verify again +1. bison and flex +Check if needed `flex --version` and `bison --version` +`sudo apt-get install flex bison -y` +Verify again +1. pkg-config (needed for qtwebengine) +Check if needed `pkg-config --version` +`sudo apt-get install pkg-config -y` +Verify again +1. OpenGL +Verify (first install mesa-utils - `sudo apt install mesa-utils -y`) by `glxinfo | grep "OpenGL version"` +`sudo apt-get install libgl1-mesa-dev -y` +`sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.346.35 /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0` +Verify again +1. make +Check if needed `make --version` +`sudo apt-get install make -y` +Verify again +1. g++ +Check if needed + `g++ --version` +`sudo apt-get install g++ -y` +Verify again +1. dbus-1 (needed for qtwebengine) +`sudo apt-get install libdbus-glib-1-dev -y` +1. nss (needed for qtwebengine) +`sudo apt-get install libnss3-dev -y` ### Mac -1. git >= 1.6 -Check if needed `git --version` -Install from https://git-scm.com/download/mac -Verify again -1. pkg-config -brew fontconfig dbus-glib stall pkg-config -1. dbus-1 -brew install dbus-glib +1. git >= 1.6 +Check if needed `git --version` +Install from https://git-scm.com/download/mac +Verify again +1. pkg-config +brew fontconfig dbus-glib stall pkg-config +1. dbus-1 +brew install dbus-glib ## Build Process ### General -qt is cloned to the qt5 folder. -The build is performed in the qt5-build folder. -Build products are installed to the qt5-install folder. -Before running configure, make sure that the qt5-build folder is empty. +qt is cloned to the qt5 folder. +The build is performed in the qt5-build folder. +Build products are installed to the qt5-install folder. +Before running configure, make sure that the qt5-build folder is empty. -**Only run the git patches once!!!** +**Only run the git patches once!!!** ### Windows -Before building, verify that **HIFI_VCPKG_BASE_VERSION** points to a *vcpkg* folder containing *packages\openssl-windows_x64-windows*. -If not, follow https://github.com/highfidelity/vcpkg to install *vcpkg* and then *openssl*. +Before building, verify that **HIFI_VCPKG_BASE_VERSION** points to a *vcpkg* folder containing *packages\openssl-windows_x64-windows*. +If not, follow https://github.com/highfidelity/vcpkg to install *vcpkg* and then *openssl*. #### Preparing source files -`git clone --recursive https://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` - -* Copy the **patches** folder to qt5 -* Copy the **qt5vars.bat** file to qt5 -* Apply the two patches to Qt +`git clone --recursive https://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` -`cd qt5` -`git apply --ignore-space-change --ignore-whitespace patches/qfloat16.patch` -`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` -`cd ..` -#### Configuring -`mkdir qt5-install` -`mkdir qt5-build` -`cd qt5-build` +* Copy the **patches** folder to qt5 +* Copy the **qt5vars.bat** file to qt5 +* Apply the two patches to Qt -run `..\qt5\qt5vars.bat` -`cd ..\..\qt5-build` - -`..\qt5\configure -force-debug-info -opensource -confirm-license -opengl desktop -platform win32-msvc -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\include -L %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\lib -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ..\qt5-install` -#### Make -`nmake` -`nmake install` -#### Fixing -The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) -1. Open a bash terminal -1. `cd` to the *qt5-install* folder (e.g. `cd /mnt/d/qt5-install/`) -1. Run the following command -`find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` -1. Copy *qt.conf* to *qt5-install\bin* -#### Uploading -Create a tar file called qt5-install.tar from the qt5-install folder (e.g. using 7-zip) -Create a gzip file called qt5-install.tar.gz from the qt5-install.tar file just created (e.g. using 7-zip) -Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ -### Linux -#### Preparing source files -`git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` - -* Copy the **patches** folder to qt5 -* Apply one patch to Qt -`cd qt5` -`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` +`cd qt5` +`git apply --ignore-space-change --ignore-whitespace patches/qfloat16.patch` +`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` `cd ..` #### Configuring -`mkdir qt5-install` -`mkdir qt5-build` -`cd qt5-build` +`mkdir qt5-install` +`mkdir qt5-build` +`cd qt5-build` -*Ubuntu 16.04* -`../qt5/configure -opensource -confirm-license -platform linux-g++-64 -qt-zlib -qt-libjpeg -qt-libpng -qt-xcb -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -no-egl -no-icu -prefix ../qt5-install` +run `..\qt5\qt5vars.bat` +`cd ..\..\qt5-build` -*Ubuntu 18.04* -`../qt5/configure -force-debug-info -release -opensource -confirm-license -gdb-index -recheck-all -nomake tests -nomake examples -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -c++std c++14 -prefix ../qt5-install` - - -???`../qt5/configure -opensource -confirm-license -gdb-index -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` -#### Make -`make` - -????*Ubuntu 18.04 only* -????`make module-qtwebengine` -????`make module-qtscript` - -*Both* -`make install` -#### Fixing -1. The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) -`cd ../qt5-install` -`find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` -1. Copy *qt.conf* to *qt5-install\bin* -#### Uploading -*Ubuntu 16.04* -1. Return to the home folder -`cd ..` -1. Open a python 3 shell -`python3` -1. Run the following snippet: -`import os` -`import tarfile` -`filename=tarfile.open("qt5-install.tar.gz", "w:gz")` -`filename.add("qt5-install", os.path.basename("qt5-install"))` -`exit()` -1. Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/16.04 - -*Ubuntu 18.04* -``tar -zcvf qt5-install.tar.gz qt5-install` -1. Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/18.04 - -1. ### Mac -#### Preparing source files -git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch - -* Copy the **patches** folder to qt5 -* Apply one patch to Qt -`cd qt5` -`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` -`cd ..` -#### Configuring -`mkdir qt5-install` -`mkdir qt5-build` -`cd ../qt5-build` - -`../qt5/configure -force-debug-info -opensource -confirm-license -qt-zlib -qt-libjpeg -qt-libpng -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` +`..\qt5\configure -force-debug-info -opensource -confirm-license -opengl desktop -platform win32-msvc -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\include -L %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\lib -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ..\qt5-install` #### Make -`make` -`make install` +`nmake` +`nmake install` #### Fixing -1. The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) -`cd ../qt5-install` -`find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` -`cd ..` -1. Copy *qt.conf* to *qt5-install\bin* +The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) +1. Open a bash terminal +1. `cd` to the *qt5-install* folder (e.g. `cd /mnt/d/qt5-install/`) +1. Run the following command +`find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` +1. Copy *qt.conf* to *qt5-install\bin* #### Uploading -`tar -zcvf qt5-install.tar.gz qt5-install` -Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Mac/ +Create a tar file called qt5-install.tar from the qt5-install folder (e.g. using 7-zip) +Create a gzip file called qt5-install.tar.gz from the qt5-install.tar file just created (e.g. using 7-zip) +Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ +### Linux +#### Preparing source files +`git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` + +* Copy the **patches** folder to qt5 +* Apply one patch to Qt +`cd qt5` +`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` +`cd ..` +#### Configuring +`mkdir qt5-install` +`mkdir qt5-build` +`cd qt5-build` + +*Ubuntu 16.04* +`../qt5/configure -opensource -confirm-license -platform linux-g++-64 -qt-zlib -qt-libjpeg -qt-libpng -qt-xcb -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -no-egl -no-icu -prefix ../qt5-install` + +*Ubuntu 18.04* +`../qt5/configure -force-debug-info -release -opensource -confirm-license -gdb-index -recheck-all -nomake tests -nomake examples -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -c++std c++14 -prefix ../qt5-install` + + +???`../qt5/configure -opensource -confirm-license -gdb-index -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` +#### Make +`make` + +????*Ubuntu 18.04 only* +????`make module-qtwebengine` +????`make module-qtscript` + +*Both* +`make install` +#### Fixing +1. The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) +`cd ../qt5-install` +`find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` +1. Copy *qt.conf* to *qt5-install\bin* +#### Uploading +*Ubuntu 16.04* +1. Return to the home folder +`cd ..` +1. Open a python 3 shell +`python3` +1. Run the following snippet: +`import os` +`import tarfile` +`filename=tarfile.open("qt5-install.tar.gz", "w:gz")` +`filename.add("qt5-install", os.path.basename("qt5-install"))` +`exit()` +1. Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/16.04 + +*Ubuntu 18.04* +``tar -zcvf qt5-install.tar.gz qt5-install` +1. Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/18.04 + +1. ### Mac +#### Preparing source files +git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch + +* Copy the **patches** folder to qt5 +* Apply one patch to Qt +`cd qt5` +`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` +`cd ..` +#### Configuring +`mkdir qt5-install` +`mkdir qt5-build` +`cd ../qt5-build` + +`../qt5/configure -force-debug-info -opensource -confirm-license -qt-zlib -qt-libjpeg -qt-libpng -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` +#### Make +`make` +`make install` +#### Fixing +1. The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) +`cd ../qt5-install` +`find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` +`cd ..` +1. Copy *qt.conf* to *qt5-install\bin* +#### Uploading +`tar -zcvf qt5-install.tar.gz qt5-install` +Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Mac/ ## Problems *configure* errors, if any, may be viewed in **config.log** and **config.summary** diff --git a/tools/qt-builder/qt5vars.bat b/tools/qt-builder/qt5vars.bat index 10ad5be4ae..22a976827b 100644 --- a/tools/qt-builder/qt5vars.bat +++ b/tools/qt-builder/qt5vars.bat @@ -1,6 +1,6 @@ @echo off -REM Set up \Microsoft Visual Studio 2015, where is \c amd64, \c x86, etc. +REM Set up \Microsoft Visual Studio 2017, where is \c amd64, \c x86, etc. CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 REM Edit this location to point to the source code of Qt From 78fdd2d6738d18449e5a799244859b63e0905104 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Thu, 23 May 2019 14:25:06 -0700 Subject: [PATCH 15/17] Fix BUGZ-336 --- .../hifi/simplifiedUI/settingsApp/audio/Audio.qml | 14 +++++--------- .../qml/hifi/simplifiedUI/settingsApp/vr/VR.qml | 14 +++++--------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/interface/resources/qml/hifi/simplifiedUI/settingsApp/audio/Audio.qml b/interface/resources/qml/hifi/simplifiedUI/settingsApp/audio/Audio.qml index 9ac72fa3cd..c43f432582 100644 --- a/interface/resources/qml/hifi/simplifiedUI/settingsApp/audio/Audio.qml +++ b/interface/resources/qml/hifi/simplifiedUI/settingsApp/audio/Audio.qml @@ -251,6 +251,7 @@ Flickable { } SimplifiedControls.Button { + id: audioLoopbackButton property bool audioLoopedBack: AudioScriptingInterface.getLocalEcho() function startAudioLoopback() { @@ -266,17 +267,14 @@ Flickable { } } - Timer { - id: loopbackTimer - interval: 8000 - running: false - repeat: false - onTriggered: { + Component.onDestruction: stopAudioLoopback(); + + onVisibleChanged: { + if (!visible) { stopAudioLoopback(); } } - id: testYourMicButton enabled: !HMD.active anchors.left: parent.left Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin @@ -285,10 +283,8 @@ Flickable { text: audioLoopedBack ? "STOP TESTING" : "TEST YOUR MIC" onClicked: { if (audioLoopedBack) { - loopbackTimer.stop(); stopAudioLoopback(); } else { - loopbackTimer.restart(); startAudioLoopback(); } } diff --git a/interface/resources/qml/hifi/simplifiedUI/settingsApp/vr/VR.qml b/interface/resources/qml/hifi/simplifiedUI/settingsApp/vr/VR.qml index 96dbc5e180..549c4aced5 100644 --- a/interface/resources/qml/hifi/simplifiedUI/settingsApp/vr/VR.qml +++ b/interface/resources/qml/hifi/simplifiedUI/settingsApp/vr/VR.qml @@ -235,6 +235,7 @@ Flickable { } SimplifiedControls.Button { + id: audioLoopbackButton property bool audioLoopedBack: AudioScriptingInterface.getLocalEcho() function startAudioLoopback() { @@ -250,17 +251,14 @@ Flickable { } } - Timer { - id: loopbackTimer - interval: 8000 - running: false - repeat: false - onTriggered: { + Component.onDestruction: stopAudioLoopback(); + + onVisibleChanged: { + if (!visible) { stopAudioLoopback(); } } - id: testYourMicButton enabled: HMD.active anchors.left: parent.left Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin @@ -269,10 +267,8 @@ Flickable { text: audioLoopedBack ? "STOP TESTING" : "TEST YOUR MIC" onClicked: { if (audioLoopedBack) { - loopbackTimer.stop(); stopAudioLoopback(); } else { - loopbackTimer.restart(); startAudioLoopback(); } } From 42c1f4be33dd215d34c57d2b13b99f67d21e4f3b Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Thu, 23 May 2019 17:07:06 -0700 Subject: [PATCH 16/17] fix typo and entry on first run when --url is set --- interface/src/Application.cpp | 20 +++++++++++++------- interface/src/Application.h | 4 +++- interface/src/main.cpp | 5 ++++- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index ca171aa8b9..5432577223 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3800,10 +3800,14 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { // If this is a first run we short-circuit the address passed in if (_firstRun.get()) { - DependencyManager::get()->goToEntry(); - sentTo = SENT_TO_ENTRY; - _firstRun.set(false); - + if (!_overrideEntry) { + DependencyManager::get()->goToEntry(); + sentTo = SENT_TO_ENTRY; + } else { + DependencyManager::get()->loadSettings(addressLookupString); + sentTo = SENT_TO_PREVIOUS_LOCATION; + } + _firstRun.set(false); } else { QString goingTo = ""; if (addressLookupString.isEmpty()) { @@ -3819,7 +3823,7 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { DependencyManager::get()->loadSettings(addressLookupString); sentTo = SENT_TO_PREVIOUS_LOCATION; } - + UserActivityLogger::getInstance().logAction("startup_sent_to", { { "sent_to", sentTo }, { "sandbox_is_running", sandboxIsRunning }, @@ -9354,11 +9358,13 @@ void Application::showUrlHandler(const QUrl& url) { } }); } - +void Application::overrideEntry(){ + _overrideEntry = true; +} void Application::forceDisplayName(const QString& displayName) { getMyAvatar()->setDisplayName(displayName); } -void Application::forceLogginWithTokens(const QString& tokens) { +void Application::forceLoginWithTokens(const QString& tokens) { DependencyManager::get()->setAccessTokens(tokens); } void Application::setConfigFileURL(const QString& fileUrl) { diff --git a/interface/src/Application.h b/interface/src/Application.h index 2eac2bc885..837fb8eae6 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -356,8 +356,9 @@ public: void openDirectory(const QString& path); + void overrideEntry(); void forceDisplayName(const QString& displayName); - void forceLogginWithTokens(const QString& tokens); + void forceLoginWithTokens(const QString& tokens); void setConfigFileURL(const QString& fileUrl); signals: @@ -832,5 +833,6 @@ private: bool _resumeAfterLoginDialogActionTaken_WasPostponed { false }; bool _resumeAfterLoginDialogActionTaken_SafeToRun { false }; bool _startUpFinished { false }; + bool _overrideEntry { false }; }; #endif // hifi_Application_h diff --git a/interface/src/main.cpp b/interface/src/main.cpp index 140b79584c..7fc4a5b651 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -407,6 +407,9 @@ int main(int argc, const char* argv[]) { auto appPointer = dynamic_cast(&app); if (appPointer) { + if (parser.isSet(urlOption)) { + appPointer->overrideEntry(); + } if (parser.isSet(displayNameOption)) { QString displayName = QString(parser.value(displayNameOption)); appPointer->forceDisplayName(displayName); @@ -416,7 +419,7 @@ int main(int argc, const char* argv[]) { } if (parser.isSet(responseTokensOption)) { QString tokens = QString(parser.value(responseTokensOption)); - appPointer->forceLogginWithTokens(tokens); + appPointer->forceLoginWithTokens(tokens); } } From 050682c84cc90f1c9cc573d25574374b5bdd63a8 Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Thu, 23 May 2019 19:53:37 -0700 Subject: [PATCH 17/17] Keep logged in after first run --- interface/src/Application.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 5432577223..a0cb790958 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -9366,6 +9366,7 @@ void Application::forceDisplayName(const QString& displayName) { } void Application::forceLoginWithTokens(const QString& tokens) { DependencyManager::get()->setAccessTokens(tokens); + Setting::Handle(KEEP_ME_LOGGED_IN_SETTING_NAME, true).set(true); } void Application::setConfigFileURL(const QString& fileUrl) { DependencyManager::get()->setConfigFileURL(fileUrl);