file type selection



On 31 May 2001 14:05:32 -0400, Michael Meeks wrote:
> 
>         So, here is my file selector API (roughly):
> 
>         char *mime_names [] = {
>                 "application/x-gnumeric",
>                 "application/x-xbase" };
>         char *regexps [] = {
>                 ".*\.xls" };
>         CORBA_sequence_CORBA_string mime = { 0, 2, mime_names, FALSE };
>         CORBA_sequence_CORBA_string regexps = { 0, 1, regexps, FALSE }; 
> 
>         obj = bonobo_get_object ("bonobo:file_selector");
> 
>         bonobo_pbclient_setv (
>                 obj,
>                 "mime_types", TC_CORBA_sequence_CORBA_string, &mime,
>                 "regexps", TC_CORBA_sequence_CORBA_string, &regexps,
>                 "saveas_uri", TC_CORBA_string, "file:/tmp/ILoadedThis",
>                 "send_events_on_entry_change", TC_CORBA_boolean, FALSE,
>                 "allow_multi_selection", TC_CORBA_boolean, FALSE,
>                 "history_app_id", TC_CORBA_string, "MyAppName",
>                 NULL);
> 
>         Then perhaps the completion event would give me a status, <cancel>
> or <selected> and a selection sequence etc. etc.

i've started hooking up some of the directory filtering things, and
would like a bit of feedback.

does it really make sense to accept both regexps and mime types[1]?

i think it makes sense to leave the regexps out, as they should be
registered with the mime database.  this provides an easy way to do
mime-type name lookup, so that we don't also have to pass a list of type
descriptions.

does anyone know what mac os x does in this regard?

jacob

[1] one problem is that currently gnome-vfs cannot detect .xcf.bz2 as
gimp files, so i will assume that it will be at some point fixed.  btw,
kde handles it fine.

--
In the afterlife, a cute .signature will only get you so far.





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