From c0709c444713ce96e4efc4103098e15da279a9c2 Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Sun, 12 Sep 2021 16:03:51 +0200 Subject: [PATCH] Playground: Ask to save file contents on quit action Prior this change, activating the action instantly closed the program. --- Userland/DevTools/Playground/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/DevTools/Playground/main.cpp b/Userland/DevTools/Playground/main.cpp index e139e3c613..78f51c7fa4 100644 --- a/Userland/DevTools/Playground/main.cpp +++ b/Userland/DevTools/Playground/main.cpp @@ -221,7 +221,8 @@ int main(int argc, char** argv) file_menu.add_separator(); file_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { - app->quit(); + if (window->on_close_request() == GUI::Window::CloseRequestDecision::Close) + app->quit(); })); auto& edit_menu = window->add_menu("&Edit");