From e2ddb1715c659dac6b8e751c2b5a772e229ebf57 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sun, 16 Jan 2011 18:26:51 +0000 Subject: Fl_File_Chooser: added a "Show hidden files" button. Hidden files aren't shown by default now. This removes a TODO clause. Fl_Native_File_Chooser: removed the hack that added the "Show hidden files" button, and made the "file already exists" warning message localizable. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8282 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_File_Chooser2.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/Fl_File_Chooser2.cxx') diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx index d3d0d05cb..1237735ed 100644 --- a/src/Fl_File_Chooser2.cxx +++ b/src/Fl_File_Chooser2.cxx @@ -74,7 +74,11 @@ "My Computer" (WIN32)
"File Systems" (all others) - + + hidden_label + "Show hidden files:" + + manage_favorites_label "Manage Favorites" @@ -98,7 +102,7 @@ show_label "Show:" - + sort fl_numericsort @@ -392,6 +396,7 @@ const char *Fl_File_Chooser::new_directory_tooltip = "Create a new directory."; const char *Fl_File_Chooser::preview_label = "Preview"; const char *Fl_File_Chooser::save_label = "Save"; const char *Fl_File_Chooser::show_label = "Show:"; +const char *Fl_File_Chooser::hidden_label = "Show hidden files"; Fl_File_Sort_F *Fl_File_Chooser::sort = fl_numericsort; @@ -1033,8 +1038,6 @@ Fl_File_Chooser::filter(const char *p) // I - Pattern(s) showChoice->add(custom_filter_label); - // TODO: add a menu item to switch hidden files on and off - showChoice->value(0); showChoiceCB(); } @@ -1147,6 +1150,7 @@ Fl_File_Chooser::rescan() // Build the file list... fileList->load(directory_, sort); + if (!show_hidden->value()) remove_hidden_files(); // Update the preview box... update_preview(); @@ -1172,6 +1176,7 @@ void Fl_File_Chooser::rescan_keep_filename() // Build the file list... fileList->load(directory_, sort); + if (!show_hidden->value()) remove_hidden_files(); // Update the preview box... update_preview(); @@ -1297,7 +1302,6 @@ Fl_File_Chooser::update_preview() int w, h; // Width and height of preview image int set = 0; // Set this flag as soon as a decent preview is found - if (!previewButton->value()) return; filename = value(); -- cgit v1.2.3