From 7b4117a282582450eee69baacd82f9d3cdc4d993 Mon Sep 17 00:00:00 2001 From: Adrian Cochrane Date: Tue, 17 Apr 2018 15:27:58 +1200 Subject: [PATCH] Implement save (as) 9min --- src/window.vala | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/window.vala b/src/window.vala index 4dcde6f..92451ed 100644 --- a/src/window.vala +++ b/src/window.vala @@ -134,7 +134,14 @@ public class WriteAs.MainWindow : Gtk.ApplicationWindow { } private bool save_as() { - // TODO + try { + var file = prompt_file(Gtk.FileChooserAction.SAVE, _("_Save as")); + file.replace_contents(canvas.buffer.text.data, null, false, + FileCreateFlags.PRIVATE | FileCreateFlags.REPLACE_DESTINATION, + null); + } catch (Error e) { + // It's fine... + } return true; }