Improve EditorDirDialog
* Automatically selects the newly created directory * Automatically selects "res://" when nothing is selected * Fixes an error when overwrite/replace dialog appears * Changes "copy checkbox + action button" to "copy button + move button" * Double clicking a directory (un)collapses it instead of copy/move * Uses DirectoryCreateDialog for "Create Folder"
This commit is contained in:
@@ -1883,10 +1883,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;
|
||||
@@ -2363,6 +2359,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;
|
||||
@@ -3847,7 +3844,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);
|
||||
@@ -3884,7 +3882,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);
|
||||
|
||||
Reference in New Issue
Block a user