Feature request and proposal for GTK: Allow OpenDialog Mime Filters.
It is relatively easy for GTK2 and GTK3 to allow Mime filters and it should be feasible for Qt.
In Gtk2WSDialogs, add at line 860 in CreateOpenDialogFilter:
if pos('/',aMask)>0 then
gtk_file_filter_add_mime_type(GtkFilter, PChar(aMask)) else
gtk_file_filter_add_pattern(GtkFilter, PChar(aMask));
In Gtk3WSDialogs, add at line 1111 in CreateOpenDialogFilter:
if pos('/',MaskList.Strings[k])>0 then
gtk_file_filter_add_mime_type(GtkFilter, PgChar(MaskList.Strings[k])) else
gtk_file_filter_add_pattern(GtkFilter, PgChar(MaskList.Strings[k]));
The Filter of the TOpenDialog can then look like this: 'All Images|image/*|All Texts|text/*|All Audio|audio/*'
The Opendialog will then filter the files based on the Mime-Information rather than extension.
'image/*' will suffice instead of listing all image format extensions.
I don't know if it's possible for Windows too, but it shouldn't hurt.
Any chance?
Edited by theo222