diff options
author | Marvin W <git@larma.de> | 2017-08-29 21:51:08 +0200 |
---|---|---|
committer | Marvin W <git@larma.de> | 2017-08-29 22:09:07 +0200 |
commit | b428c3a627e7de45b7a9cde85893dcca06926561 (patch) | |
tree | ef72a6ec70dc559c1db18b6c1e3617f8a54324ca /main/src/ui/manage_accounts | |
parent | 7c2023803ebdc83393d6ea56287222a223febc3d (diff) | |
download | dino-b428c3a627e7de45b7a9cde85893dcca06926561.tar.gz dino-b428c3a627e7de45b7a9cde85893dcca06926561.zip |
support platforms without UTF-8 and use native file picker
Diffstat (limited to 'main/src/ui/manage_accounts')
-rw-r--r-- | main/src/ui/manage_accounts/dialog.vala | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/main/src/ui/manage_accounts/dialog.vala b/main/src/ui/manage_accounts/dialog.vala index 7fc926dc..62b797fa 100644 --- a/main/src/ui/manage_accounts/dialog.vala +++ b/main/src/ui/manage_accounts/dialog.vala @@ -146,18 +146,26 @@ public class Dialog : Gtk.Dialog { } private void show_select_avatar() { - FileChooserDialog chooser = new FileChooserDialog ( + FileChooserNative chooser = new FileChooserNative ( _("Select avatar"), this, FileChooserAction.OPEN, - _("Cancel"), ResponseType.CANCEL, - _("Select"), ResponseType.ACCEPT); + _("Select"), _("Cancel")); FileFilter filter = new FileFilter(); - filter.add_mime_type("image/*"); - chooser.set_filter(filter); + filter.add_pattern("*.png"); + filter.add_pattern("*.jpg"); + filter.add_pattern("*.jpeg"); + filter.add_pattern("*.gif"); + filter.add_pattern("*.svg"); + filter.add_pattern("*.bmp"); + filter.set_filter_name(_("Images")); + chooser.add_filter(filter); + filter = new FileFilter(); + filter.set_filter_name(_("All files")); + filter.add_pattern("*"); + chooser.add_filter(filter); if (chooser.run() == Gtk.ResponseType.ACCEPT) { string uri = chooser.get_filename(); stream_interactor.get_module(AvatarManager.IDENTITY).publish(selected_account, uri); } - chooser.close(); } private bool on_active_switch_state_changed(bool state) { |