# HG changeset patch # User zas_ # Date 1208112984 0 # Node ID 0b82646e977f3d6de3c6847ac388583b328483a5 # Parent 5c82855feba73be42266990995065c00569b1a12 Let toggle the visibility of hidden files from directories list or tree contextual menu. diff -r 5c82855feba7 -r 0b82646e977f src/view_dir_list.c --- a/src/view_dir_list.c Sun Apr 13 12:24:42 2008 +0000 +++ b/src/view_dir_list.c Sun Apr 13 18:56:24 2008 +0000 @@ -371,6 +371,14 @@ if (vdl->layout) layout_refresh(vdl->layout); } +static void vdlist_toggle_show_dot_files_cb(GtkWidget *widget, gpointer data) +{ + ViewDirList *vdl = data; + + options->file_filter.show_dot_files = !options->file_filter.show_dot_files; + if (vdl->layout) layout_refresh(vdl->layout); +} + static GtkWidget *vdlist_pop_menu(ViewDirList *vdl, FileData *fd) { GtkWidget *menu; @@ -418,6 +426,9 @@ menu_item_add_divider(menu); menu_item_add_check(menu, _("View as _tree"), FALSE, G_CALLBACK(vdlist_pop_menu_tree_cb), vdl); + menu_item_add_check(menu, _("Show _hidden files"), options->file_filter.show_dot_files, + G_CALLBACK(vdlist_toggle_show_dot_files_cb), vdl); + menu_item_add_stock(menu, _("Re_fresh"), GTK_STOCK_REFRESH, G_CALLBACK(vdlist_pop_menu_refresh_cb), vdl); diff -r 5c82855feba7 -r 0b82646e977f src/view_dir_tree.c --- a/src/view_dir_tree.c Sun Apr 13 12:24:42 2008 +0000 +++ b/src/view_dir_tree.c Sun Apr 13 18:56:24 2008 +0000 @@ -462,6 +462,14 @@ if (vdt->layout) layout_refresh(vdt->layout); } +static void vdtree_toggle_show_dot_files_cb(GtkWidget *widget, gpointer data) +{ + ViewDirTree *vdt = data; + + options->file_filter.show_dot_files = !options->file_filter.show_dot_files; + if (vdt->layout) layout_refresh(vdt->layout); +} + static GtkWidget *vdtree_pop_menu(ViewDirTree *vdt, FileData *fd) { GtkWidget *menu; @@ -513,6 +521,9 @@ menu_item_add_divider(menu); menu_item_add_check(menu, _("View as _tree"), TRUE, G_CALLBACK(vdtree_pop_menu_tree_cb), vdt); + menu_item_add_check(menu, _("Show _hidden files"), options->file_filter.show_dot_files, + G_CALLBACK(vdtree_toggle_show_dot_files_cb), vdt); + menu_item_add_stock(menu, _("Re_fresh"), GTK_STOCK_REFRESH, G_CALLBACK(vdtree_pop_menu_refresh_cb), vdt);