From 2a84d9a6ab2944ad184778decf7d2077235088b8 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Fri, 13 Mar 2015 10:06:49 -0700 Subject: [PATCH 1/3] Fix issue with .svo's not loading when the url has parameters --- interface/src/Application.cpp | 7 ++++--- interface/src/GLCanvas.cpp | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 72c17ed09b..25077e0ac1 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -889,7 +889,7 @@ bool Application::event(QEvent* event) { if (!url.isEmpty()) { if (url.scheme() == HIFI_URL_SCHEME) { DependencyManager::get()->handleLookupString(fileEvent->url().toString()); - } else if (url.url().toLower().endsWith(SVO_EXTENSION)) { + } else if (url.path().toLower().endsWith(SVO_EXTENSION)) { emit svoImportRequested(url.url()); } } @@ -1455,10 +1455,11 @@ void Application::dropEvent(QDropEvent *event) { QString snapshotPath; const QMimeData *mimeData = event->mimeData(); foreach (QUrl url, mimeData->urls()) { - if (url.url().toLower().endsWith(SNAPSHOT_EXTENSION)) { + auto lower = url.path().toLower(); + if (lower.endsWith(SNAPSHOT_EXTENSION)) { snapshotPath = url.toLocalFile(); break; - } else if (url.url().toLower().endsWith(SVO_EXTENSION)) { + } else if (lower.endsWith(SVO_EXTENSION)) { emit svoImportRequested(url.url()); event->acceptProposedAction(); return; diff --git a/interface/src/GLCanvas.cpp b/interface/src/GLCanvas.cpp index 4ece8f0857..4587fca0f4 100644 --- a/interface/src/GLCanvas.cpp +++ b/interface/src/GLCanvas.cpp @@ -170,7 +170,7 @@ void GLCanvas::wheelEvent(QWheelEvent* event) { void GLCanvas::dragEnterEvent(QDragEnterEvent* event) { const QMimeData *mimeData = event->mimeData(); foreach (QUrl url, mimeData->urls()) { - auto lower = url.url().toLower(); + auto lower = url.path().toLower(); if (lower.endsWith(SNAPSHOT_EXTENSION) || lower.endsWith(SVO_EXTENSION)) { event->acceptProposedAction(); break; From 504dceda6b4e75f259393dc755a383d21fca5e6c Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Fri, 13 Mar 2015 10:07:12 -0700 Subject: [PATCH 2/3] Update edit.js icons --- examples/edit.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/edit.js b/examples/edit.js index c236336266..e7c8c897ac 100644 --- a/examples/edit.js +++ b/examples/edit.js @@ -126,7 +126,7 @@ var toolBar = (function () { // Hide active button for now - this may come back, so not deleting yet. activeButton = toolBar.addTool({ - imageURL: toolIconUrl + "models-tool.svg", + imageURL: toolIconUrl + "edit-status.svg", subImage: { x: 0, y: Tool.IMAGE_WIDTH, width: Tool.IMAGE_WIDTH, height: Tool.IMAGE_HEIGHT }, width: toolWidth, height: toolHeight, @@ -135,7 +135,7 @@ var toolBar = (function () { }, true, false); newModelButton = toolBar.addTool({ - imageURL: toolIconUrl + "add-model-tool.svg", + imageURL: toolIconUrl + "upload.svg", subImage: { x: 0, y: Tool.IMAGE_WIDTH, width: Tool.IMAGE_WIDTH, height: Tool.IMAGE_HEIGHT }, width: toolWidth, height: toolHeight, @@ -144,7 +144,7 @@ var toolBar = (function () { }); browseModelsButton = toolBar.addTool({ - imageURL: toolIconUrl + "list-icon.svg", + imageURL: toolIconUrl + "marketplace.svg", width: toolWidth, height: toolHeight, alpha: 0.9, From e94bac1971f3fc5e84324de22578b60f8fc0c0ca Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Fri, 13 Mar 2015 10:07:31 -0700 Subject: [PATCH 3/3] Fix subimage indexing in toolBars.js --- examples/libraries/toolBars.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/libraries/toolBars.js b/examples/libraries/toolBars.js index 951b6704ec..670a69dec7 100644 --- a/examples/libraries/toolBars.js +++ b/examples/libraries/toolBars.js @@ -94,7 +94,7 @@ Tool = function(properties, selectable, selected) { // selectable and selected a } selected = doSelect; - properties.subImage.y = (selected ? 2 : 1) * properties.subImage.height; + properties.subImage.y = (selected ? 0 : 1) * properties.subImage.height; Overlays.editOverlay(this.overlay(), { subImage: properties.subImage }); } this.toggle = function() { @@ -102,7 +102,7 @@ Tool = function(properties, selectable, selected) { // selectable and selected a return; } selected = !selected; - properties.subImage.y = (selected ? 2 : 1) * properties.subImage.height; + properties.subImage.y = (selected ? 0 : 1) * properties.subImage.height; Overlays.editOverlay(this.overlay(), { subImage: properties.subImage }); return selected;