1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-31 18:41:20 +00:00

Make EditorFileDialog inherit FileDialog

This commit is contained in:
kobewi
2025-12-02 12:30:51 +01:00
parent f5918a9d35
commit c1cc178a82
23 changed files with 253 additions and 3285 deletions

View File

@@ -978,7 +978,6 @@ void ProjectDialog::_notification(int p_what) {
} break;
case NOTIFICATION_READY: {
fdialog_project = memnew(EditorFileDialog);
fdialog_project->set_previews_enabled(false); // Crucial, otherwise the engine crashes.
fdialog_project->set_access(EditorFileDialog::ACCESS_FILESYSTEM);
fdialog_project->connect("dir_selected", callable_mp(this, &ProjectDialog::_project_path_selected));
fdialog_project->connect("file_selected", callable_mp(this, &ProjectDialog::_project_path_selected));
@@ -1188,7 +1187,6 @@ ProjectDialog::ProjectDialog() {
spacer->set_h_size_flags(Control::SIZE_EXPAND_FILL);
default_files_container->add_child(spacer);
fdialog_install = memnew(EditorFileDialog);
fdialog_install->set_previews_enabled(false); //Crucial, otherwise the engine crashes.
fdialog_install->set_access(EditorFileDialog::ACCESS_FILESYSTEM);
add_child(fdialog_install);

View File

@@ -1366,11 +1366,11 @@ ProjectManager::ProjectManager() {
EditorScale::set_scale(EDITOR_GET("interface/editor/custom_display_scale"));
break;
}
EditorFileDialog::get_icon_func = &ProjectManager::_file_dialog_get_icon;
EditorFileDialog::get_thumbnail_func = &ProjectManager::_file_dialog_get_thumbnail;
FileDialog::set_get_icon_callback(callable_mp_static(ProjectManager::_file_dialog_get_icon));
FileDialog::set_get_thumbnail_callback(callable_mp_static(ProjectManager::_file_dialog_get_thumbnail));
EditorFileDialog::set_default_show_hidden_files(EDITOR_GET("filesystem/file_dialog/show_hidden_files"));
EditorFileDialog::set_default_display_mode((EditorFileDialog::DisplayMode)EDITOR_GET("filesystem/file_dialog/display_mode").operator int());
FileDialog::set_default_show_hidden_files(EDITOR_GET("filesystem/file_dialog/show_hidden_files"));
FileDialog::set_default_display_mode((EditorFileDialog::DisplayMode)EDITOR_GET("filesystem/file_dialog/display_mode").operator int());
int swap_cancel_ok = EDITOR_GET("interface/editor/accept_dialog_cancel_ok_buttons");
if (swap_cancel_ok != 0) { // 0 is auto, set in register_scene based on DisplayServer.
@@ -1735,7 +1735,6 @@ ProjectManager::ProjectManager() {
quick_settings_dialog->connect("restart_required", callable_mp(this, &ProjectManager::_restart_confirmed));
scan_dir = memnew(EditorFileDialog);
scan_dir->set_previews_enabled(false);
scan_dir->set_access(EditorFileDialog::ACCESS_FILESYSTEM);
scan_dir->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_DIR);
scan_dir->set_title(TTRC("Select a Folder to Scan")); // Must be after mode or it's overridden.