diff options
| author | Juan Linietsky | 2017-12-17 15:47:50 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2017-12-17 15:48:24 -0300 |
| commit | 3de20641f5690aba7551da5c592a79d44af54fef (patch) | |
| tree | 0c40980aa018008fbdf2c319a6473d6b452ad275 /editor/export_template_manager.cpp | |
| parent | f5b183d5252fd364c47c8453c7e5fdd90d723b10 (diff) | |
| download | godot-3de20641f5690aba7551da5c592a79d44af54fef.tar.gz godot-3de20641f5690aba7551da5c592a79d44af54fef.tar.zst godot-3de20641f5690aba7551da5c592a79d44af54fef.zip | |
Diffstat (limited to 'editor/export_template_manager.cpp')
| -rw-r--r-- | editor/export_template_manager.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp index cdb725632..3eaa6e44f 100644 --- a/editor/export_template_manager.cpp +++ b/editor/export_template_manager.cpp @@ -176,7 +176,7 @@ void ExportTemplateManager::_uninstall_template_confirm() { _update_template_list(); } -void ExportTemplateManager::_install_from_file(const String &p_file) { +void ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_progress) { FileAccess *fa = NULL; zlib_filefunc_def io = zipio_create_io_from_file(&fa); @@ -259,7 +259,10 @@ void ExportTemplateManager::_install_from_file(const String &p_file) { ret = unzGoToFirstFile(pkg); - EditorProgress p("ltask", TTR("Extracting Export Templates"), fc); + EditorProgress *p = NULL; + if (p_use_progress) { + p = memnew(EditorProgress("ltask", TTR("Extracting Export Templates"), fc)); + } fc = 0; @@ -288,8 +291,9 @@ void ExportTemplateManager::_install_from_file(const String &p_file) { */ file = file.get_file(); - - p.step(TTR("Importing:") + " " + file, fc); + if (p) { + p->step(TTR("Importing:") + " " + file, fc); + } FileAccess *f = FileAccess::open(template_path.plus_file(file), FileAccess::WRITE); @@ -302,6 +306,10 @@ void ExportTemplateManager::_install_from_file(const String &p_file) { fc++; } + if (p) { + memdelete(p); + } + unzClose(pkg); _update_template_list(); @@ -405,7 +413,7 @@ void ExportTemplateManager::_http_download_templates_completed(int p_status, int memdelete(f); template_list_state->set_text(TTR("Download Complete.")); template_downloader->hide(); - _install_from_file(path); + _install_from_file(path, false); } } } break; |
