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/Applications/Terminal | |
parent | 1f82beded3ae3664265f1ddf6075f64ca5a08cde (diff) | |
download | serenity-cdffe556c8fcca034b10cf91f0b05c17d835bc7b.zip |
LibGUI+Userland: Make Dialog::ExecResult an enum class
Diffstat (limited to 'Userland/Applications/Terminal')
-rw-r--r-- | Userland/Applications/Terminal/main.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Applications/Terminal/main.cpp b/Userland/Applications/Terminal/main.cpp index e9d5635129..e133f3c00c 100644 --- a/Userland/Applications/Terminal/main.cpp +++ b/Userland/Applications/Terminal/main.cpp @@ -357,9 +357,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) return background_process_count; }; - auto check_terminal_quit = [&]() -> int { + auto check_terminal_quit = [&]() -> GUI::Dialog::ExecResult { if (!should_confirm_close) - return GUI::MessageBox::ExecOK; + return GUI::MessageBox::ExecResult::OK; Optional<String> close_message; if (tty_has_foreground_process()) { close_message = "There is still a process running in this terminal. Closing the terminal will kill it."; @@ -372,12 +372,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) } if (close_message.has_value()) return GUI::MessageBox::show(window, *close_message, "Close this terminal?", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::OKCancel); - return GUI::MessageBox::ExecOK; + return GUI::MessageBox::ExecResult::OK; }; TRY(file_menu->try_add_action(GUI::CommonActions::make_quit_action([&](auto&) { dbgln("Terminal: Quit menu activated!"); - if (check_terminal_quit() == GUI::MessageBox::ExecOK) + if (check_terminal_quit() == GUI::MessageBox::ExecResult::OK) GUI::Application::the()->quit(); }))); @@ -408,7 +408,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) }; window->on_close_request = [&]() -> GUI::Window::CloseRequestDecision { - if (check_terminal_quit() == GUI::MessageBox::ExecOK) + if (check_terminal_quit() == GUI::MessageBox::ExecResult::OK) return GUI::Window::CloseRequestDecision::Close; return GUI::Window::CloseRequestDecision::StayOpen; }; |