[geary] Use FileChooserNative for save/save all as well. Bug 770467
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary] Use FileChooserNative for save/save all as well. Bug 770467
- Date: Fri, 7 Oct 2016 11:30:04 +0000 (UTC)
commit acb6b705fffd4f3deb3dde19d9efde98317ef719
Author: Gautier Pelloux-Prayer <gautier+git damsy net>
Date: Wed Oct 5 10:24:21 2016 +0200
Use FileChooserNative for save/save all as well. Bug 770467
src/client/application/geary-controller.vala | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/client/application/geary-controller.vala b/src/client/application/geary-controller.vala
index 0ce60ce..bb79db5 100644
--- a/src/client/application/geary-controller.vala
+++ b/src/client/application/geary-controller.vala
@@ -1932,8 +1932,13 @@ public class GearyController : Geary.BaseObject {
Gtk.FileChooserAction action = (attachments.size == 1)
? Gtk.FileChooserAction.SAVE
: Gtk.FileChooserAction.SELECT_FOLDER;
+#if GTK_3_20
+ Gtk.FileChooserNative dialog = new Gtk.FileChooserNative(null, main_window, action,
+ Stock._CANCEL, Stock._SAVE);
+#else
Gtk.FileChooserDialog dialog = new Gtk.FileChooserDialog(null, main_window, action,
- Stock._CANCEL, Gtk.ResponseType.CANCEL, Stock._SAVE, Gtk.ResponseType.ACCEPT, null);
+ Stock._CANCEL, Gtk.ResponseType.CANCEL, Stock._SAVE, Gtk.ResponseType.ACCEPT, null);
+#endif
if (last_save_directory != null)
dialog.set_current_folder(last_save_directory.get_path());
if (attachments.size == 1) {
@@ -1986,8 +1991,13 @@ public class GearyController : Geary.BaseObject {
}
private void on_save_buffer_to_file(string? filename, Geary.Memory.Buffer buffer) {
+#if GTK_3_20
+ Gtk.FileChooserNative dialog = new Gtk.FileChooserNative(null, main_window,
Gtk.FileChooserAction.SAVE,
+ Stock._CANCEL, Stock._SAVE);
+#else
Gtk.FileChooserDialog dialog = new Gtk.FileChooserDialog(null, main_window,
Gtk.FileChooserAction.SAVE,
Stock._CANCEL, Gtk.ResponseType.CANCEL, Stock._SAVE, Gtk.ResponseType.ACCEPT, null);
+#endif
if (last_save_directory != null)
dialog.set_current_folder(last_save_directory.get_path());
if (!Geary.String.is_empty(filename))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]