diff options
author | fiaxh <git@lightrise.org> | 2019-01-30 02:58:56 +0100 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2019-01-30 03:07:18 +0100 |
commit | 8e9e05615c2a59d37d189efd414d2b8d2a31b533 (patch) | |
tree | ccef320406f6c82c606a3a19dbd737b37225da89 /main/src | |
parent | 8e14ac6d714b7f88e16de31a6c795e811dc27417 (diff) | |
download | dino-8e9e05615c2a59d37d189efd414d2b8d2a31b533.tar.gz dino-8e9e05615c2a59d37d189efd414d2b8d2a31b533.zip |
Improve FileFilter for avatar selection
fixes #512
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/ui/manage_accounts/dialog.vala | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/main/src/ui/manage_accounts/dialog.vala b/main/src/ui/manage_accounts/dialog.vala index 1a370349..a86a8346 100644 --- a/main/src/ui/manage_accounts/dialog.vala +++ b/main/src/ui/manage_accounts/dialog.vala @@ -152,12 +152,11 @@ public class Dialog : Gtk.Dialog { private void show_select_avatar() { PreviewFileChooserNative chooser = new PreviewFileChooserNative(_("Select avatar"), this, FileChooserAction.OPEN, _("Select"), _("Cancel")); FileFilter filter = new FileFilter(); - filter.add_pattern("*.png"); - filter.add_pattern("*.jpg"); - filter.add_pattern("*.jpeg"); - filter.add_pattern("*.gif"); - filter.add_pattern("*.svg"); - filter.add_pattern("*.bmp"); + foreach (PixbufFormat pixbuf_format in Pixbuf.get_formats()) { + foreach (string mime_type in pixbuf_format.get_mime_types()) { + filter.add_mime_type(mime_type); + } + } filter.set_filter_name(_("Images")); chooser.add_filter(filter); |