diff --git a/Libraries/LibGUI/MessageBox.cpp b/Libraries/LibGUI/MessageBox.cpp index 6ed26e12d2..fbc7f0f45b 100644 --- a/Libraries/LibGUI/MessageBox.cpp +++ b/Libraries/LibGUI/MessageBox.cpp @@ -43,6 +43,11 @@ int MessageBox::show(const StringView& text, const StringView& title, Type type, return box->exec(); } +int MessageBox::show_error(const StringView& text, Window* parent_window) +{ + return show(text, "Error", GUI::MessageBox::Type::Error, GUI::MessageBox::InputType::OK, parent_window); +} + MessageBox::MessageBox(const StringView& text, const StringView& title, Type type, InputType input_type, Window* parent_window) : Dialog(parent_window) , m_text(text) diff --git a/Libraries/LibGUI/MessageBox.h b/Libraries/LibGUI/MessageBox.h index 0d7ea6f96e..e4abdab96d 100644 --- a/Libraries/LibGUI/MessageBox.h +++ b/Libraries/LibGUI/MessageBox.h @@ -50,6 +50,7 @@ public: virtual ~MessageBox() override; static int show(const StringView& text, const StringView& title, Type type = Type::None, InputType = InputType::OK, Window* parent_window = nullptr); + static int show_error(const StringView& text, Window* parent_window = nullptr); private: explicit MessageBox(const StringView& text, const StringView& title, Type type = Type::None, InputType = InputType::OK, Window* parent_window = nullptr);