From 53d73b95ce571023ac93ae231f679f3fa0267f4d Mon Sep 17 00:00:00 2001 From: david072 Date: Tue, 31 Oct 2023 20:49:46 +0100 Subject: [PATCH] HackStudio: Also ask about unsaved changes when running HackStudio now also asks about unsaved changes when trying to run, instead of only on build. --- Userland/DevTools/HackStudio/HackStudioWidget.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/DevTools/HackStudio/HackStudioWidget.cpp b/Userland/DevTools/HackStudio/HackStudioWidget.cpp index d0b70fa481..1318f63e9b 100644 --- a/Userland/DevTools/HackStudio/HackStudioWidget.cpp +++ b/Userland/DevTools/HackStudio/HackStudioWidget.cpp @@ -1323,6 +1323,9 @@ ErrorOr> HackStudioWidget::create_run_action() { auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/program-run.png"sv)); return GUI::Action::create("&Run", { Mod_Ctrl, Key_R }, icon, [this](auto&) { + if (warn_unsaved_changes("There are unsaved changes, do you want to save before running?") == ContinueDecision::No) + return; + reveal_action_tab(*m_terminal_wrapper); run(); });