1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-15 13:51:40 +00:00

Merge pull request #16265 from nanoframe/export_issue_fix

Fix error when downloading export templates
This commit is contained in:
Max Hilbrunner
2018-07-03 18:38:00 +02:00
committed by GitHub
2 changed files with 9 additions and 1 deletions

View File

@@ -436,6 +436,10 @@ void ExportTemplateManager::_begin_template_download(const String &p_url) {
template_list_state->set_text(TTR("Connecting to Mirror...")); template_list_state->set_text(TTR("Connecting to Mirror..."));
} }
void ExportTemplateManager::_window_template_downloader_closed() {
download_templates->cancel_request();
}
void ExportTemplateManager::_notification(int p_what) { void ExportTemplateManager::_notification(int p_what) {
if (p_what == NOTIFICATION_PROCESS) { if (p_what == NOTIFICATION_PROCESS) {
@@ -496,7 +500,6 @@ void ExportTemplateManager::_notification(int p_what) {
if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
if (!is_visible_in_tree()) { if (!is_visible_in_tree()) {
print_line("closed"); print_line("closed");
download_templates->cancel_request();
set_process(false); set_process(false);
} }
} }
@@ -511,6 +514,7 @@ void ExportTemplateManager::_bind_methods() {
ClassDB::bind_method("_http_download_mirror_completed", &ExportTemplateManager::_http_download_mirror_completed); ClassDB::bind_method("_http_download_mirror_completed", &ExportTemplateManager::_http_download_mirror_completed);
ClassDB::bind_method("_http_download_templates_completed", &ExportTemplateManager::_http_download_templates_completed); ClassDB::bind_method("_http_download_templates_completed", &ExportTemplateManager::_http_download_templates_completed);
ClassDB::bind_method("_begin_template_download", &ExportTemplateManager::_begin_template_download); ClassDB::bind_method("_begin_template_download", &ExportTemplateManager::_begin_template_download);
ClassDB::bind_method("_window_template_downloader_closed", &ExportTemplateManager::_window_template_downloader_closed);
} }
ExportTemplateManager::ExportTemplateManager() { ExportTemplateManager::ExportTemplateManager() {
@@ -560,7 +564,9 @@ ExportTemplateManager::ExportTemplateManager() {
template_downloader = memnew(AcceptDialog); template_downloader = memnew(AcceptDialog);
template_downloader->set_title(TTR("Download Templates")); template_downloader->set_title(TTR("Download Templates"));
template_downloader->get_ok()->set_text(TTR("Close")); template_downloader->get_ok()->set_text(TTR("Close"));
template_downloader->set_exclusive(true);
add_child(template_downloader); add_child(template_downloader);
template_downloader->connect("popup_hide", this, "_window_template_downloader_closed");
VBoxContainer *vbc = memnew(VBoxContainer); VBoxContainer *vbc = memnew(VBoxContainer);
template_downloader->add_child(vbc); template_downloader->add_child(vbc);

View File

@@ -77,6 +77,8 @@ class ExportTemplateManager : public ConfirmationDialog {
void _begin_template_download(const String &p_url); void _begin_template_download(const String &p_url);
void _window_template_downloader_closed();
protected: protected:
void _notification(int p_what); void _notification(int p_what);
static void _bind_methods(); static void _bind_methods();