summaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/editor_dir_dialog.cpp7
-rw-r--r--tools/editor/editor_dir_dialog.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/tools/editor/editor_dir_dialog.cpp b/tools/editor/editor_dir_dialog.cpp
index 395c4ba680..fda2d9bacf 100644
--- a/tools/editor/editor_dir_dialog.cpp
+++ b/tools/editor/editor_dir_dialog.cpp
@@ -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"));
+
+
}
diff --git a/tools/editor/editor_dir_dialog.h b/tools/editor/editor_dir_dialog.h
index 1c2593219c..94facceed4 100644
--- a/tools/editor/editor_dir_dialog.h
+++ b/tools/editor/editor_dir_dialog.h
@@ -53,6 +53,8 @@ class EditorDirDialog : public ConfirmationDialog {
void _make_dir_confirm();
void ok_pressed();
+
+
protected:
void _notification(int p_what);