From fc2ed732df393873f9e5a28bf004a3c01d48afa8 Mon Sep 17 00:00:00 2001 From: sw1tchbl4d3 Date: Sun, 3 Oct 2021 12:49:45 +0200 Subject: CrashReporter: Don't crash when "Generating..." Window gets closed --- Userland/Applications/CrashReporter/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Userland/Applications/CrashReporter') diff --git a/Userland/Applications/CrashReporter/main.cpp b/Userland/Applications/CrashReporter/main.cpp index ddd72af2e2..70a103e861 100644 --- a/Userland/Applications/CrashReporter/main.cpp +++ b/Userland/Applications/CrashReporter/main.cpp @@ -41,19 +41,29 @@ struct TitleAndText { static NonnullRefPtr create_progress_window() { auto window = GUI::Window::construct(); + window->set_title("CrashReporter"); window->set_resizable(false); window->resize(240, 64); window->center_on_screen(); + auto& main_widget = window->set_main_widget(); main_widget.set_fill_with_background_color(true); main_widget.set_layout(); + auto& label = main_widget.add("Generating crash report..."); label.set_fixed_height(30); + auto& progressbar = main_widget.add(); progressbar.set_name("progressbar"); progressbar.set_fixed_width(150); progressbar.set_fixed_height(22); + + window->on_close = [&]() { + if (progressbar.value() != progressbar.max()) + exit(0); + }; + return window; } -- cgit v1.2.3