mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 00:51:16 +00:00
update EditorDirDialog on external change, closes #4629
This commit is contained in:
parent
81a10795dc
commit
5e7f1fc79b
3 changed files with 12 additions and 2 deletions
|
|
@ -30,6 +30,7 @@
|
|||
#include "os/os.h"
|
||||
#include "os/keyboard.h"
|
||||
#include "tools/editor/editor_settings.h"
|
||||
#include "tools/editor/editor_file_system.h"
|
||||
|
||||
|
||||
void EditorDirDialog::_update_dir(TreeItem* p_item) {
|
||||
|
|
@ -86,11 +87,14 @@ void EditorDirDialog::reload() {
|
|||
_item_collapsed(root);
|
||||
}
|
||||
|
||||
|
||||
void EditorDirDialog::_notification(int p_what) {
|
||||
|
||||
if (p_what==NOTIFICATION_ENTER_TREE) {
|
||||
reload();
|
||||
tree->connect("item_collapsed",this,"_item_collapsed",varray(),CONNECT_DEFERRED);
|
||||
EditorFileSystem::get_singleton()->connect("filesystem_changed",this,"reload");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -198,6 +202,7 @@ void EditorDirDialog::_bind_methods() {
|
|||
ObjectTypeDB::bind_method(_MD("_item_collapsed"),&EditorDirDialog::_item_collapsed);
|
||||
ObjectTypeDB::bind_method(_MD("_make_dir"),&EditorDirDialog::_make_dir);
|
||||
ObjectTypeDB::bind_method(_MD("_make_dir_confirm"),&EditorDirDialog::_make_dir_confirm);
|
||||
ObjectTypeDB::bind_method(_MD("reload"),&EditorDirDialog::reload);
|
||||
|
||||
ADD_SIGNAL(MethodInfo("dir_selected",PropertyInfo(Variant::STRING,"dir")));
|
||||
}
|
||||
|
|
@ -238,4 +243,6 @@ EditorDirDialog::EditorDirDialog() {
|
|||
|
||||
get_ok()->set_text(TTR("Choose"));
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue