| 1308 | } |
| 1309 | |
| 1310 | void ProjectExportDialog::_export_project() { |
| 1311 | Ref<EditorExportPreset> current = get_current_preset(); |
| 1312 | ERR_FAIL_COND(current.is_null()); |
| 1313 | Ref<EditorExportPlatform> platform = current->get_platform(); |
| 1314 | ERR_FAIL_COND(platform.is_null()); |
| 1315 | |
| 1316 | export_project->set_access(EditorFileDialog::ACCESS_FILESYSTEM); |
| 1317 | export_project->clear_filters(); |
| 1318 | |
| 1319 | List<String> extension_list = platform->get_binary_extensions(current); |
| 1320 | for (const String &extension : extension_list) { |
| 1321 | // TRANSLATORS: This is the name of a project export file format. %s will be replaced by the platform name. |
| 1322 | export_project->add_filter("*." + extension, vformat(TTR("%s Export"), platform->get_name())); |
| 1323 | } |
| 1324 | |
| 1325 | if (!current->get_export_path().is_empty()) { |
| 1326 | export_project->set_current_path(current->get_export_path()); |
| 1327 | } else { |
| 1328 | if (extension_list.size() >= 1) { |
| 1329 | export_project->set_current_file(default_filename + "." + extension_list.front()->get()); |
| 1330 | } else { |
| 1331 | export_project->set_current_file(default_filename); |
| 1332 | } |
| 1333 | } |
| 1334 | |
| 1335 | /// Ensure that signal is connected if previous attempt left it disconnected |
| 1336 | /// with _validate_export_path. |
| 1337 | /// @todo FIXME: This is a hack, we should instead change EditorFileDialog to allow |
| 1338 | /// disabling validation by the "text_submitted" signal. |
| 1339 | if (!export_project->get_line_edit()->is_connected(SceneStringName(text_submitted), callable_mp(export_project, &EditorFileDialog::_file_submitted))) { |
| 1340 | export_project->get_ok_button()->set_disabled(false); |
| 1341 | export_project->get_line_edit()->connect(SceneStringName(text_submitted), callable_mp(export_project, &EditorFileDialog::_file_submitted)); |
| 1342 | } |
| 1343 | |
| 1344 | export_project->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); |
| 1345 | export_project->popup_file_dialog(); |
| 1346 | } |
| 1347 | |
| 1348 | void ProjectExportDialog::_export_project_to_path(const String &p_path) { |
| 1349 | // Save this name for use in future exports (but drop the file extension) |
nothing calls this directly
no test coverage detected