Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestions for improving FileDialog (filtering) #33

Open
GoogleCodeExporter opened this issue Mar 28, 2015 · 1 comment
Open

Suggestions for improving FileDialog (filtering) #33

GoogleCodeExporter opened this issue Mar 28, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

It would be nice if the FileDialog could provide a simple filtering mechanism.  
I have attached two patches to do this.

The first patch provides a very simple and crude filter mechanism (simply set 
path_filter to a function that returns a bool - True => file/dir is shown, 
False => it is hidden).

The second patch extends this to provide an file-extension filter by accepting 
a simple list as argument for the constructor.  Example being:

        ext_f = [
           ("Images", ("jpg", "jpeg", "png")),
           ("Audio", ("mp3", "wav")),
           ("Text files", "txt"),
           ]
        dialog = FileDialog(value="path/to/resources", ext_filter=ext_f)

The user can then choose the relevant filter from a "drop-down" box (a Select 
in pgu terms).


Original issue reported on code.google.com by NThykier@gmail.com on 7 Dec 2012 at 1:09

Attachments:

@GoogleCodeExporter
Copy link
Author

Small test script for demonstrating the second patch.

Original comment by NThykier@gmail.com on 7 Dec 2012 at 1:14

  • Added labels: ****
  • Removed labels: ****

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant