mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibGUI: Add GUI::MessageBox::show_error() convenience function
This is just a wrapper around show() that puts up a standard-looking error message.
This commit is contained in:
parent
7ca9259ffd
commit
14aa7f2d44
Notes:
sideshowbarker
2024-07-19 06:40:09 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/14aa7f2d44e
2 changed files with 6 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue