diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-03-07 17:06:11 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-03-07 17:06:11 +0100 |
commit | 187d7cb4001fd0820d5eef53aeb593fb0db25802 (patch) | |
tree | ffd207a346e424d0c212ff3a3489efb435ab7304 /Applications/TextEditor | |
parent | a5bc20c7330f0a0577b52ae7f1dc70b88407f88b (diff) | |
download | serenity-187d7cb4001fd0820d5eef53aeb593fb0db25802.zip |
GTextEditor: Add write_to_file(String path) :^)
Diffstat (limited to 'Applications/TextEditor')
-rw-r--r-- | Applications/TextEditor/main.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Applications/TextEditor/main.cpp b/Applications/TextEditor/main.cpp index 2180e4db32..1fd5e3e3b8 100644 --- a/Applications/TextEditor/main.cpp +++ b/Applications/TextEditor/main.cpp @@ -66,8 +66,9 @@ int main(int argc, char** argv) dbgprintf("FIXME: Implement File/Open"); }); - auto save_action = GAction::create("Save document", { Mod_Ctrl, Key_S }, GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/save16.rgb", { 16, 16 }), [] (const GAction&) { - dbgprintf("FIXME: Implement File/Save"); + auto save_action = GAction::create("Save document", { Mod_Ctrl, Key_S }, GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/save16.rgb", { 16, 16 }), [&] (const GAction&) { + dbgprintf("Writing document to '%s'\n", path.characters()); + text_editor->write_to_file(path); }); auto menubar = make<GMenuBar>(); |