Skip to content

Commit 1ac0aaa

Browse files
LucasChollettrflynn89
authored andcommitted
CrashReporter: Disable save button until it is ready to use
1 parent 01cdd3f commit 1ac0aaa

File tree

1 file changed

+2
-5
lines changed
  • Userland/Applications/CrashReporter

1 file changed

+2
-5
lines changed

Userland/Applications/CrashReporter/main.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,6 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
279279
auto& save_backtrace_button = *widget->find_descendant_of_type_named<GUI::Button>("save_backtrace_button");
280280
save_backtrace_button.set_icon(TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/save.png"sv)));
281281
save_backtrace_button.on_click = [&](auto) {
282-
if (full_backtrace.is_empty()) {
283-
GUI::MessageBox::show(window, "Backtrace has not been generated yet. Please wait..."sv, "Empty Backtrace"sv, GUI::MessageBox::Type::Error);
284-
return;
285-
}
286-
287282
LexicalPath lexical_path(DeprecatedString::formatted("{}_{}_backtrace.txt", pid, app_name));
288283
auto file_or_error = FileSystemAccessClient::Client::the().try_save_file(window, lexical_path.title(), lexical_path.extension());
289284
if (file_or_error.is_error())
@@ -293,6 +288,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
293288
if (!file->write(full_backtrace.to_deprecated_string()))
294289
GUI::MessageBox::show(window, DeprecatedString::formatted("Couldn't save file: {}.", file_or_error.error()), "Saving backtrace failed"sv, GUI::MessageBox::Type::Error);
295290
};
291+
save_backtrace_button.set_enabled(false);
296292

297293
(void)Threading::BackgroundAction<ThreadBacktracesAndCpuRegisters>::construct(
298294
[&, coredump = move(coredump)](auto&) {
@@ -340,6 +336,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
340336

341337
progressbar.set_visible(false);
342338
tab_widget.set_visible(true);
339+
save_backtrace_button.set_enabled(true);
343340
window->resize(window->width(), max(340, window->height()));
344341
window->set_progress(0);
345342
});

0 commit comments

Comments
 (0)