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

LibGUI: Remove Window::try_add_menu()

And fall back to the infallible add_menu().
This commit is contained in:
Andreas Kling 2023-08-14 10:44:42 +02:00
parent 5300896095
commit bd61e75e0b
51 changed files with 294 additions and 302 deletions

View file

@ -85,7 +85,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
GUI::MessageBox::show(settings_dialog, "Settings have been successfully saved and will take effect in the next game."sv, "Settings Changed Successfully"sv, GUI::MessageBox::Type::Information);
};
auto game_menu = TRY(window->try_add_menu("&Game"_string));
auto game_menu = window->add_menu("&Game"_string);
game_menu->add_action(GUI::Action::create("&New Game", { Mod_None, Key_F2 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/reload.png"sv)), [&](auto&) {
game.setup(player_name);
@ -98,7 +98,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
game_menu->add_separator();
game_menu->add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
auto help_menu = TRY(window->try_add_menu("&Help"_string));
auto help_menu = window->add_menu("&Help"_string);
help_menu->add_action(GUI::CommonActions::make_command_palette_action(window));
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/Hearts.md"), "/bin/Help");