summaryrefslogtreecommitdiff
path: root/Userland/Applications/Spreadsheet
diff options
context:
space:
mode:
authorKarol Kosek <krkk@serenityos.org>2022-02-20 18:39:37 +0100
committerTim Flynn <trflynn89@pm.me>2022-03-04 11:56:52 -0500
commit5c978266e3028dd5560f121f079ed28301ba0218 (patch)
tree0748bc005ad724620eed18a885315d38436bcf25 /Userland/Applications/Spreadsheet
parentcef595aa5c266acf3f292b92983d7920fd20ea07 (diff)
downloadserenity-5c978266e3028dd5560f121f079ed28301ba0218.zip
Spreadsheet: Ask about unsaved changes on "Open..." action activation
Diffstat (limited to 'Userland/Applications/Spreadsheet')
-rw-r--r--Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp b/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp
index 733f8b5187..05bfc18b6a 100644
--- a/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp
+++ b/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp
@@ -122,6 +122,9 @@ SpreadsheetWidget::SpreadsheetWidget(GUI::Window& parent_window, NonnullRefPtrVe
});
m_open_action = GUI::CommonActions::make_open_action([&](auto&) {
+ if (!request_close())
+ return;
+
Optional<String> load_path = GUI::FilePicker::get_open_filepath(window());
if (!load_path.has_value())
return;