diff options
Diffstat (limited to 'editor/export_template_manager.cpp')
-rw-r--r-- | editor/export_template_manager.cpp | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp index d0f008bd43..a39c8b2209 100644 --- a/editor/export_template_manager.cpp +++ b/editor/export_template_manager.cpp @@ -128,7 +128,7 @@ void ExportTemplateManager::_download_template(const String &p_version) { memdelete(template_list->get_child(0)); } template_downloader->popup_centered_minsize(); - template_list_state->set_text(TTR("Retrieving mirrors, please wait..")); + template_list_state->set_text(TTR("Retrieving mirrors, please wait...")); template_download_progress->set_max(100); template_download_progress->set_value(0); request_mirror->request("https://godotengine.org/mirrorlist/" + p_version + ".json"); @@ -217,25 +217,15 @@ void ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_ data_str.parse_utf8((const char *)data.ptr(), data.size()); data_str = data_str.strip_edges(); - if (data_str.get_slice_count("-") != 2 || data_str.get_slice_count(".") != 2) { - EditorNode::get_singleton()->show_warning(TTR("Invalid version.txt format inside templates.")); + // Version number should be of the form major.minor[.patch].status[.module_config] + // so it can in theory have 3 or more slices. + if (data_str.get_slice_count(".") < 3) { + EditorNode::get_singleton()->show_warning(vformat(TTR("Invalid version.txt format inside templates: %s."), data_str)); unzClose(pkg); return; } - String ver = data_str.get_slice("-", 0); - - int major = ver.get_slice(".", 0).to_int(); - int minor = ver.get_slice(".", 1).to_int(); - String rev = data_str.get_slice("-", 1); - - if (!rev.is_valid_identifier()) { - EditorNode::get_singleton()->show_warning(TTR("Invalid version.txt format inside templates. Revision is not a valid identifier.")); - unzClose(pkg); - return; - } - - version = itos(major) + "." + itos(minor) + "-" + rev; + version = data_str; } fc++; @@ -443,7 +433,7 @@ void ExportTemplateManager::_begin_template_download(const String &p_url) { template_download_progress->set_max(100); template_download_progress->set_value(0); template_download_progress->show(); - template_list_state->set_text(TTR("Connecting to Mirror..")); + template_list_state->set_text(TTR("Connecting to Mirror...")); } void ExportTemplateManager::_notification(int p_what) { @@ -469,13 +459,13 @@ void ExportTemplateManager::_notification(int p_what) { status = TTR("Can't Resolve"); errored = true; break; - case HTTPClient::STATUS_CONNECTING: status = TTR("Connecting.."); break; + case HTTPClient::STATUS_CONNECTING: status = TTR("Connecting..."); break; case HTTPClient::STATUS_CANT_CONNECT: status = TTR("Can't Connect"); errored = true; break; case HTTPClient::STATUS_CONNECTED: status = TTR("Connected"); break; - case HTTPClient::STATUS_REQUESTING: status = TTR("Requesting.."); break; + case HTTPClient::STATUS_REQUESTING: status = TTR("Requesting..."); break; case HTTPClient::STATUS_BODY: status = TTR("Downloading"); if (download_templates->get_body_size() > 0) { |