Re: RFP: File chooser user interface

On Mon, 2003-09-08 at 11:58, Dave Malcolm wrote:
> On Mon, 2003-09-08 at 14:27, Owen Taylor wrote:
> [snip]
> > 
> >  - The application can provide a set of filters for the user to choose 
> >    between. (JPEG files, etc)
> > 
> Sorry to be asking API questions at this late stage, but:

I wouldn't really call this "late" ... since nobody has used the
APIs yet in a real app, it would be premature to freeze them.
> (i) does the application supply the human-readable name of each filter?
> (ii) does the API allow the client code to get which filter the user had
> selected when he/she clicked on "OK"?

 * gtk_file_filter_set_name:
 * @filter: a #GtkFileFilter
 * @name: the human-readable-name for the filter, or %NULL
 *   to remove any existing name.
 * Sets the human-readable name of the filter; this is the string
 * that will be displayed in the file selector user interface if
 * there is a selectable list of filters.
gtk_file_filter_set_name (GtkFileFilter *filter,
                          const gchar   *name)

 * gtk_file_chooser_get_filter:
 * @chooser: a #GtkFileChooser
 * Gets the current filter; see gtk_file_chooser_set_filter().
 * Return value: the current filter, or %NULL
GtkFileFilter *
gtk_file_chooser_get_filter (GtkFileChooser *chooser);

> My rationale:
> Within Conglomerate I have a plugin interface for importers which
> support various MIME types.  At the moment the user picks a file, and
> then, if there's ambiguity about which importer to use, we have to pop
> up an additional dialog asking which one.
> It would be much better to integrate the choice of importer into the
> file chooser dialog; the human-readable filters might look something
> like this:
> - "Open XML file (*.xml)"
> - "Import DTD file as RELAX NG Schema (*.dtd)"
> - "Import DTD file as W3C XML Schema (*.dtd)"
> - "Open OpenOffice Writer file (*.sxw)"
> - "Import OpenOffice Writer file as DocBook 4.1.2 (*.sxw)"
> - "Import Word file as DocBook 4.1.2 (*.doc)"
> - "Import Word file as TEI Document (*.doc)"
> Hopefully you get the general idea.  Having both (i) and (ii) above
> would allow this.

I won't comment on whether I think this is good user interface or not;
it does seem to be possibly mixing different things. But it it is
certainly possible with the current interfaces.


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