Implement save (as)

9min
This commit is contained in:
Adrian Cochrane 2018-04-17 15:27:58 +12:00
parent a2b0dfde54
commit 7b4117a282

View File

@ -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;
}