summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-02-17 08:10:27 +0100
committerGitHub <noreply@github.com>2021-02-17 08:10:27 +0100
commit7f63d6e848399d37915205da0829e839a8bcdaf4 (patch)
tree3e4c407d2f7dfbcafb6b48b6b46b8d64c46f3e07 /editor
parent1d14c22d5f9561d1c4757dc9a40b3e5c5bdb3b63 (diff)
parent508011a57fcc038b1b79be1966971c534b6c7ffb (diff)
Merge pull request #46105 from Calinou/assetlib-retry-button-only-failure
Only display the assetlib Retry button if the download failed
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/asset_library_editor_plugin.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp
index d726cd031e..4d9c5625a3 100644
--- a/editor/plugins/asset_library_editor_plugin.cpp
+++ b/editor/plugins/asset_library_editor_plugin.cpp
@@ -350,7 +350,7 @@ void EditorAssetLibraryItemDownload::_http_download_completed(int p_status, int
if (sha256 != download_sha256) {
error_text = TTR("Bad download hash, assuming file has been tampered with.") + "\n";
error_text += TTR("Expected:") + " " + sha256 + "\n" + TTR("Got:") + " " + download_sha256;
- status->set_text(TTR("Failed sha256 hash check"));
+ status->set_text(TTR("Failed SHA-256 hash check"));
}
}
} break;
@@ -359,6 +359,8 @@ void EditorAssetLibraryItemDownload::_http_download_completed(int p_status, int
if (error_text != String()) {
download_error->set_text(TTR("Asset Download Error:") + "\n" + error_text);
download_error->popup_centered();
+ // Let the user retry the download.
+ retry->show();
return;
}
@@ -459,6 +461,9 @@ void EditorAssetLibraryItemDownload::_install() {
}
void EditorAssetLibraryItemDownload::_make_request() {
+ // Hide the Retry button if we've just pressed it.
+ retry->hide();
+
download->cancel_request();
download->set_download_file(EditorSettings::get_singleton()->get_cache_dir().plus_file("tmp_asset_" + itos(asset_id)) + ".zip");
@@ -516,6 +521,8 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() {
retry = memnew(Button);
retry->set_text(TTR("Retry"));
retry->connect("pressed", callable_mp(this, &EditorAssetLibraryItemDownload::_make_request));
+ // Only show the Retry button in case of a failure.
+ retry->hide();
hb2->add_child(retry);
hb2->add_child(install);