diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-03-22 14:46:09 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-03-22 14:46:09 -0300 |
commit | 47efcff8bba522af430ba41016d1966a864c1f4b (patch) | |
tree | ead16ccf2347e0c4cbd0840f9700f49afdf95800 /tools | |
parent | 1aaaee99e9e0ad0c21dcc22faccb9186c9515778 (diff) | |
parent | db0a71fc58137da99137e9fbea3ee982679c9afd (diff) |
Merge pull request #1535 from rollenrolm/hidden_files
New option to show/hide hidden files
Diffstat (limited to 'tools')
-rw-r--r-- | tools/editor/editor_dir_dialog.cpp | 22 | ||||
-rw-r--r-- | tools/editor/editor_settings.cpp | 1 |
2 files changed, 18 insertions, 5 deletions
diff --git a/tools/editor/editor_dir_dialog.cpp b/tools/editor/editor_dir_dialog.cpp index eee4125e93..eec452ab7f 100644 --- a/tools/editor/editor_dir_dialog.cpp +++ b/tools/editor/editor_dir_dialog.cpp @@ -28,6 +28,9 @@ /*************************************************************************/ #include "editor_dir_dialog.h" #include "os/os.h" +#include "os/keyboard.h" +#include "tools/editor/editor_settings.h" + void EditorDirDialog::_update_dir(TreeItem* p_item) { @@ -39,12 +42,21 @@ void EditorDirDialog::_update_dir(TreeItem* p_item) { da->change_dir(cdir); da->list_dir_begin(); String p=da->get_next(); + + bool ishidden; + bool show_hidden = EditorSettings::get_singleton()->get("file_dialog/show_hidden_files"); + while(p!="") { - if (da->current_is_dir() && !p.begins_with(".")) { - TreeItem *ti = tree->create_item(p_item); - ti->set_text(0,p); - ti->set_icon(0,get_icon("Folder","EditorIcons")); - ti->set_collapsed(true); + + ishidden = da->current_is_hidden(); + + if (show_hidden || !ishidden) { + if (da->current_is_dir() && !p.begins_with(".")) { + TreeItem *ti = tree->create_item(p_item); + ti->set_text(0,p); + ti->set_icon(0,get_icon("Folder","EditorIcons")); + ti->set_collapsed(true); + } } p=da->get_next(); diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp index 24699ac87f..deb5d86a2e 100644 --- a/tools/editor/editor_settings.cpp +++ b/tools/editor/editor_settings.cpp @@ -446,6 +446,7 @@ void EditorSettings::_load_defaults() { set("text_editor/create_signal_callbacks",true); + set("file_dialog/show_hidden_files", false); set("animation/autorename_animation_tracks",true); set("animation/confirm_insert_track",true); |