From 1304b8e5f98fb8ac35298fcd3a4d58a95a18d022 Mon Sep 17 00:00:00 2001 From: Attila Bukor Date: Thu, 18 Apr 2013 12:48:10 -0700 Subject: [PATCH] Remember last directory when adding attachments: Closes #6104 --- THANKS | 2 +- src/client/composer/composer-window.vala | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/THANKS b/THANKS index 35649107..83701de4 100644 --- a/THANKS +++ b/THANKS @@ -3,6 +3,7 @@ The Geary team would like to thank the following contributors: Robert Ancell Jürg Billeter Martijn Braam +Attila Bukor Andrea Corbellini Sergey Shnatsel Davidoff Joanmarie Diggs @@ -24,5 +25,4 @@ Alexander Wilms Andreas Obergrusberger Martin Olsson Mathias Hasselmann -Attila Bukor Jon Dowland diff --git a/src/client/composer/composer-window.vala b/src/client/composer/composer-window.vala index 23e762d2..9736495d 100644 --- a/src/client/composer/composer-window.vala +++ b/src/client/composer/composer-window.vala @@ -83,6 +83,8 @@ public class ComposerWindow : Gtk.Window { // Signal sent when the "Send" button is clicked. public signal void send(ComposerWindow composer); + private static string? current_folder = null; + public Geary.Account account { get; private set; } public string from { get; set; } @@ -664,10 +666,14 @@ public class ComposerWindow : Gtk.Window { _("Choose a file"), this, Gtk.FileChooserAction.OPEN, Gtk.Stock.CANCEL, Gtk.ResponseType.CANCEL, _("_Attach"), Gtk.ResponseType.ACCEPT); + if (!Geary.String.is_empty(current_folder)) + dialog.set_current_folder(current_folder); dialog.set_local_only(false); dialog.set_select_multiple(true); if (dialog.run() == Gtk.ResponseType.ACCEPT) { + current_folder = dialog.get_current_folder(); + foreach (File file in dialog.get_files()) { if (!add_attachment(file)) { finished = false;