diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-12-07 07:26:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-07 07:26:58 +0100 |
commit | cca0ffebdc6045fa6a3ec55511c706fac968bcea (patch) | |
tree | 4bed20255e50442fe9bef46a3c9b4adb39e17bb4 /editor/dependency_editor.cpp | |
parent | ce3f3a9f82545b71a819c32e2c134a55d9d564f2 (diff) | |
parent | c6329b4569dc685ab6f9633e95d63e654c3b9d04 (diff) |
Merge pull request #23691 from groud/add_signals_to_filesystem_dock
Add signals for files move/delete/rename to FileSystemDock
Diffstat (limited to 'editor/dependency_editor.cpp')
-rw-r--r-- | editor/dependency_editor.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp index 74f574ce1c..aa9125915c 100644 --- a/editor/dependency_editor.cpp +++ b/editor/dependency_editor.cpp @@ -506,6 +506,8 @@ void DependencyRemoveDialog::ok_pressed() { Error err = OS::get_singleton()->move_to_trash(path); if (err != OK) { EditorNode::get_singleton()->add_io_error(TTR("Cannot remove:") + "\n" + files_to_delete[i] + "\n"); + } else { + emit_signal("file_removed", files_to_delete[i]); } } @@ -521,6 +523,8 @@ void DependencyRemoveDialog::ok_pressed() { Error err = OS::get_singleton()->move_to_trash(path); if (err != OK) { EditorNode::get_singleton()->add_io_error(TTR("Cannot remove:") + "\n" + dirs_to_delete[i] + "\n"); + } else { + emit_signal("folder_removed", dirs_to_delete[i]); } } @@ -546,6 +550,11 @@ void DependencyRemoveDialog::ok_pressed() { } } +void DependencyRemoveDialog::_bind_methods() { + ADD_SIGNAL(MethodInfo("file_removed", PropertyInfo(Variant::STRING, "file"))); + ADD_SIGNAL(MethodInfo("folder_removed", PropertyInfo(Variant::STRING, "folder"))); +} + DependencyRemoveDialog::DependencyRemoveDialog() { VBoxContainer *vb = memnew(VBoxContainer); |