FileManager: Save 'Show dotfiles' setting in FileManager.ini

This commit is contained in:
thankyouverycool 2021-02-12 17:37:07 -05:00 committed by Andreas Kling
parent f9c1918484
commit cb42ba0ab1
Notes: sideshowbarker 2024-07-19 17:29:39 +09:00
2 changed files with 7 additions and 0 deletions

View File

@ -1,5 +1,6 @@
[DirectoryView]
ViewMode=Icon
ShowDotFiles=0
[Window]
Left=150

View File

@ -623,8 +623,14 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio
auto action_show_dotfiles = GUI::Action::create_checkable("Show dotfiles", { Mod_Ctrl, Key_H }, [&](auto& action) {
directory_view.set_should_show_dotfiles(action.is_checked());
refresh_tree_view();
config->write_bool_entry("DirectoryView", "ShowDotFiles", action.is_checked());
config->sync();
});
auto show_dotfiles = config->read_bool_entry("DirectoryView", "ShowDotFiles", false);
directory_view.set_should_show_dotfiles(show_dotfiles);
action_show_dotfiles->set_checked(show_dotfiles);
auto& view_menu = menubar->add_menu("View");
view_menu.add_action(*view_as_icons_action);
view_menu.add_action(*view_as_table_action);