mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
CrashReporter: Don't crash when "Generating..." Window gets closed
This commit is contained in:
parent
1bc945860d
commit
fc2ed732df
1 changed files with 10 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue