diff options
author | sw1tchbl4d3 <sw1tchbl4d3@sw1tchbl4d3.com> | 2021-10-03 12:49:45 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-10-03 16:16:57 +0200 |
commit | fc2ed732df393873f9e5a28bf004a3c01d48afa8 (patch) | |
tree | f6b1b3bba842e90a2d1411aeec774c074c5c5cfc /Userland/Applications/CrashReporter | |
parent | 1bc945860de5c19cefac58b2c96a9457da50de9d (diff) | |
download | serenity-fc2ed732df393873f9e5a28bf004a3c01d48afa8.zip |
CrashReporter: Don't crash when "Generating..." Window gets closed
Diffstat (limited to 'Userland/Applications/CrashReporter')
-rw-r--r-- | Userland/Applications/CrashReporter/main.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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<GUI::Window> 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<GUI::Widget>(); main_widget.set_fill_with_background_color(true); main_widget.set_layout<GUI::VerticalBoxLayout>(); + auto& label = main_widget.add<GUI::Label>("Generating crash report..."); label.set_fixed_height(30); + auto& progressbar = main_widget.add<GUI::Progressbar>(); 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; } |