GNOME Bugzilla – Bug 409843
Filters support for file selector
Last modified: 2008-04-21 20:49:13 UTC
Hello. It would be really useful for me, and I am pretty sure others will find this useful too, to be able to specify filters for the file selector. I have done a patch which allows one to specify filters in the form: "Name | Pattern1 Pattern2 ...". Example: zenity --file-selection --file-filter="Images | *.png *.jpeg *.bmp" --file-filter="Videos | *.avi *.divx" --file-filter="Any | *" The default will be the first given, and the others can be chosen from the combo provided by GtkFileChooserDialog. kdialog uses "Pattern1 Pattern2 ... | Name". Might be nice to have a common format, but mine was just easier to implement. Thanks.
Created attachment 82928 [details] [review] File filter support for file selector patch
*** Bug 349766 has been marked as a duplicate of this bug. ***
Lucas, nice to see this report was not forgotten. :) Could you set it as confirmed? Peraphs it would be better visible to the developers, if it was. Btw, if you don't like something about the patch, the syntax of the command or whatever, let me know that I can get to it.
I marked it as confirmed since this seems like a reasonable idea to me. Also, the patch looked reasonable, as far as I can tell. Finally, I think the proposed syntax is fine.
Commited in trunk, thanks! I'm really sorry for the long delay. :-/ 2008-04-21 Lucas Rocha <lucasr@gnome.org> Add support for file filter in file selection dialog through the new --file-filter command line option (Fixes bug #409843). Patch from Ricardo Cruz <rpmcruz@alunos.dcc.fc.up.pt>. * src/option.c, src/zenity.h: added supporting variable and new GOptionEntry entry for the new command line option. * src/fileselection.c (zenity_fileselection): add file filters based on command line input.