aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/manage_accounts
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2018-04-17 21:46:48 +0200
committerfiaxh <git@mx.ax.lt>2018-04-19 15:41:47 +0200
commite80da806022d8aaa32f77f3c7f0333cc1c80829b (patch)
tree2f388b4773daa1654d4edc642c3af89eb3eaa083 /main/src/ui/manage_accounts
parent6f27c3e58fb8bcb16cae862b95fdd8cdd5073b0b (diff)
downloaddino-e80da806022d8aaa32f77f3c7f0333cc1c80829b.tar.gz
dino-e80da806022d8aaa32f77f3c7f0333cc1c80829b.zip
Add image preview to file choosers
Co-authored-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'main/src/ui/manage_accounts')
-rw-r--r--main/src/ui/manage_accounts/dialog.vala6
1 files changed, 3 insertions, 3 deletions
diff --git a/main/src/ui/manage_accounts/dialog.vala b/main/src/ui/manage_accounts/dialog.vala
index 8f2b76a7..5706fc8c 100644
--- a/main/src/ui/manage_accounts/dialog.vala
+++ b/main/src/ui/manage_accounts/dialog.vala
@@ -150,9 +150,7 @@ public class Dialog : Gtk.Dialog {
}
private void show_select_avatar() {
- FileChooserNative chooser = new FileChooserNative (
- _("Select avatar"), this, FileChooserAction.OPEN,
- _("Select"), _("Cancel"));
+ PreviewFileChooserNative chooser = new PreviewFileChooserNative(_("Select avatar"), this, FileChooserAction.OPEN, _("Select"), _("Cancel"));
FileFilter filter = new FileFilter();
filter.add_pattern("*.png");
filter.add_pattern("*.jpg");
@@ -162,10 +160,12 @@ public class Dialog : Gtk.Dialog {
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);