|
|
|
@ -312,13 +312,8 @@ void Window::set_menu_actions() { |
|
|
|
Directories::get().open(path); |
|
|
|
Directories::get().open(path); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
menu.add_action("file_reload_file", [this]() { |
|
|
|
menu.add_action("file_reload_file", []() { |
|
|
|
if(auto view=Notebook::get().get_current_view()) { |
|
|
|
if(auto view=Notebook::get().get_current_view()) { |
|
|
|
Gtk::MessageDialog dialog(*static_cast<Gtk::Window*>(get_toplevel()), "Reload file!", false, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_YES_NO); |
|
|
|
|
|
|
|
dialog.set_default_response(Gtk::RESPONSE_YES); |
|
|
|
|
|
|
|
dialog.set_secondary_text("Do you want to reload: " + view->file_path.string()+" ? The current buffer will be lost."); |
|
|
|
|
|
|
|
int result = dialog.run(); |
|
|
|
|
|
|
|
if(result==Gtk::RESPONSE_YES) { |
|
|
|
|
|
|
|
if(boost::filesystem::exists(view->file_path)) { |
|
|
|
if(boost::filesystem::exists(view->file_path)) { |
|
|
|
std::ifstream can_read(view->file_path.string()); |
|
|
|
std::ifstream can_read(view->file_path.string()); |
|
|
|
if(!can_read) { |
|
|
|
if(!can_read) { |
|
|
|
@ -335,7 +330,6 @@ void Window::set_menu_actions() { |
|
|
|
if(view->load()) |
|
|
|
if(view->load()) |
|
|
|
view->full_reparse(); |
|
|
|
view->full_reparse(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
menu.add_action("file_save", [this]() { |
|
|
|
menu.add_action("file_save", [this]() { |
|
|
|
|