History

Improve user messages

David Rowe committed 9 years ago

Commit 8cd7e1b1 parent 37da8001 file · +16 −17Browse files

Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all

Unified · Split

interface/src/Application.cpp+16−17
@@ -5642,18 +5642,18 @@ void Application::showAssetServerWidget(QString filePath) { · 5641 unmodified lines
56425642 }
56435643
56445644 void Application::addAssetToWorldFromURL(QString url) {
5645− qInfo(interfaceapp) << "Download asset and add to world from" << url;
5645+ qInfo(interfaceapp) << "Download model and add to world from" << url;
56465646
56475647 QString filename = url.section("filename=", 1, 1); // Filename is in "?filename=" parameter at end of URL.
56485648
56495649 if (!DependencyManager::get<NodeList>()->getThisNodeCanWriteAssets()) {
56505650 QString errorInfo = "You do not have permissions to write to the Asset Server.";
5651− qWarning(interfaceapp) << "Error downloading asset: " + errorInfo;
5651+ qWarning(interfaceapp) << "Error downloading model: " + errorInfo;
56525652 addAssetToWorldError(filename, errorInfo);
56535653 return;
56545654 }
56555655
5656− addAssetToWorldInfo(filename, "Downloading asset file " + filename + ".");
5656+ addAssetToWorldInfo(filename, "Downloading model file " + filename + ".");
56575657
56585658 auto request = ResourceManager::createResourceRequest(nullptr, QUrl(url));
56595659 connect(request, &ResourceRequest::finished, this, &Application::addAssetToWorldFromURLRequestFinished);
@@ -5668,7 +5668,7 @@ void Application::addAssetToWorldFromURLRequestFinished() { · 8 unmodified lines
56685668 QString filename = url.section("filename=", 1, 1); // Filename from trailing "?filename=" URL parameter.
56695669
56705670 if (result == ResourceRequest::Success) {
5671− qInfo(interfaceapp) << "Downloaded asset from" << url;
5671+ qInfo(interfaceapp) << "Downloaded model from" << url;
56725672 QTemporaryDir temporaryDir;
56735673 temporaryDir.setAutoRemove(false);
56745674 if (temporaryDir.isValid()) {
@@ -5720,7 +5720,7 @@ void Application::addAssetToWorld(QString filePath) { · 45 unmodified lines
57205720 // Test repeated because possibly different code paths.
57215721 if (!DependencyManager::get<NodeList>()->getThisNodeCanWriteAssets()) {
57225722 QString errorInfo = "You do not have permissions to write to the Asset Server.";
5723− qWarning(interfaceapp) << "Error downloading asset: " + errorInfo;
5723+ qWarning(interfaceapp) << "Error downloading model: " + errorInfo;
57245724 addAssetToWorldError(filename, errorInfo);
57255725 return;
57265726 }
@@ -5741,7 +5741,7 @@ void Application::addAssetToWorldWithNewMapping(QString filePath, QString mappin · 14 unmodified lines
57415741 } else if (result != GetMappingRequest::NoError) {
57425742 QString errorInfo = "Could not map asset name: "
57435743 + mapping.left(mapping.length() - QString::number(copy).length() - 1);
5744− qWarning(interfaceapp) << "Error downloading asset: " + errorInfo;
5744+ qWarning(interfaceapp) << "Error downloading model: " + errorInfo;
57455745 addAssetToWorldError(filenameFromPath(filePath), errorInfo);
57465746 } else if (copy < MAX_COPY_COUNT - 1) {
57475747 if (copy > 0) {
@@ -5753,7 +5753,7 @@ void Application::addAssetToWorldWithNewMapping(QString filePath, QString mappin · 5 unmodified lines
57535753 } else {
57545754 QString errorInfo = "Too many copies of asset name: "
57555755 + mapping.left(mapping.length() - QString::number(copy).length() - 1);
5756− qWarning(interfaceapp) << "Error downloading asset: " + errorInfo;
5756+ qWarning(interfaceapp) << "Error downloading model: " + errorInfo;
57575757 addAssetToWorldError(filenameFromPath(filePath), errorInfo);
57585758 }
57595759 request->deleteLater();
@@ -5767,8 +5767,8 @@ void Application::addAssetToWorldUpload(QString filePath, QString mapping) { · 7 unmodified lines
57675767 auto upload = DependencyManager::get<AssetClient>()->createUpload(filePath);
57685768 QObject::connect(upload, &AssetUpload::finished, this, [=](AssetUpload* upload, const QString& hash) mutable {
57695769 if (upload->getError() != AssetUpload::NoError) {
5770− QString errorInfo = "Could not upload asset to the Asset Server.";
5771− qWarning(interfaceapp) << "Error downloading asset: " + errorInfo;
5770+ QString errorInfo = "Could not upload model to the Asset Server.";
5771+ qWarning(interfaceapp) << "Error downloading model: " + errorInfo;
57725772 addAssetToWorldError(filenameFromPath(filePath), errorInfo);
57735773 } else {
57745774 addAssetToWorldSetMapping(filePath, mapping, hash);
@@ -5793,7 +5793,7 @@ void Application::addAssetToWorldSetMapping(QString filePath, QString mapping, Q · 18 unmodified lines
57935793 connect(request, &SetMappingRequest::finished, this, [=](SetMappingRequest* request) mutable {
57945794 if (request->getError() != SetMappingRequest::NoError) {
57955795 QString errorInfo = "Could not set asset mapping.";
5796− qWarning(interfaceapp) << "Error downloading asset: " + errorInfo;
5796+ qWarning(interfaceapp) << "Error downloading model: " + errorInfo;
57975797 addAssetToWorldError(filenameFromPath(filePath), errorInfo);
57985798 } else {
57995799 addAssetToWorldAddEntity(filePath, mapping);
@@ -5820,8 +5820,8 @@ void Application::addAssetToWorldAddEntity(QString filePath, QString mapping) { · 20 unmodified lines
58205820 // on. But FBX dimensions may be in cm, so we monitor for the dimension change and rescale again if warranted.
58215821
58225822 if (entityID == QUuid()) {
5823− QString errorInfo = "Could not add asset " + mapping + " to world.";
5824− qWarning(interfaceapp) << "Could not add asset to world: " + errorInfo;
5823+ QString errorInfo = "Could not add model " + mapping + " to world.";
5824+ qWarning(interfaceapp) << "Could not add model to world: " + errorInfo;
58255825 addAssetToWorldError(filenameFromPath(filePath), errorInfo);
58265826 } else {
58275827 // Monitor when asset is rendered in world so that can resize if necessary.
@@ -5864,7 +5864,7 @@ void Application::addAssetToWorldCheckModelSize() { · 36 unmodified lines
58645864 auto scale = std::min(MAXIMUM_DIMENSION / dimensions.x, std::min(MAXIMUM_DIMENSION / dimensions.y,
58655865 MAXIMUM_DIMENSION / dimensions.z));
58665866 dimensions *= scale;
5867− qInfo(interfaceapp) << "Asset" << name << "auto-resized from" << previousDimensions << " to " << dimensions;
5867+ qInfo(interfaceapp) << "Model" << name << "auto-resized from" << previousDimensions << " to " << dimensions;
58685868 doResize = true;
58695869
58705870 item = _addAssetToWorldResizeList.erase(item); // Finished with this entity; advance to next.
@@ -5879,7 +5879,7 @@ void Application::addAssetToWorldCheckModelSize() { · 8 unmodified lines
58795879 // Rescale all dimensions.
58805880 const glm::vec3 UNIT_DIMENSIONS = glm::vec3(1.0f, 1.0f, 1.0f);
58815881 dimensions = UNIT_DIMENSIONS;
5882− qInfo(interfaceapp) << "Asset" << name << "auto-resize timed out; resized to " << dimensions;
5882+ qInfo(interfaceapp) << "Model" << name << "auto-resize timed out; resized to " << dimensions;
58835883 doResize = true;
58845884
58855885 item = _addAssetToWorldResizeList.erase(item); // Finished with this entity; advance to next.
@@ -5932,7 +5932,7 @@ void Application::addAssetToWorldInfo(QString modelName, QString infoText) { · 46 unmodified lines
59325932 if (!_addAssetToWorldErrorTimer.isActive()) {
59335933 if (!_addAssetToWorldMessageBox) {
59345934 _addAssetToWorldMessageBox = DependencyManager::get<OffscreenUi>()->createMessageBox(OffscreenUi::ICON_INFORMATION,
5935− "Downloading Asset", "", QMessageBox::NoButton, QMessageBox::NoButton);
5935+ "Downloading Model", "", QMessageBox::NoButton, QMessageBox::NoButton);
59365936 connect(_addAssetToWorldMessageBox, SIGNAL(destroyed()), this, SLOT(onAssetToWorldMessageBoxClosed()));
59375937 }
59385938
@@ -5997,7 +5997,6 @@ void Application::addAssetToWorldInfoTimeout() { · 58 unmodified lines
59975997 }
59985998 }
59995999
6000−
60016000 void Application::addAssetToWorldError(QString modelName, QString errorText) {
60026001 // Displays the most recent error message for a few seconds.
60036002
@@ -6016,7 +6015,7 @@ void Application::addAssetToWorldError(QString modelName, QString errorText) { · 12 unmodified lines
60166015
60176016 if (!_addAssetToWorldMessageBox) {
60186017 _addAssetToWorldMessageBox = DependencyManager::get<OffscreenUi>()->createMessageBox(OffscreenUi::ICON_INFORMATION,
6019− "Downloading Asset", "", QMessageBox::NoButton, QMessageBox::NoButton);
6018+ "Downloading Model", "", QMessageBox::NoButton, QMessageBox::NoButton);
60206019 connect(_addAssetToWorldMessageBox, SIGNAL(destroyed()), this, SLOT(onAssetToWorldMessageBoxClosed()));
60216020 }
60226021