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

SystemMenu: add Run to system menu above About

This commit is contained in:
Nick Vella 2021-01-13 23:10:31 +11:00 committed by Andreas Kling
parent 40083444a0
commit d1e3193339

View file

@ -202,6 +202,16 @@ NonnullRefPtr<GUI::Menu> build_system_menu()
} }
system_menu->add_separator(); system_menu->add_separator();
system_menu->add_action(GUI::Action::create("Run...", Gfx::Bitmap::load_from_file("/res/icons/16x16/app-run.png"), [](auto&) {
pid_t child_pid;
const char* argv[] = { "/bin/Run", nullptr };
if ((errno = posix_spawn(&child_pid, "/bin/Run", nullptr, nullptr, const_cast<char**>(argv), environ))) {
perror("posix_spawn");
} else {
if (disown(child_pid) < 0)
perror("disown");
}
}));
system_menu->add_action(GUI::Action::create("About SerenityOS", Gfx::Bitmap::load_from_file("/res/icons/16x16/ladybug.png"), [](auto&) { system_menu->add_action(GUI::Action::create("About SerenityOS", Gfx::Bitmap::load_from_file("/res/icons/16x16/ladybug.png"), [](auto&) {
pid_t child_pid; pid_t child_pid;
const char* argv[] = { "/bin/About", nullptr }; const char* argv[] = { "/bin/About", nullptr };