On Fri, 28 May 2021, Sven Schreiber wrote:
Am 26.05.2021 um 11:33 schrieb Sven Schreiber:
> Am 26.05.2021 um 03:34 schrieb Cottrell, Allin:
>> Sounds good. Who wants to do it?
> After trying to search for relevant keywords in the source, my working
> assumption is that the file gui/fnsave.c is relevant. If you can confirm
> this hunch, I can try to apply the necessary change. (In a little
> branch, just to be safe...)
OK, so in the meantime I was directed to gui/fileselect.c. But I'm
facing a problem there: in the filesel_add_filter function there's a
call to gtk_file_filter_add_pattern, and here's the associated minimal
documentation:
https://developer.gnome.org/gtk3/stable/GtkFileFilter.html#gtk-file-filte...
The question is, how is it possible to specify one pattern which covers
two file extensions (*.zip and *.gfn) ? The doc just says use a glob,
but what exactly is supported there? Would curly braces be expected to
work to denote multiple patterns, like this: {*.zip,*.gfn}
Not sure about that -- in fact I doubt it, a glob is not a regular
expression -- but what I had in mind is to add two patterns to the
one filter, as in
GtkFileFilter *filt = gtk_file_filter_new();
gtk_file_filter_set_name(filt, _(desc));
gtk_file_filter_add_pattern(filt, pat1);
gtk_file_filter_add_pattern(filt, pat2);
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filt);
where desc is the description, pat1 would be "*.gfn", and pat2 would
be "*.zip".
Allin