From 358355cfbf1597e97f84d576a06724b0bec57173 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 9 Jun 2016 14:55:03 +1200 Subject: [PATCH 01/13] Clear file selection and disabled Open button when change directory --- interface/resources/qml/dialogs/FileDialog.qml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interface/resources/qml/dialogs/FileDialog.qml b/interface/resources/qml/dialogs/FileDialog.qml index 015a192185..fb50279ed6 100644 --- a/interface/resources/qml/dialogs/FileDialog.qml +++ b/interface/resources/qml/dialogs/FileDialog.qml @@ -215,6 +215,10 @@ ModalWindow { openButton.text = root.selectDirectory && row === -1 ? "Choose" : "Open" if (row === -1) { + if (!root.selectDirectory) { + currentSelection.text = ""; + currentSelectionIsFolder = false; + } return; } From 4ae018400d45283a9c1b27e6554277a13d888827 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 9 Jun 2016 14:55:30 +1200 Subject: [PATCH 02/13] Give table focus after using dropdown --- interface/resources/qml/dialogs/FileDialog.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/interface/resources/qml/dialogs/FileDialog.qml b/interface/resources/qml/dialogs/FileDialog.qml index fb50279ed6..89c788a57c 100644 --- a/interface/resources/qml/dialogs/FileDialog.qml +++ b/interface/resources/qml/dialogs/FileDialog.qml @@ -187,6 +187,7 @@ ModalWindow { if (helper.urlToPath(folder).toLowerCase() !== helper.urlToPath(fileTableModel.folder).toLowerCase()) { fileTableModel.folder = folder; + fileTableView.forceActiveFocus(); } } } From 0ef13e6c01280b9e16d486b889330e272ac9c3fd Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 9 Jun 2016 14:56:11 +1200 Subject: [PATCH 03/13] Fix action button label to be "Save" when saving a file --- interface/resources/qml/dialogs/FileDialog.qml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/interface/resources/qml/dialogs/FileDialog.qml b/interface/resources/qml/dialogs/FileDialog.qml index 89c788a57c..b4558c306b 100644 --- a/interface/resources/qml/dialogs/FileDialog.qml +++ b/interface/resources/qml/dialogs/FileDialog.qml @@ -213,8 +213,6 @@ ModalWindow { function update() { var row = fileTableView.currentRow; - openButton.text = root.selectDirectory && row === -1 ? "Choose" : "Open" - if (row === -1) { if (!root.selectDirectory) { currentSelection.text = ""; @@ -657,7 +655,7 @@ ModalWindow { Action { id: okAction - text: root.saveDialog ? "Save" : (root.selectDirectory ? "Choose" : "Open") + text: currentSelection.text ? (root.selectDirectory && fileTableView.currentRow === -1 ? "Choose" : (root.saveDialog ? "Save" : "Open")) : "Open" enabled: currentSelection.text || !root.selectDirectory && d.currentSelectionIsFolder ? true : false onTriggered: { if (!root.selectDirectory && !d.currentSelectionIsFolder @@ -681,7 +679,6 @@ ModalWindow { return; } - // Handle the ambiguity between different cases // * typed name (with or without extension) // * full path vs relative vs filename only From 3780b18cc07efc1dc2696c9a64ce7999024abcef Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 9 Jun 2016 15:14:14 +1200 Subject: [PATCH 04/13] Fix a QML error --- interface/resources/qml/controls-uit/ComboBox.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/controls-uit/ComboBox.qml b/interface/resources/qml/controls-uit/ComboBox.qml index cd6dc8ede0..df3210a20d 100755 --- a/interface/resources/qml/controls-uit/ComboBox.qml +++ b/interface/resources/qml/controls-uit/ComboBox.qml @@ -199,7 +199,7 @@ FocusScope { anchors.leftMargin: hifi.dimensions.textPadding anchors.verticalCenter: parent.verticalCenter id: popupText - text: listView.model[index] + text: listView.model[index] ? listView.model[index] : "" size: hifi.fontSizes.textFieldInput color: hifi.colors.baseGray } From 0fe93a1e89fdd1638549f699ed23fc41a167f675 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 9 Jun 2016 16:12:11 +1200 Subject: [PATCH 05/13] Fix capitalization of import and export dialog titles --- scripts/system/edit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/system/edit.js b/scripts/system/edit.js index afbc679ec4..1232c8d94d 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -1222,7 +1222,7 @@ function handeMenuEvent(menuItem) { Window.alert("No entities have been selected."); } else { var filename = "entities__" + Window.location.hostname + ".svo.json"; - filename = Window.save("Select where to save", filename, "*.json") + filename = Window.save("Select Where to Save", filename, "*.json") if (filename) { var success = Clipboard.exportEntities(filename, selectionManager.selections); if (!success) { @@ -1234,7 +1234,7 @@ function handeMenuEvent(menuItem) { var importURL = null; if (menuItem == "Import Entities") { - var fullPath = Window.browse("Select models to import", "", "*.json"); + var fullPath = Window.browse("Select Model to Import", "", "*.json"); if (fullPath) { importURL = "file:///" + fullPath; } From b4543cc579001968114f4d1bddec712452737853 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 9 Jun 2016 16:29:15 +1200 Subject: [PATCH 06/13] Unhighlight directory in table when type filename to save --- interface/resources/qml/dialogs/FileDialog.qml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/interface/resources/qml/dialogs/FileDialog.qml b/interface/resources/qml/dialogs/FileDialog.qml index b4558c306b..dc1d7ab340 100644 --- a/interface/resources/qml/dialogs/FileDialog.qml +++ b/interface/resources/qml/dialogs/FileDialog.qml @@ -610,6 +610,12 @@ ModalWindow { readOnly: !root.saveDialog activeFocusOnTab: !readOnly onActiveFocusChanged: if (activeFocus) { selectAll(); } + onTextChanged: { + if (root.saveDialog && text !== "") { + fileTableView.selection.clear(); + fileTableView.currentRow = -1; + } + } onAccepted: okAction.trigger(); } From d346d4c7310fb3dbdc1587f72adb7165e09d5e82 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 9 Jun 2016 16:41:51 +1200 Subject: [PATCH 07/13] When choosing a directory make the dropdown update the path value --- interface/resources/qml/dialogs/FileDialog.qml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/interface/resources/qml/dialogs/FileDialog.qml b/interface/resources/qml/dialogs/FileDialog.qml index dc1d7ab340..eee52161b6 100644 --- a/interface/resources/qml/dialogs/FileDialog.qml +++ b/interface/resources/qml/dialogs/FileDialog.qml @@ -186,6 +186,9 @@ ModalWindow { } if (helper.urlToPath(folder).toLowerCase() !== helper.urlToPath(fileTableModel.folder).toLowerCase()) { + if (root.selectDirectory) { + currentSelection.text = currentText !== "This PC" ? currentText : ""; + } fileTableModel.folder = folder; fileTableView.forceActiveFocus(); } From 4176940e248bab158d2585d370d8d67b7d518521 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 9 Jun 2016 17:02:43 +1200 Subject: [PATCH 08/13] Don't highlight first drive in table when choose "This PC" from dropdown --- interface/resources/qml/dialogs/FileDialog.qml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/interface/resources/qml/dialogs/FileDialog.qml b/interface/resources/qml/dialogs/FileDialog.qml index eee52161b6..5f8d8c7bbb 100644 --- a/interface/resources/qml/dialogs/FileDialog.qml +++ b/interface/resources/qml/dialogs/FileDialog.qml @@ -451,12 +451,6 @@ ModalWindow { onSortIndicatorOrderChanged: { updateSort(); } - onActiveFocusChanged: { - if (activeFocus && currentRow == -1) { - fileTableView.selection.select(0) - } - } - itemDelegate: Item { clip: true From cf6945b40363a1879c0e27b6cf34eb968fbda1fb Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 9 Jun 2016 17:11:00 +1200 Subject: [PATCH 09/13] Fix selecting directory directly from dropdown --- interface/resources/qml/dialogs/FileDialog.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/interface/resources/qml/dialogs/FileDialog.qml b/interface/resources/qml/dialogs/FileDialog.qml index 5f8d8c7bbb..93ccbc0b8c 100644 --- a/interface/resources/qml/dialogs/FileDialog.qml +++ b/interface/resources/qml/dialogs/FileDialog.qml @@ -188,6 +188,7 @@ ModalWindow { if (helper.urlToPath(folder).toLowerCase() !== helper.urlToPath(fileTableModel.folder).toLowerCase()) { if (root.selectDirectory) { currentSelection.text = currentText !== "This PC" ? currentText : ""; + d.currentSelectionUrl = helper.pathToUrl(currentText); } fileTableModel.folder = folder; fileTableView.forceActiveFocus(); From 2953ca08cbe82e4134f9e0b449f8d1aef977e968 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Fri, 10 Jun 2016 12:04:41 +1200 Subject: [PATCH 10/13] Fix import of invalid JSON file failing silently --- libraries/entities/src/EntityTree.cpp | 9 ++++++++- libraries/octree/src/Octree.cpp | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index 581e0a9568..27a708cf07 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -1430,6 +1430,12 @@ bool EntityTree::readFromMap(QVariantMap& map) { QVariantList entitiesQList = map["Entities"].toList(); QScriptEngine scriptEngine; + if (entitiesQList.length() == 0) { + // Empty map or invalidly formed file. + return false; + } + + bool success = true; foreach (QVariant entityVariant, entitiesQList) { // QVariantMap --> QScriptValue --> EntityItemProperties --> Entity QVariantMap entityMap = entityVariant.toMap(); @@ -1447,9 +1453,10 @@ bool EntityTree::readFromMap(QVariantMap& map) { EntityItemPointer entity = addEntity(entityItemID, properties); if (!entity) { qCDebug(entities) << "adding Entity failed:" << entityItemID << properties.getType(); + success = false; } } - return true; + return success; } void EntityTree::resetClientEditStats() { diff --git a/libraries/octree/src/Octree.cpp b/libraries/octree/src/Octree.cpp index 39be760944..475beef03c 100644 --- a/libraries/octree/src/Octree.cpp +++ b/libraries/octree/src/Octree.cpp @@ -1863,9 +1863,9 @@ bool Octree::readJSONFromStream(unsigned long streamLength, QDataStream& inputSt QJsonDocument asDocument = QJsonDocument::fromJson(jsonBuffer); QVariant asVariant = asDocument.toVariant(); QVariantMap asMap = asVariant.toMap(); - readFromMap(asMap); + bool success = readFromMap(asMap); delete[] rawData; - return true; + return success; } void Octree::writeToFile(const char* fileName, OctreeElementPointer element, QString persistAsFileType) { From e79767a121ee70bd30edea89de524ac80fc1c5b1 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Sat, 11 Jun 2016 15:16:02 -0700 Subject: [PATCH 11/13] authed username wasn't being saved in permissions, so that interface would get briefly disconnected when their permissions changed. --- domain-server/src/DomainGatekeeper.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/domain-server/src/DomainGatekeeper.cpp b/domain-server/src/DomainGatekeeper.cpp index 342b8213d1..c4a7d1a425 100644 --- a/domain-server/src/DomainGatekeeper.cpp +++ b/domain-server/src/DomainGatekeeper.cpp @@ -128,7 +128,7 @@ void DomainGatekeeper::updateNodePermissions() { QList nodesToKill; auto limitedNodeList = DependencyManager::get(); - limitedNodeList->eachNodeBreakable([this, limitedNodeList, &nodesToKill](const SharedNodePointer& node){ + limitedNodeList->eachNode([this, limitedNodeList, &nodesToKill](const SharedNodePointer& node){ QString username = node->getPermissions().getUserName(); NodePermissions userPerms(username); @@ -167,8 +167,6 @@ void DomainGatekeeper::updateNodePermissions() { // hang up on this node nodesToKill << node; } - - return true; }); foreach (auto node, nodesToKill) { @@ -264,7 +262,6 @@ SharedNodePointer DomainGatekeeper::processAgentConnectRequest(const NodeConnect qDebug() << "user-permissions: no username, so:" << userPerms; } else if (verifyUserSignature(username, usernameSignature, nodeConnection.senderSockAddr)) { // they are sent us a username and the signature verifies it - userPerms.setUserName(username); if (_server->_settingsManager.havePermissionsForName(username)) { // we have specific permissions for this user. userPerms = _server->_settingsManager.getPermissionsForName(username); @@ -274,6 +271,7 @@ SharedNodePointer DomainGatekeeper::processAgentConnectRequest(const NodeConnect userPerms |= _server->_settingsManager.getStandardPermissionsForName(NodePermissions::standardNameLoggedIn); qDebug() << "user-permissions: user is logged in, so:" << userPerms; } + userPerms.setUserName(username); } else { // they sent us a username, but it didn't check out requestUserPublicKey(username); From 924c949af5789c147b77f952084e4374ae6e5241 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Sat, 11 Jun 2016 15:16:45 -0700 Subject: [PATCH 12/13] permissions for the local node were being updated without the various *changed* signals being called. this was keeping the asset-server menu item from being correct, among other things --- libraries/networking/src/NodeList.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index 11b5f5469a..fd1442d639 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -543,7 +543,9 @@ void NodeList::processDomainServerList(QSharedPointer message) setSessionUUID(newUUID); // pull the permissions/right/privileges for this node out of the stream - packetStream >> _permissions; + NodePermissions newPermissions; + packetStream >> newPermissions; + setPermissions(newPermissions); // pull each node in the packet while (packetStream.device()->pos() < message->getSize()) { From 1ec145298fa91d512a7ac1e07588a2952a4e37ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E9=B3=B3?= Date: Sun, 12 Jun 2016 21:07:49 +0800 Subject: [PATCH 13/13] Update BUILD_OSX.md Qt5.6 removed QTWebKit which hifi depends on. Before we complete the migration listed in https://wiki.qt.io/Porting_from_QtWebKit_to_QtWebEngine the build instruction need to tap into qt55 in historical brew versions. --- BUILD_OSX.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/BUILD_OSX.md b/BUILD_OSX.md index c8f19710ca..44f27d3d02 100644 --- a/BUILD_OSX.md +++ b/BUILD_OSX.md @@ -3,9 +3,10 @@ Please read the [general build guide](BUILD.md) for information on dependencies ###Homebrew [Homebrew](http://brew.sh/) is an excellent package manager for OS X. It makes install of all High Fidelity dependencies very simple. - brew install cmake openssl qt5 + brew tap homebrew/versions + brew install cmake openssl qt55 -We no longer require install of qt5 via our [homebrew formulas repository](https://github.com/highfidelity/homebrew-formulas). Versions of Qt that are 5.5.x and above provide a mechanism to disable the wireless scanning we previously had a custom patch for. +We no longer require install of qt5 via our [homebrew formulas repository](https://github.com/highfidelity/homebrew-formulas). Versions of Qt that are 5.5.x provide a mechanism to disable the wireless scanning we previously had a custom patch for. ###OpenSSL and Qt