From 140ae6a821beb87f6e93836ceb2627a6a304e329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Fri, 16 Oct 2015 13:08:22 +0200 Subject: [PATCH] Fix indention and error message --- src/window.cc | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/window.cc b/src/window.cc index 880a3d8..851fac5 100644 --- a/src/window.cc +++ b/src/window.cc @@ -195,7 +195,7 @@ void Window::create_menu() { else Singleton::terminal()->print("Error: "+path.string()+" already exists.\n"); } else { - Singleton::terminal()->print("Cancel \n"); + Singleton::terminal()->print("Dialog was closed \n"); } Singleton::directories()->select(path); }); @@ -237,24 +237,24 @@ void Window::create_menu() { if (boost::filesystem::exists(path)) Singleton::directories()->open(path); else - Singleton::terminal()->print("Cancel \n"); + Singleton::terminal()->print("Dialog was closed \n"); }); menu.action_group->add(Gtk::Action::create("FileSaveAs", "Save As"), Gtk::AccelKey(menu.key_map["save_as"]), [this]() { - auto path = Dialog::save_file(); - if(path.size()>0) { - std::ofstream file(path); - if(file) { - file << notebook.get_current_view()->get_buffer()->get_text(); - file.close(); - if(Singleton::directories()->current_path!="") - Singleton::directories()->update(); - notebook.open(path); - Singleton::terminal()->print("File saved to: " + notebook.get_current_view()->file_path.string()+"\n"); - } - else - Singleton::terminal()->print("Error saving file\n"); + auto path = Dialog::save_file(); + if(path.size()>0) { + std::ofstream file(path); + if(file) { + file << notebook.get_current_view()->get_buffer()->get_text(); + file.close(); + if(Singleton::directories()->current_path!="") + Singleton::directories()->update(); + notebook.open(path); + Singleton::terminal()->print("File saved to: " + notebook.get_current_view()->file_path.string()+"\n"); } - }); + else + Singleton::terminal()->print("Error saving file\n"); + } +}); menu.action_group->add(Gtk::Action::create("Preferences", "Preferences..."), Gtk::AccelKey(menu.key_map["preferences"]), [this]() { notebook.open(Singleton::config_dir()+"config.json"); });