/* * Copyright (c) 2018-2022, Andreas Kling * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include #include #include #include #include #include namespace GUI { Dialog::ExecResult MessageBox::show(Window* parent_window, StringView text, StringView title, Type type, InputType input_type) { auto box = MessageBox::construct(parent_window, text, title, type, input_type); if (parent_window) box->set_icon(parent_window->icon()); return box->exec(); } Dialog::ExecResult MessageBox::show_error(Window* parent_window, StringView text) { return show(parent_window, text, "Error"sv, GUI::MessageBox::Type::Error, GUI::MessageBox::InputType::OK); } Dialog::ExecResult MessageBox::ask_about_unsaved_changes(Window* parent_window, StringView path, Optional