summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorMax Hilbrunner <mhilbrunner@users.noreply.github.com>2018-07-03 18:38:00 +0200
committerGitHub <noreply@github.com>2018-07-03 18:38:00 +0200
commitcb5097a217b008f796a3b94709ece53dec5a9232 (patch)
treed6e5616a42a2f6a61a3d9e2048a63b7f2a333749 /editor
parent72e05f3f9927f23efaeac727a56e34a5a37cd47b (diff)
parent57deed44a809eaff46a03323105b4518e439aff8 (diff)
Merge pull request #16265 from nanoframe/export_issue_fix
Fix error when downloading export templates
Diffstat (limited to 'editor')
-rw-r--r--editor/export_template_manager.cpp8
-rw-r--r--editor/export_template_manager.h2
2 files changed, 9 insertions, 1 deletions
diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp
index a39c8b2209..541c848ca3 100644
--- a/editor/export_template_manager.cpp
+++ b/editor/export_template_manager.cpp
@@ -436,6 +436,10 @@ void ExportTemplateManager::_begin_template_download(const String &p_url) {
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) {
if (p_what == NOTIFICATION_PROCESS) {
@@ -496,7 +500,6 @@ void ExportTemplateManager::_notification(int p_what) {
if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
if (!is_visible_in_tree()) {
print_line("closed");
- download_templates->cancel_request();
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_templates_completed", &ExportTemplateManager::_http_download_templates_completed);
ClassDB::bind_method("_begin_template_download", &ExportTemplateManager::_begin_template_download);
+ ClassDB::bind_method("_window_template_downloader_closed", &ExportTemplateManager::_window_template_downloader_closed);
}
ExportTemplateManager::ExportTemplateManager() {
@@ -560,7 +564,9 @@ ExportTemplateManager::ExportTemplateManager() {
template_downloader = memnew(AcceptDialog);
template_downloader->set_title(TTR("Download Templates"));
template_downloader->get_ok()->set_text(TTR("Close"));
+ template_downloader->set_exclusive(true);
add_child(template_downloader);
+ template_downloader->connect("popup_hide", this, "_window_template_downloader_closed");
VBoxContainer *vbc = memnew(VBoxContainer);
template_downloader->add_child(vbc);
diff --git a/editor/export_template_manager.h b/editor/export_template_manager.h
index 62336162fd..54a645c69f 100644
--- a/editor/export_template_manager.h
+++ b/editor/export_template_manager.h
@@ -77,6 +77,8 @@ class ExportTemplateManager : public ConfirmationDialog {
void _begin_template_download(const String &p_url);
+ void _window_template_downloader_closed();
+
protected:
void _notification(int p_what);
static void _bind_methods();