1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:27:34 +00:00

Userland: Use GUI::Process::spawn_or_show_error() for spawn() from a GUI

This commit is contained in:
MacDue 2022-05-11 19:41:33 +01:00 committed by Linus Groh
parent 2f2671f2d3
commit 7c8541b914
7 changed files with 39 additions and 26 deletions

View file

@ -9,12 +9,12 @@
#include <Applications/Welcome/WelcomeWindowGML.h>
#include <LibConfig/Client.h>
#include <LibCore/File.h>
#include <LibCore/Process.h>
#include <LibGUI/Application.h>
#include <LibGUI/Button.h>
#include <LibGUI/CheckBox.h>
#include <LibGUI/Label.h>
#include <LibGUI/Painter.h>
#include <LibGUI/Process.h>
#include <LibGfx/Font/BitmapFont.h>
#include <LibGfx/Palette.h>
#include <LibMarkdown/Document.h>
@ -53,8 +53,8 @@ WelcomeWidget::WelcomeWidget()
m_help_button = *find_descendant_of_type_named<GUI::Button>("help_button");
m_help_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/book-open.png").release_value_but_fixme_should_propagate_errors());
m_help_button->on_click = [](auto) {
MUST(Core::Process::spawn("/bin/Help"sv));
m_help_button->on_click = [&](auto) {
GUI::Process::spawn_or_show_error(window(), "/bin/Help"sv);
};
m_new_button = *find_descendant_of_type_named<GUI::Button>("new_button");