Spreadsheet: Ask about unsaved changes on "Open..." action activation

This commit is contained in:
Karol Kosek 2022-02-20 18:39:37 +01:00 committed by Tim Flynn
commit 5c978266e3
Notes: sideshowbarker 2024-07-17 17:57:45 +09:00

View file

@ -122,6 +122,9 @@ SpreadsheetWidget::SpreadsheetWidget(GUI::Window& parent_window, NonnullRefPtrVe
}); });
m_open_action = GUI::CommonActions::make_open_action([&](auto&) { m_open_action = GUI::CommonActions::make_open_action([&](auto&) {
if (!request_close())
return;
Optional<String> load_path = GUI::FilePicker::get_open_filepath(window()); Optional<String> load_path = GUI::FilePicker::get_open_filepath(window());
if (!load_path.has_value()) if (!load_path.has_value())
return; return;