Make sure Upload is not clicked several times

This commit is contained in:
Atlante45 2016-03-10 14:57:02 -08:00
parent 548d826a4e
commit 63571a7c36
2 changed files with 8 additions and 0 deletions

View file

@ -212,7 +212,13 @@ Window {
}); });
} }
property var uploadOpen: false;
function uploadClicked() { function uploadClicked() {
if(uploadOpen) {
return;
}
uploadOpen = true;
var fileUrl = fileUrlTextField.text var fileUrl = fileUrlTextField.text
var addToWorld = addToWorldCheckBox.checked var addToWorld = addToWorldCheckBox.checked
@ -230,6 +236,7 @@ Window {
reload(); reload();
}); });
uploadOpen = false;
} }
function errorMessageBox(message) { function errorMessageBox(message) {

View file

@ -83,6 +83,7 @@ void AssetMappingsScriptingInterface::getMapping(QString path, QJSValue callback
void AssetMappingsScriptingInterface::uploadFile(QString path, QString mapping, QJSValue callback) { void AssetMappingsScriptingInterface::uploadFile(QString path, QString mapping, QJSValue callback) {
auto offscreenUi = DependencyManager::get<OffscreenUi>(); auto offscreenUi = DependencyManager::get<OffscreenUi>();
auto result = offscreenUi->inputDialog(OffscreenUi::ICON_NONE, "Enter asset path:", "", mapping); auto result = offscreenUi->inputDialog(OffscreenUi::ICON_NONE, "Enter asset path:", "", mapping);
if (!result.isValid()) { if (!result.isValid()) {
return; return;
} }