summaryrefslogtreecommitdiff
path: root/Userland/DevTools
diff options
context:
space:
mode:
authorKarol Kosek <krkk@krkk.ct8.pl>2021-09-12 16:03:51 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-12 16:30:25 +0200
commitc0709c444713ce96e4efc4103098e15da279a9c2 (patch)
tree2d79187bd6327da557a68faae704a81f6eb78b98 /Userland/DevTools
parentacf3e230b0ae0bf992e6b94768f0c5f1a78abca0 (diff)
downloadserenity-c0709c444713ce96e4efc4103098e15da279a9c2.zip
Playground: Ask to save file contents on quit action
Prior this change, activating the action instantly closed the program.
Diffstat (limited to 'Userland/DevTools')
-rw-r--r--Userland/DevTools/Playground/main.cpp3
1 files changed, 2 insertions, 1 deletions
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");