After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 409843 - Filters support for file selector
Filters support for file selector
Status: RESOLVED FIXED
Product: zenity
Classification: Core
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Zenity Maintainers
Zenity Maintainers
: 349766 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-02-20 02:25 UTC by Ricardo Cruz
Modified: 2008-04-21 20:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
File filter support for file selector patch (4.34 KB, patch)
2007-02-20 02:26 UTC, Ricardo Cruz
committed Details | Review

Description Ricardo Cruz 2007-02-20 02:25:22 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.
Comment 1 Ricardo Cruz 2007-02-20 02:26:08 UTC
Created attachment 82928 [details] [review]
File filter support for file selector patch
Comment 2 Lucas Rocha 2007-05-27 20:38:46 UTC
*** Bug 349766 has been marked as a duplicate of this bug. ***
Comment 3 Ricardo Cruz 2007-05-29 14:47:13 UTC
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.
Comment 4 Tom Tromey 2008-04-19 20:45:19 UTC
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.
Comment 5 Lucas Rocha 2008-04-21 20:49:13 UTC
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.