mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Merge pull request #86486 from timothyqiu/move-copy-dialog
Improve `EditorDirDialog`
This commit is contained in:
commit
00cc23f906
5 changed files with 94 additions and 108 deletions
|
@ -1881,10 +1881,6 @@ Vector<String> FileSystemDock::_check_existing() {
|
|||
return conflicting_items;
|
||||
}
|
||||
|
||||
void FileSystemDock::_move_dialog_confirm(const String &p_path) {
|
||||
_move_operation_confirm(p_path, move_dialog->is_copy_pressed());
|
||||
}
|
||||
|
||||
void FileSystemDock::_move_operation_confirm(const String &p_to_path, bool p_copy, Overwrite p_overwrite) {
|
||||
if (p_overwrite == OVERWRITE_UNDECIDED) {
|
||||
to_move_path = p_to_path;
|
||||
|
@ -2361,6 +2357,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected
|
|||
}
|
||||
}
|
||||
if (to_move.size() > 0) {
|
||||
move_dialog->config(p_selected);
|
||||
move_dialog->popup_centered_ratio(0.4);
|
||||
}
|
||||
} break;
|
||||
|
@ -3855,7 +3852,8 @@ FileSystemDock::FileSystemDock() {
|
|||
|
||||
move_dialog = memnew(EditorDirDialog);
|
||||
add_child(move_dialog);
|
||||
move_dialog->connect("dir_selected", callable_mp(this, &FileSystemDock::_move_dialog_confirm));
|
||||
move_dialog->connect("move_pressed", callable_mp(this, &FileSystemDock::_move_operation_confirm).bind(false, OVERWRITE_UNDECIDED));
|
||||
move_dialog->connect("copy_pressed", callable_mp(this, &FileSystemDock::_move_operation_confirm).bind(true, OVERWRITE_UNDECIDED));
|
||||
|
||||
overwrite_dialog = memnew(ConfirmationDialog);
|
||||
add_child(overwrite_dialog);
|
||||
|
@ -3892,7 +3890,7 @@ FileSystemDock::FileSystemDock() {
|
|||
|
||||
make_dir_dialog = memnew(DirectoryCreateDialog);
|
||||
add_child(make_dir_dialog);
|
||||
make_dir_dialog->connect("dir_created", callable_mp(this, &FileSystemDock::_rescan));
|
||||
make_dir_dialog->connect("dir_created", callable_mp(this, &FileSystemDock::_rescan).unbind(1));
|
||||
|
||||
make_scene_dialog = memnew(SceneCreateDialog);
|
||||
add_child(make_scene_dialog);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue