MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _export_project

Method _export_project

editor/export/project_export.cpp:1310–1346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1308}
1309
1310void 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
1348void ProjectExportDialog::_export_project_to_path(const String &p_path) {
1349 // Save this name for use in future exports (but drop the file extension)

Callers

nothing calls this directly

Calls 15

vformatFunction · 0.85
TTRFunction · 0.85
get_platformMethod · 0.80
get_ok_buttonMethod · 0.80
sizeMethod · 0.65
connectMethod · 0.65
is_nullMethod · 0.45
set_accessMethod · 0.45
clear_filtersMethod · 0.45
get_binary_extensionsMethod · 0.45
add_filterMethod · 0.45
get_nameMethod · 0.45

Tested by

no test coverage detected