From 2ab38ace1bccdb4ae83d269728c9143c81573364 Mon Sep 17 00:00:00 2001 From: Adrianl3d Date: Tue, 30 Sep 2014 16:34:47 +1000 Subject: [PATCH 01/14] Improved contrast to textOverlay and resize Increased background alpha, increased text color, and resize to allow for new properties. --- examples/editModels.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/editModels.js b/examples/editModels.js index c47c497a78..036a0c3834 100644 --- a/examples/editModels.js +++ b/examples/editModels.js @@ -2395,7 +2395,7 @@ function Tooltip() { this.x = 285; this.y = 115; this.width = 500; - this.height = 180; // 145; + this.height = 300; // 145; this.margin = 5; this.decimals = 3; @@ -2406,8 +2406,8 @@ function Tooltip() { height: this.height, margin: this.margin, text: "", - color: { red: 128, green: 128, blue: 128 }, - alpha: 0.2, + color: { red: 228, green: 228, blue: 228 }, + alpha: 0.5, visible: false }); this.show = function (doShow) { From 0174a985ee1a078fb5c45f5d17d096155f8086c1 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 1 Oct 2014 09:56:13 -0700 Subject: [PATCH 02/14] add a domain-server scripts folder that is ignored for clean symlink --- domain-server/resources/web/assignment/scripts/.gitignore | 4 ++++ domain-server/src/DomainServer.cpp | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 domain-server/resources/web/assignment/scripts/.gitignore diff --git a/domain-server/resources/web/assignment/scripts/.gitignore b/domain-server/resources/web/assignment/scripts/.gitignore new file mode 100644 index 0000000000..86d0cb2726 --- /dev/null +++ b/domain-server/resources/web/assignment/scripts/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore \ No newline at end of file diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index fb475f681d..639d32c823 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1047,7 +1047,7 @@ const char ASSIGNMENT_SCRIPT_HOST_LOCATION[] = "resources/web/assignment"; QString pathForAssignmentScript(const QUuid& assignmentUUID) { QString newPath(ASSIGNMENT_SCRIPT_HOST_LOCATION); - newPath += "/"; + newPath += "/scripts/"; // append the UUID for this script as the new filename, remove the curly braces newPath += uuidStringWithoutCurlyBraces(assignmentUUID); return newPath; @@ -1086,7 +1086,7 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url // via correct URL for the script so the client can download QUrl scriptURL = url; - scriptURL.setPath(URI_ASSIGNMENT + "/" + scriptURL.setPath(URI_ASSIGNMENT + "/scripts/" + uuidStringWithoutCurlyBraces(pendingData->getAssignmentUUID())); // have the HTTPManager serve the appropriate script file From a4b4fc52b6d45cd1a8ea2efb36be6e836b1760fc Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 1 Oct 2014 11:57:44 -0700 Subject: [PATCH 03/14] handle select inputs in domain server settings creation --- domain-server/resources/web/js/settings.js | 26 +++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/domain-server/resources/web/js/settings.js b/domain-server/resources/web/js/settings.js index fa05b1cce9..48b3b15e8f 100644 --- a/domain-server/resources/web/js/settings.js +++ b/domain-server/resources/web/js/settings.js @@ -33,9 +33,24 @@ var viewHelpers = { input_type = _.has(setting, 'type') ? setting.type : "text" form_group += ""; - form_group += "" + + if (setting.type === 'select') { + form_group += "" + + form_group += "" + } else { + form_group += "" + } + form_group += "" + setting.help + "" } @@ -90,6 +105,11 @@ $(document).ready(function(){ $('#settings-form').on('click', '#choose-domain-btn', function(){ chooseFromHighFidelityDomains($(this)) }) + + $('#settings-form').on('change', 'select', function(){ + console.log("Changed" + $(this)) + $("input[name='" + $(this).attr('data-hidden-input') + "']").val($(this).val()).change() + }) var panelsSource = $('#panels-template').html() Settings.panelsTemplate = _.template(panelsSource) From 84a3f6e8f433596c6b8aec99315da79030989fe0 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Wed, 1 Oct 2014 15:00:19 -0700 Subject: [PATCH 04/14] Make recalibrate Leap-on-desk if avatar scale changes --- examples/leapHands.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/examples/leapHands.js b/examples/leapHands.js index cc50a328f8..422aed940f 100644 --- a/examples/leapHands.js +++ b/examples/leapHands.js @@ -30,7 +30,9 @@ var leapHands = (function () { CALIBRATED = 2, CALIBRATION_TIME = 1000, // milliseconds PI = 3.141593, - isWindows; + isWindows, + avatarScale, + settingsTimer; function printSkeletonJointNames() { var jointNames, @@ -164,6 +166,8 @@ var leapHands = (function () { calibrationStatus = CALIBRATING; + avatarScale = MyAvatar.scale; + // Set avatar arms vertical, forearms horizontal, as "zero" position for calibration MyAvatar.setJointData("LeftArm", Quat.fromPitchYawRollDegrees(90.0, 0.0, -90.0)); MyAvatar.setJointData("LeftForeArm", Quat.fromPitchYawRollDegrees(90.0, 0.0, 180.0)); @@ -189,6 +193,13 @@ var leapHands = (function () { return false; } + function checkSettings() { + if (!isOnHMD && calibrationStatus && MyAvatar.scale !== avatarScale) { + print("Leap Motion: Recalibrate because avatar scale changed"); + calibrationStatus = UNCALIBRATED; + } + } + function setUp() { // TODO: Leap Motion controller joint naming doesn't match up with skeleton joint naming; numbers are out by 1. @@ -280,6 +291,8 @@ var leapHands = (function () { print("Leap Motion is on desk"); calibrationStatus = UNCALIBRATED; } + + settingsTimer = Script.setInterval(checkSettings, 2000); } function moveHands() { @@ -302,7 +315,7 @@ var leapHands = (function () { if (hands[h].controller.isActive()) { - // Calibrate when and if a controller is first active. + // Calibrate if necessary. if (!checkCalibration()) { return; } @@ -430,6 +443,8 @@ var leapHands = (function () { i, j; + Script.clearInterval(settingsTimer); + for (h = 0; h < NUM_HANDS; h += 1) { Controller.releaseInputController(hands[h].controller); Controller.releaseInputController(wrists[h].controller); From 38b6d5dd5d49bc8a77b14875d5f17ed0954ea9aa Mon Sep 17 00:00:00 2001 From: David Rowe Date: Wed, 1 Oct 2014 16:05:19 -0700 Subject: [PATCH 05/14] Make leapHands.js handle Leap-on-HMD setting changes --- examples/leapHands.js | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/examples/leapHands.js b/examples/leapHands.js index 422aed940f..c7da249892 100644 --- a/examples/leapHands.js +++ b/examples/leapHands.js @@ -14,6 +14,7 @@ var leapHands = (function () { var isOnHMD, + LEAP_ON_HMD_MENU_ITEM = "Leap Motion on HMD", LEAP_OFFSET = 0.019, // Thickness of Leap Motion plus HMD clip HMD_OFFSET = 0.100, // Eyeballs to front surface of Oculus DK2 TODO: Confirm and make depend on device and eye relief hands, @@ -193,11 +194,33 @@ var leapHands = (function () { return false; } + function setIsOnHMD() { + isOnHMD = Menu.isOptionChecked(LEAP_ON_HMD_MENU_ITEM); + if (isOnHMD) { + print("Leap Motion: Is on HMD"); + + // Offset of Leap Motion origin from physical eye position + hands[0].zeroPosition = { x: 0.0, y: 0.0, z: HMD_OFFSET + LEAP_OFFSET }; + hands[1].zeroPosition = { x: 0.0, y: 0.0, z: HMD_OFFSET + LEAP_OFFSET }; + + calibrationStatus = CALIBRATED; + } else { + print("Leap Motion: Is on desk"); + calibrationStatus = UNCALIBRATED; + } + } + function checkSettings() { + // There is no "scale changed" event so we need check periodically. if (!isOnHMD && calibrationStatus && MyAvatar.scale !== avatarScale) { print("Leap Motion: Recalibrate because avatar scale changed"); calibrationStatus = UNCALIBRATED; } + + // There is a "menu changed" event but we may as well check here. + if (isOnHMD !== Menu.isOptionChecked(LEAP_ON_HMD_MENU_ITEM)) { + setIsOnHMD(); + } } function setUp() { @@ -278,19 +301,7 @@ var leapHands = (function () { ] ]; - isOnHMD = Menu.isOptionChecked("Leap Motion on HMD"); - if (isOnHMD) { - print("Leap Motion is on HMD"); - - // Offset of Leap Motion origin from physical eye position - hands[0].zeroPosition = { x: 0.0, y: 0.0, z: HMD_OFFSET + LEAP_OFFSET }; - hands[1].zeroPosition = { x: 0.0, y: 0.0, z: HMD_OFFSET + LEAP_OFFSET }; - - calibrationStatus = CALIBRATED; - } else { - print("Leap Motion is on desk"); - calibrationStatus = UNCALIBRATED; - } + setIsOnHMD(); settingsTimer = Script.setInterval(checkSettings, 2000); } From 51f229af570deed0852ff0f08df4a12b246b191c Mon Sep 17 00:00:00 2001 From: David Rowe Date: Wed, 1 Oct 2014 18:34:56 -0700 Subject: [PATCH 06/14] Make recalibrate Leap-on-desk if avatar head or skeleton changes --- examples/leapHands.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/leapHands.js b/examples/leapHands.js index c7da249892..1095a9f4dc 100644 --- a/examples/leapHands.js +++ b/examples/leapHands.js @@ -33,6 +33,8 @@ var leapHands = (function () { PI = 3.141593, isWindows, avatarScale, + avatarFaceModelURL, + avatarSkeletonModelURL, settingsTimer; function printSkeletonJointNames() { @@ -168,6 +170,8 @@ var leapHands = (function () { calibrationStatus = CALIBRATING; avatarScale = MyAvatar.scale; + avatarFaceModelURL = MyAvatar.faceModelURL; + avatarSkeletonModelURL = MyAvatar.skeletonModelURL; // Set avatar arms vertical, forearms horizontal, as "zero" position for calibration MyAvatar.setJointData("LeftArm", Quat.fromPitchYawRollDegrees(90.0, 0.0, -90.0)); @@ -212,8 +216,10 @@ var leapHands = (function () { function checkSettings() { // There is no "scale changed" event so we need check periodically. - if (!isOnHMD && calibrationStatus && MyAvatar.scale !== avatarScale) { - print("Leap Motion: Recalibrate because avatar scale changed"); + if (!isOnHMD && calibrationStatus > UNCALIBRATED && (MyAvatar.scale !== avatarScale + || MyAvatar.faceModelURL !== avatarFaceModelURL + || MyAvatar.skeletonModelURL !== avatarSkeletonModelURL)) { + print("Leap Motion: Recalibrate because avatar body or scale changed"); calibrationStatus = UNCALIBRATED; } From 172ee3d7dc40469b166c8ce7140d78619cd8916c Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 2 Oct 2014 09:06:29 -0700 Subject: [PATCH 07/14] add failsafe for hydra load, look in app frameworks folder --- interface/CMakeLists.txt | 2 ++ interface/src/devices/SixenseManager.cpp | 24 +++++++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index ddc034801b..5af8bcdd6b 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -139,6 +139,8 @@ foreach(EXTERNAL ${OPTIONAL_EXTERNALS}) if (NOT APPLE OR NOT ${${EXTERNAL}_UPPERCASE} MATCHES "SIXENSE") target_link_libraries(${TARGET_NAME} ${${${EXTERNAL}_UPPERCASE}_LIBRARIES}) + elseif (APPLE) + add_definitions(-DSIXENSE_LIB_FILENAME=\"${${${EXTERNAL}_UPPERCASE}_LIBRARY_RELEASE}\") endif () endif () endforeach() diff --git a/interface/src/devices/SixenseManager.cpp b/interface/src/devices/SixenseManager.cpp index c3d694d06c..5fe2b9969c 100644 --- a/interface/src/devices/SixenseManager.cpp +++ b/interface/src/devices/SixenseManager.cpp @@ -96,15 +96,29 @@ void SixenseManager::initialize() { #ifdef __APPLE__ if (!_sixenseLibrary) { - const QString SIXENSE_LIBRARY_NAME = "libsixense_x64.dylib"; - _sixenseLibrary = new QLibrary(SIXENSE_LIBRARY_NAME); + + +#ifdef SIXENSE_LIB_FILENAME + _sixenseLibrary = new QLibrary(SIXENSE_LIB_FILENAME); +#else + const QString SIXENSE_LIBRARY_NAME = "libsixense_x64"; + QFileInfo frameworkSixenseLibrary = QCoreApplication::applicationDirPath() + "../Frameworks/" + + SIXENSE_LIBRARY_NAME; + + _sixenseLibrary = new QLibrary(frameworkSixenseLibrary.fileName()); +#endif + } + + if (_sixenseLibrary->load()){ + qDebug() << "Loaded sixense library for hydra support -" << _sixenseLibrary->fileName(); + } else { + qDebug() << "Sixense library at" << _sixenseLibrary->fileName() << "failed to load." + << "Continuing without hydra support."; + return; } - qDebug() << "Initializing sixense library for hydra support - libsixense_x64.dylib load state is" - << _sixenseLibrary->isLoaded(); SixenseBaseFunction sixenseInit = (SixenseBaseFunction) _sixenseLibrary->resolve("sixenseInit"); #endif - sixenseInit(); _isInitialized = true; From b6e0b08a29836aa1847051fc346abb26efd2e3ab Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 2 Oct 2014 10:07:02 -0700 Subject: [PATCH 08/14] add debug to domain server if script not saved --- domain-server/src/DomainServer.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 639d32c823..8f93c7a13e 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1261,16 +1261,21 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url // create a file with the GUID of the assignment in the script host location QFile scriptFile(newPath); - scriptFile.open(QIODevice::WriteOnly); - scriptFile.write(formData[0].second); - - qDebug() << qPrintable(QString("Saved a script for assignment at %1%2") - .arg(newPath).arg(assignmentPool == emptyPool ? "" : " - pool is " + assignmentPool)); - - // add the script assigment to the assignment queue - SharedAssignmentPointer sharedScriptedAssignment(scriptAssignment); - _unfulfilledAssignments.enqueue(sharedScriptedAssignment); - _allAssignments.insert(sharedScriptedAssignment->getUUID(), sharedScriptedAssignment); + if (scriptFile.open(QIODevice::WriteOnly)) { + scriptFile.write(formData[0].second); + + qDebug() << qPrintable(QString("Saved a script for assignment at %1%2") + .arg(newPath).arg(assignmentPool == emptyPool ? "" : " - pool is " + assignmentPool)); + + // add the script assigment to the assignment queue + SharedAssignmentPointer sharedScriptedAssignment(scriptAssignment); + _unfulfilledAssignments.enqueue(sharedScriptedAssignment); + _allAssignments.insert(sharedScriptedAssignment->getUUID(), sharedScriptedAssignment); + } else { + // unable to save script for assignment - we shouldn't be here but debug it out + qDebug() << "Unable to save a script for assignment at" << newPath; + qDebug() << "Script will not be added to queue"; + } } // respond with a 200 code for successful upload From 89907136faf38f0e6edf04c0dcf2dc1b9adb25d9 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 2 Oct 2014 10:15:12 -0700 Subject: [PATCH 09/14] one more debug line for script redirect --- domain-server/src/DomainServer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 8f93c7a13e..8b8874c73b 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1089,6 +1089,8 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url scriptURL.setPath(URI_ASSIGNMENT + "/scripts/" + uuidStringWithoutCurlyBraces(pendingData->getAssignmentUUID())); + qDebug() << "Serving" << scriptURL << "for assignment with ID" << matchingUUID; + // have the HTTPManager serve the appropriate script file return _httpManager.handleHTTPRequest(connection, scriptURL); } From 157fdf6afaeb5275f2660ac5bbaec2eb8cc883ce Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 2 Oct 2014 10:17:31 -0700 Subject: [PATCH 10/14] cleanup debug for script path --- domain-server/src/DomainServer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 8b8874c73b..c4ae5c08f3 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1089,7 +1089,8 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url scriptURL.setPath(URI_ASSIGNMENT + "/scripts/" + uuidStringWithoutCurlyBraces(pendingData->getAssignmentUUID())); - qDebug() << "Serving" << scriptURL << "for assignment with ID" << matchingUUID; + qDebug() << "Serving" << scriptURL.toString() << "for assignment with ID" + << uuidStringWithoutCurlyBraces(matchingUUID); // have the HTTPManager serve the appropriate script file return _httpManager.handleHTTPRequest(connection, scriptURL); From 4749fdb0bae20d12b5d531e93f666be615ae3e1c Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 2 Oct 2014 10:38:46 -0700 Subject: [PATCH 11/14] allow calls to HTTPManager to skip the subHandler and ask for direct processing --- domain-server/src/DomainServer.cpp | 12 +++++------- domain-server/src/DomainServer.h | 4 ++-- libraries/embedded-webserver/src/HTTPManager.cpp | 4 ++-- libraries/embedded-webserver/src/HTTPManager.h | 4 ++-- libraries/embedded-webserver/src/HTTPSManager.cpp | 8 ++++---- libraries/embedded-webserver/src/HTTPSManager.h | 6 +++--- 6 files changed, 18 insertions(+), 20 deletions(-) diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index c4ae5c08f3..786fd58d61 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1053,10 +1053,11 @@ QString pathForAssignmentScript(const QUuid& assignmentUUID) { return newPath; } -bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url) { +bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler) { const QString JSON_MIME_TYPE = "application/json"; const QString URI_ASSIGNMENT = "/assignment"; + const QString URI_ASSIGNMENT_SCRIPTS = URI_ASSIGNMENT + "/scripts"; const QString URI_NODES = "/nodes"; const QString UUID_REGEX_STRING = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"; @@ -1067,7 +1068,7 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url } // check if this is a request for a scripted assignment (with a temp unique UUID) - const QString ASSIGNMENT_REGEX_STRING = QString("\\%1\\/(%2)\\/?$").arg(URI_ASSIGNMENT).arg(UUID_REGEX_STRING); + const QString ASSIGNMENT_REGEX_STRING = QString("\\%1\\/(%2)\\/?$").arg(URI_ASSIGNMENT).arg(UUID_REGEX_STRING); QRegExp assignmentRegex(ASSIGNMENT_REGEX_STRING); if (connection->requestOperation() == QNetworkAccessManager::GetOperation @@ -1089,11 +1090,8 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url scriptURL.setPath(URI_ASSIGNMENT + "/scripts/" + uuidStringWithoutCurlyBraces(pendingData->getAssignmentUUID())); - qDebug() << "Serving" << scriptURL.toString() << "for assignment with ID" - << uuidStringWithoutCurlyBraces(matchingUUID); - // have the HTTPManager serve the appropriate script file - return _httpManager.handleHTTPRequest(connection, scriptURL); + return _httpManager.handleHTTPRequest(connection, scriptURL, true); } } } @@ -1327,7 +1325,7 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url const QString HIFI_SESSION_COOKIE_KEY = "DS_WEB_SESSION_UUID"; -bool DomainServer::handleHTTPSRequest(HTTPSConnection* connection, const QUrl &url) { +bool DomainServer::handleHTTPSRequest(HTTPSConnection* connection, const QUrl &url, bool skipSubHandler) { const QString URI_OAUTH = "/oauth"; qDebug() << "HTTPS request received at" << url.toString(); if (url.path() == URI_OAUTH) { diff --git a/domain-server/src/DomainServer.h b/domain-server/src/DomainServer.h index 44b8a15901..57d62291bd 100644 --- a/domain-server/src/DomainServer.h +++ b/domain-server/src/DomainServer.h @@ -43,8 +43,8 @@ public: static int const EXIT_CODE_REBOOT; - bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url); - bool handleHTTPSRequest(HTTPSConnection* connection, const QUrl& url); + bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler = false); + bool handleHTTPSRequest(HTTPSConnection* connection, const QUrl& url, bool skipSubHandler = false); public slots: /// Called by NodeList to inform us a node has been added diff --git a/libraries/embedded-webserver/src/HTTPManager.cpp b/libraries/embedded-webserver/src/HTTPManager.cpp index ec5f16012e..702d709f72 100755 --- a/libraries/embedded-webserver/src/HTTPManager.cpp +++ b/libraries/embedded-webserver/src/HTTPManager.cpp @@ -40,8 +40,8 @@ void HTTPManager::incomingConnection(qintptr socketDescriptor) { } } -bool HTTPManager::handleHTTPRequest(HTTPConnection* connection, const QUrl& url) { - if (requestHandledByRequestHandler(connection, url)) { +bool HTTPManager::handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler) { + if (!skipSubHandler && requestHandledByRequestHandler(connection, url)) { // this request was handled by our request handler object // so we don't need to attempt to do so in the document root return true; diff --git a/libraries/embedded-webserver/src/HTTPManager.h b/libraries/embedded-webserver/src/HTTPManager.h index e8745521dc..83c4103c15 100755 --- a/libraries/embedded-webserver/src/HTTPManager.h +++ b/libraries/embedded-webserver/src/HTTPManager.h @@ -24,7 +24,7 @@ class HTTPSConnection; class HTTPRequestHandler { public: /// Handles an HTTP request. - virtual bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url) = 0; + virtual bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler = false) = 0; }; /// Handles HTTP connections @@ -34,7 +34,7 @@ public: /// Initializes the manager. HTTPManager(quint16 port, const QString& documentRoot, HTTPRequestHandler* requestHandler = NULL, QObject* parent = 0); - bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url); + bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler = false); protected: /// Accepts all pending connections diff --git a/libraries/embedded-webserver/src/HTTPSManager.cpp b/libraries/embedded-webserver/src/HTTPSManager.cpp index 4e40a0e02c..94e1a35e20 100644 --- a/libraries/embedded-webserver/src/HTTPSManager.cpp +++ b/libraries/embedded-webserver/src/HTTPSManager.cpp @@ -38,12 +38,12 @@ void HTTPSManager::incomingConnection(qintptr socketDescriptor) { } } -bool HTTPSManager::handleHTTPRequest(HTTPConnection* connection, const QUrl &url) { - return handleHTTPSRequest(reinterpret_cast(connection), url); +bool HTTPSManager::handleHTTPRequest(HTTPConnection* connection, const QUrl &url, bool skipSubHandler) { + return handleHTTPSRequest(reinterpret_cast(connection), url, skipSubHandler); } -bool HTTPSManager::handleHTTPSRequest(HTTPSConnection* connection, const QUrl& url) { - return HTTPManager::handleHTTPRequest(connection, url); +bool HTTPSManager::handleHTTPSRequest(HTTPSConnection* connection, const QUrl& url, bool skipSubHandler) { + return HTTPManager::handleHTTPRequest(connection, url, skipSubHandler); } bool HTTPSManager::requestHandledByRequestHandler(HTTPConnection* connection, const QUrl& url) { diff --git a/libraries/embedded-webserver/src/HTTPSManager.h b/libraries/embedded-webserver/src/HTTPSManager.h index fe7c4dc065..66c0c76d0b 100644 --- a/libraries/embedded-webserver/src/HTTPSManager.h +++ b/libraries/embedded-webserver/src/HTTPSManager.h @@ -20,7 +20,7 @@ class HTTPSRequestHandler : public HTTPRequestHandler { public: /// Handles an HTTPS request - virtual bool handleHTTPSRequest(HTTPSConnection* connection, const QUrl& url) = 0; + virtual bool handleHTTPSRequest(HTTPSConnection* connection, const QUrl& url, bool skipSubHandler = false) = 0; }; class HTTPSManager : public HTTPManager, public HTTPSRequestHandler { @@ -35,8 +35,8 @@ public: void setCertificate(const QSslCertificate& certificate) { _certificate = certificate; } void setPrivateKey(const QSslKey& privateKey) { _privateKey = privateKey; } - bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url); - bool handleHTTPSRequest(HTTPSConnection* connection, const QUrl& url); + bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler = false); + bool handleHTTPSRequest(HTTPSConnection* connection, const QUrl& url, bool skipSubHandler = false); protected: void incomingConnection(qintptr socketDescriptor); From 138e57bcd8397cca573bcbbd19e8f1310e2451f3 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 2 Oct 2014 11:16:25 -0700 Subject: [PATCH 12/14] don't set SIXENSE_LIB_FILENAME for INSTALLER_BUILD --- interface/CMakeLists.txt | 2 +- interface/src/devices/SixenseManager.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 5af8bcdd6b..19f8ef6d5f 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -139,7 +139,7 @@ foreach(EXTERNAL ${OPTIONAL_EXTERNALS}) if (NOT APPLE OR NOT ${${EXTERNAL}_UPPERCASE} MATCHES "SIXENSE") target_link_libraries(${TARGET_NAME} ${${${EXTERNAL}_UPPERCASE}_LIBRARIES}) - elseif (APPLE) + elseif (APPLE AND NOT INSTALLER_BUILD) add_definitions(-DSIXENSE_LIB_FILENAME=\"${${${EXTERNAL}_UPPERCASE}_LIBRARY_RELEASE}\") endif () endif () diff --git a/interface/src/devices/SixenseManager.cpp b/interface/src/devices/SixenseManager.cpp index 5fe2b9969c..bd0bbe8a32 100644 --- a/interface/src/devices/SixenseManager.cpp +++ b/interface/src/devices/SixenseManager.cpp @@ -97,7 +97,6 @@ void SixenseManager::initialize() { if (!_sixenseLibrary) { - #ifdef SIXENSE_LIB_FILENAME _sixenseLibrary = new QLibrary(SIXENSE_LIB_FILENAME); #else From 60e3f3edfaffed8784df239364afcc7b9cb05b12 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 2 Oct 2014 11:20:54 -0700 Subject: [PATCH 13/14] add skipSubHandler to OctreeServer HTTPRequestHandler calls --- assignment-client/src/octree/OctreeServer.cpp | 2 +- assignment-client/src/octree/OctreeServer.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assignment-client/src/octree/OctreeServer.cpp b/assignment-client/src/octree/OctreeServer.cpp index 23e8c0d965..5833d8a764 100644 --- a/assignment-client/src/octree/OctreeServer.cpp +++ b/assignment-client/src/octree/OctreeServer.cpp @@ -302,7 +302,7 @@ void OctreeServer::initHTTPManager(int port) { _httpManager = new HTTPManager(port, documentRoot, this, this); } -bool OctreeServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url) { +bool OctreeServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler) { #ifdef FORCE_CRASH if (connection->requestOperation() == QNetworkAccessManager::GetOperation diff --git a/assignment-client/src/octree/OctreeServer.h b/assignment-client/src/octree/OctreeServer.h index fda3187892..aa0c419dd4 100644 --- a/assignment-client/src/octree/OctreeServer.h +++ b/assignment-client/src/octree/OctreeServer.h @@ -115,7 +115,7 @@ public: static int howManyThreadsDidHandlePacketSend(quint64 since = 0); static int howManyThreadsDidCallWriteDatagram(quint64 since = 0); - bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url); + bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler); virtual void aboutToFinish(); void forceNodeShutdown(SharedNodePointer node); From 8cb258e14c5da72c227ef788822ce49bf6cb40bb Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 2 Oct 2014 14:35:54 -0700 Subject: [PATCH 14/14] don't use just filename when searching in application framework --- interface/src/devices/SixenseManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/devices/SixenseManager.cpp b/interface/src/devices/SixenseManager.cpp index bd0bbe8a32..f5d838f95b 100644 --- a/interface/src/devices/SixenseManager.cpp +++ b/interface/src/devices/SixenseManager.cpp @@ -101,10 +101,10 @@ void SixenseManager::initialize() { _sixenseLibrary = new QLibrary(SIXENSE_LIB_FILENAME); #else const QString SIXENSE_LIBRARY_NAME = "libsixense_x64"; - QFileInfo frameworkSixenseLibrary = QCoreApplication::applicationDirPath() + "../Frameworks/" + QString frameworkSixenseLibrary = QCoreApplication::applicationDirPath() + "../Frameworks/" + SIXENSE_LIBRARY_NAME; - _sixenseLibrary = new QLibrary(frameworkSixenseLibrary.fileName()); + _sixenseLibrary = new QLibrary(frameworkSixenseLibrary); #endif }