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

This commit is contained in:
samcake 2015-09-21 13:23:54 -07:00
commit 43d96afc89
4 changed files with 19 additions and 5 deletions

View file

@ -245,6 +245,10 @@ var toolBar = (function () {
that.setActive(false); that.setActive(false);
} }
that.clearEntityList = function() {
entityListTool.clearEntityList();
};
that.setActive = function(active) { that.setActive = function(active) {
if (active != isActive) { if (active != isActive) {
if (active && !Entities.canAdjustLocks()) { if (active && !Entities.canAdjustLocks()) {
@ -510,6 +514,7 @@ var toolBar = (function () {
Window.domainChanged.connect(function() { Window.domainChanged.connect(function() {
that.setActive(false); that.setActive(false);
that.clearEntityList();
}); });
Entities.canAdjustLocksChanged.connect(function(canAdjustLocks) { Entities.canAdjustLocksChanged.connect(function(canAdjustLocks) {

View file

@ -201,7 +201,9 @@
EventBridge.scriptEventReceived.connect(function(data) { EventBridge.scriptEventReceived.connect(function(data) {
data = JSON.parse(data); data = JSON.parse(data);
if (data.type == "selectionUpdate") { if (data.type === "clearEntityList") {
clearEntities();
} else if (data.type == "selectionUpdate") {
var notFound = updateSelectedEntities(data.selectedIDs); var notFound = updateSelectedEntities(data.selectedIDs);
if (notFound) { if (notFound) {
refreshEntities(); refreshEntities();

View file

@ -26,13 +26,20 @@ EntityListTool = function(opts) {
selectedIDs.push(selectionManager.selections[i]); selectedIDs.push(selectionManager.selections[i]);
} }
data = { var data = {
type: 'selectionUpdate', type: 'selectionUpdate',
selectedIDs: selectedIDs, selectedIDs: selectedIDs,
}; };
webView.eventBridge.emitScriptEvent(JSON.stringify(data)); webView.eventBridge.emitScriptEvent(JSON.stringify(data));
}); });
that.clearEntityList = function () {
var data = {
type: 'clearEntityList'
}
webView.eventBridge.emitScriptEvent(JSON.stringify(data));
};
that.sendUpdate = function() { that.sendUpdate = function() {
var entities = []; var entities = [];
var ids = Entities.findEntities(MyAvatar.position, searchRadius); var ids = Entities.findEntities(MyAvatar.position, searchRadius);

View file

@ -39,13 +39,13 @@ void AssetUploadDialogFactory::showDialog() {
auto nodeList = DependencyManager::get<NodeList>(); auto nodeList = DependencyManager::get<NodeList>();
if (nodeList->getThisNodeCanRez()) { if (nodeList->getThisNodeCanRez()) {
auto filename = QFileDialog::getOpenFileUrl(_dialogParent, "Select a file to upload"); auto filename = QFileDialog::getOpenFileName(_dialogParent, "Select a file to upload");
if (!filename.isEmpty()) { if (!filename.isEmpty()) {
qDebug() << "Selected filename for upload to asset-server: " << filename; qDebug() << "Selected filename for upload to asset-server: " << filename;
auto assetClient = DependencyManager::get<AssetClient>(); auto assetClient = DependencyManager::get<AssetClient>();
auto upload = assetClient->createUpload(filename.path()); auto upload = assetClient->createUpload(filename);
if (upload) { if (upload) {
// connect to the finished signal so we know when the AssetUpload is done // connect to the finished signal so we know when the AssetUpload is done
@ -56,7 +56,7 @@ void AssetUploadDialogFactory::showDialog() {
} else { } else {
// show a QMessageBox to say that there is no local asset server // show a QMessageBox to say that there is no local asset server
QString messageBoxText = QString("Could not upload \n\n%1\n\nbecause you are currently not connected" \ QString messageBoxText = QString("Could not upload \n\n%1\n\nbecause you are currently not connected" \
" to a local asset-server.").arg(QFileInfo(filename.toString()).fileName()); " to a local asset-server.").arg(QFileInfo(filename).fileName());
QMessageBox::information(_dialogParent, "Failed to Upload", messageBoxText); QMessageBox::information(_dialogParent, "Failed to Upload", messageBoxText);
} }