1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:47:35 +00:00

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
parent cef595aa5c
commit 5c978266e3

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;