mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 21:23:18 +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) {
|
||||
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 };
|
||||
if (auto upload = DependencyManager::get<AssetClient>()->createUpload(url.toLocalFile())) {
|
||||
// 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
|
||||
upload->start();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// display a message box with the error
|
||||
auto errorMessage = QString("Failed to upload %1.\n\n").arg(filename);
|
||||
QMessageBox::warning(_window, "Failed Upload", errorMessage);
|
||||
|
||||
QMessageBox::warning(_window, "Failed Upload", QString("Failed to upload %1.\n\n").arg(filename));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue