mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
FileSelNative: Fixed gtk variant to allow for multiple file types (#262)
This commit is contained in:
parent
41d7042a00
commit
1edf2c6cf7
1 changed files with 3 additions and 1 deletions
|
|
@ -58,7 +58,9 @@ bool FileSelNative::Execute0(int mode, const char *title)
|
|||
for(int i = 0; i < type.GetCount(); i++) {
|
||||
GtkFileFilter *filter = gtk_file_filter_new();
|
||||
gtk_file_filter_set_name(filter, type[i].a);
|
||||
gtk_file_filter_add_pattern(filter, decode(type[i].b, "*.*", "*", type[i].b));
|
||||
Vector<String> patterns = Split(type[i].b, [](int c){ return (int)(c == ';' || c == ' '); });
|
||||
for(int j = 0; j < patterns.GetCount(); j++)
|
||||
gtk_file_filter_add_pattern(filter, decode(patterns[j], "*.*", "*", patterns[j]));
|
||||
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fc), filter);
|
||||
if(i == activetype)
|
||||
gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(fc), filter);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue