From 42eef3cdc65165af852dc256cabf2cadb2caf79e Mon Sep 17 00:00:00 2001 From: Franklin Sobrinho Date: Sun, 6 Dec 2015 19:35:31 -0300 Subject: [PATCH] Better hidden folders display preferences for editor file dialogs --- demos/gui/input_mapping/controls.scn | Bin 2686 -> 2852 bytes scene/gui/file_dialog.cpp | 2 +- tools/editor/editor_file_dialog.cpp | 18 +++++++++++------- tools/editor/editor_node.cpp | 1 + 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/demos/gui/input_mapping/controls.scn b/demos/gui/input_mapping/controls.scn index 276712ba2205efe1e3c9b04f52ba9d67e5d2ffbd..03567fb691c779a28c0392133ceab3c98a551c65 100644 GIT binary patch literal 2852 zcmX|D3wRS%7Cw_noAePA==()(N(+TT%hL+MawZe{Ku{>CNX40?nYPm=GchwMZDrRW zXmISNyg0g@j>iRJiwYaRyDy#U33wv9?-F)Apy4C zpN2&|4?`aZfIS=F1`EJnSpWtg#(*i7%m71JNGGgqfv>4u3M^`p6bW`_5Qi}ZfF*9Y zjVeLZ*?FXYP<9x=c=r>PpAK9DF@R z5JHmf69ll5>wzbn%g%s7sZ)>ofP=B}p+nYWe^3&;Q-iW1X@b@+hr_OCxm9e)*D1uZ5@WeJ=6OE96cl?cepv~~N{c4; zCWq7xNr;AhM;K4kRRN0lm|0g_T7p~|6OhFFTsF{shs8=Zpe|Po#%3^k@urolxdTaU z(NGxd8%=!B9jp?pPS`sWi**= zpf%6rO_+mITy@Ec(4{IkuGmIfq!Aw}%Rm6i! zsWFS^e!KZb9FOO4Bw8$*;tLC5xzlyfU?+Oci1|!JC0(u(vXYU);z@R0 z>I2nyBeG1lI@%l?WMZ??!9OBai4|xYijPAUi@X-Gh>1w99~imANZNuE#Ui#PA_olf zLrfOL^9*<>No{V{Bt708TjQ~d)vVU4E;mwm{&R6ud?tnxfSd7cliIAsbCS08Q^N-_ z$6$7ENiocuxLaZB%3D#yN!Y^%q~@S^3Ql8$F0s+H;uGR?VKLj??2Cw*G@ze(bl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sIABUZH&5>oLHmEN>3fE{<`n#$zkPJ(-(>Mo-;rHDpSY8@{EgrPP*yusG z9fnKoP@wJcDi|N~mpWjU$qCwlyI{viC)R9#Paj2Pzr9f3sYReXePs%9mTPmP{AX(XZUv9!*9ILH z%>bWCnCW~`&Y|Lo=PGCA0(Q#{I6ZU@MF^A4tZgSEc0mVgPvPR%E)v8E>3%85MZgum zeg~WEW}ie@K}4yS1%mfN52=>|QXg{<_)iSaHwN(Pyb!==q=3JH75rKz?BT%=EOlBArMFa!{B3K zHnNOG+|EYJNr;to0YaamMK-5EO-W?81o5-{y}mM<%xyFAp+FwyZges$_p-SzFI2`i zu*{102G%w)KpAiG!evzE#a%3?BhW%drGu;}iWr18W;D#?bFQTA|L02D&Jj3Vh6tOE zGG)dV>n(D1k@zIoetS^aDBR-<3o5| zI>lImg`3L~BQw4WS?&v!a{RpXlf!bJQ9glm1mrOTg#wqIT7 z{t{%set_icon(get_icon("MoveDown","EditorIcons")); fav_rm->set_icon(get_icon("RemoveSmall","EditorIcons")); - } - if (p_what==NOTIFICATION_PROCESS) { + } else if (p_what==NOTIFICATION_PROCESS) { if (preview_waiting) { preview_wheel_timeout-=get_process_delta_time(); @@ -48,12 +47,17 @@ void EditorFileDialog::_notification(int p_what) { preview_wheel_timeout=0.1; } } - } - - if (p_what==NOTIFICATION_DRAW) { + } else if (p_what==NOTIFICATION_DRAW) { //RID ci = get_canvas_item(); //get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size())); + } else if (p_what==EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { + + bool show_hidden = EditorSettings::get_singleton()->get("file_dialog/show_hidden_files"); + + if (show_hidden != show_hidden_files) { + set_show_hidden_files(show_hidden); + } } } @@ -1013,7 +1017,7 @@ void EditorFileDialog::_go_forward(){ } -bool EditorFileDialog::default_show_hidden_files=true; +bool EditorFileDialog::default_show_hidden_files=false; void EditorFileDialog::set_display_mode(DisplayMode p_mode) { @@ -1142,7 +1146,7 @@ void EditorFileDialog::_save_to_recent() { EditorFileDialog::EditorFileDialog() { - show_hidden_files=true; + show_hidden_files=default_show_hidden_files; display_mode=DISPLAY_THUMBNAILS; local_history_pos=0; diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 8b04e4f77e0..8e39ce36f80 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -4594,6 +4594,7 @@ EditorNode::EditorNode() { ResourceLoader::set_abort_on_missing_resources(false); FileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("file_dialog/show_hidden_files")); + EditorFileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("file_dialog/show_hidden_files")); ResourceLoader::set_error_notify_func(this,_load_error_notify); ResourceLoader::set_dependency_error_notify_func(this,_dependency_error_report);