1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:48:11 +00:00

LibGUI+Userland: Make Dialog::ExecResult an enum class

This commit is contained in:
Sam Atkins 2022-05-13 13:10:27 +01:00 committed by Linus Groh
parent 1f82beded3
commit cdffe556c8
90 changed files with 232 additions and 232 deletions

View file

@ -235,7 +235,7 @@ void ChessWidget::mouseup_event(GUI::MouseEvent& event)
Chess::Move move = { m_moving_square, target_square };
if (board().is_promotion_move(move)) {
auto promotion_dialog = PromotionDialog::construct(*this);
if (promotion_dialog->exec() == PromotionDialog::ExecOK)
if (promotion_dialog->exec() == PromotionDialog::ExecResult::OK)
move.promote_to = promotion_dialog->selected_piece();
}
@ -262,7 +262,7 @@ void ChessWidget::mouseup_event(GUI::MouseEvent& event)
update();
if (GUI::MessageBox::show(window(), "50 moves have elapsed without a capture. Claim Draw?", "Claim Draw?",
GUI::MessageBox::Type::Information, GUI::MessageBox::InputType::YesNo)
== GUI::Dialog::ExecYes) {
== GUI::Dialog::ExecResult::Yes) {
msg = "Draw by 50 move rule.";
} else {
over = false;
@ -275,7 +275,7 @@ void ChessWidget::mouseup_event(GUI::MouseEvent& event)
update();
if (GUI::MessageBox::show(window(), "The same board state has repeated three times. Claim Draw?", "Claim Draw?",
GUI::MessageBox::Type::Information, GUI::MessageBox::InputType::YesNo)
== GUI::Dialog::ExecYes) {
== GUI::Dialog::ExecResult::Yes) {
msg = "Draw by threefold repetition.";
} else {
over = false;
@ -691,7 +691,7 @@ int ChessWidget::resign()
}
auto result = GUI::MessageBox::show(window(), "Are you sure you wish to resign?", "Resign", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::YesNo);
if (result != GUI::MessageBox::ExecYes)
if (result != GUI::MessageBox::ExecResult::Yes)
return -1;
board().set_resigned(m_board.turn());