diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-05-13 13:10:27 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-05-13 16:27:43 +0200 |
commit | cdffe556c8fcca034b10cf91f0b05c17d835bc7b (patch) | |
tree | 189cbd59652eee1b2783a8323a7194100c78fd07 /Userland/Games/2048 | |
parent | 1f82beded3ae3664265f1ddf6075f64ca5a08cde (diff) | |
download | serenity-cdffe556c8fcca034b10cf91f0b05c17d835bc7b.zip |
LibGUI+Userland: Make Dialog::ExecResult an enum class
Diffstat (limited to 'Userland/Games/2048')
-rw-r--r-- | Userland/Games/2048/GameSizeDialog.cpp | 4 | ||||
-rw-r--r-- | Userland/Games/2048/main.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Games/2048/GameSizeDialog.cpp b/Userland/Games/2048/GameSizeDialog.cpp index 3f4ccd3a4e..0f925ccbab 100644 --- a/Userland/Games/2048/GameSizeDialog.cpp +++ b/Userland/Games/2048/GameSizeDialog.cpp @@ -74,10 +74,10 @@ GameSizeDialog::GameSizeDialog(GUI::Window* parent, size_t board_size, size_t ta button_layout.set_spacing(10); buttonbox.add<GUI::Button>("Cancel").on_click = [this](auto) { - done(Dialog::ExecCancel); + done(ExecResult::Cancel); }; buttonbox.add<GUI::Button>("OK").on_click = [this](auto) { - done(Dialog::ExecOK); + done(ExecResult::OK); }; } diff --git a/Userland/Games/2048/main.cpp b/Userland/Games/2048/main.cpp index 3a2d65a55a..e42066ceb3 100644 --- a/Userland/Games/2048/main.cpp +++ b/Userland/Games/2048/main.cpp @@ -99,7 +99,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) auto change_settings = [&] { auto size_dialog = GameSizeDialog::construct(window, board_size, target_tile, evil_ai); - if (size_dialog->exec() || size_dialog->result() != GUI::Dialog::ExecOK) + if (size_dialog->exec() != GUI::Dialog::ExecResult::OK) return; board_size = size_dialog->board_size(); @@ -152,7 +152,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) "Congratulations!", GUI::MessageBox::Type::Question, GUI::MessageBox::InputType::YesNo); - if (want_to_continue == GUI::MessageBox::ExecYes) + if (want_to_continue == GUI::MessageBox::ExecResult::Yes) game.set_want_to_continue(); else start_a_new_game(); |