mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 10:13:15 +02:00
Check for upload rights
This commit is contained in:
parent
2229f942df
commit
e056743621
1 changed files with 7 additions and 4 deletions
|
@ -4068,6 +4068,12 @@ bool Application::askToLoadScript(const QString& scriptFilenameOrURL) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Application::askToUploadAsset(const QString& filename) {
|
bool Application::askToUploadAsset(const QString& filename) {
|
||||||
|
if (DependencyManager::get<NodeList>()->getThisNodeCanRez()) {
|
||||||
|
QMessageBox::warning(_window, "Failed Upload",
|
||||||
|
QString("You don't have upload rights on that domain.\n\n"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
QUrl url { filename };
|
QUrl url { filename };
|
||||||
if (auto upload = DependencyManager::get<AssetClient>()->createUpload(url.toLocalFile())) {
|
if (auto upload = DependencyManager::get<AssetClient>()->createUpload(url.toLocalFile())) {
|
||||||
// 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
|
||||||
|
@ -4075,14 +4081,11 @@ bool Application::askToUploadAsset(const QString& filename) {
|
||||||
|
|
||||||
// start the upload now
|
// start the upload now
|
||||||
upload->start();
|
upload->start();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// display a message box with the error
|
// display a message box with the error
|
||||||
auto errorMessage = QString("Failed to upload %1.\n\n").arg(filename);
|
QMessageBox::warning(_window, "Failed Upload", QString("Failed to upload %1.\n\n").arg(filename));
|
||||||
QMessageBox::warning(_window, "Failed Upload", errorMessage);
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue