mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
Userland: Use GUI::Process::spawn_or_show_error() for spawn() from a GUI
This commit is contained in:
parent
2f2671f2d3
commit
7c8541b914
Notes:
sideshowbarker
2024-07-17 10:39:48 +09:00
Author: https://github.com/MacDue
Commit: 7c8541b914
Pull-request: https://github.com/SerenityOS/serenity/pull/13999
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/linusg
7 changed files with 39 additions and 26 deletions
|
@ -6,8 +6,8 @@
|
|||
|
||||
#include "ClockWidget.h"
|
||||
#include <LibConfig/Client.h>
|
||||
#include <LibCore/Process.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/Process.h>
|
||||
#include <LibGUI/SeparatorWidget.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibGfx/Font/FontDatabase.h>
|
||||
|
@ -153,8 +153,8 @@ ClockWidget::ClockWidget()
|
|||
m_calendar_launcher->set_fixed_size(24, 24);
|
||||
m_calendar_launcher->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-calendar.png").release_value_but_fixme_should_propagate_errors());
|
||||
m_calendar_launcher->set_tooltip("Calendar");
|
||||
m_calendar_launcher->on_click = [](auto) {
|
||||
MUST(Core::Process::spawn("/bin/Calendar"));
|
||||
m_calendar_launcher->on_click = [this](auto) {
|
||||
GUI::Process::spawn_or_show_error(window(), "/bin/Calendar");
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue