Re: GtkFileChooser API work

One thing that I think would be useful would be to allow the
programatic specification of which directories can be accessed
via the GtkFileChooser dialog.

I was working on a program that was intended to be run as root
and for safety purposes, we wanted to restrict the dialog to only
allow users to save files to particular directories.  This was
to prevent accidental overwrite of any important files, etc.  In
the custom filechooser that I implemented, the "OK" button was
grayed out if the user navigated to a directory that wasn't in
the list of acceptable directories.  This could probably be
handled more elegantly, though.

Since the default GtkFileChooser didn't allow a list of acceptable
directories to be specified, I had to implement my own custom file
chooser.  It seems like this sort of feature would be generally
useful for programs that want to restrict the loading/saving of
files to/from particular directories (such as a MyDocuments
directory), or for selection of files that are always in the
same locations - such as those system files which are found
in /usr, /etc, or in the user's home directory.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]