1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 06:54:59 +00:00

LibWeb: Require parent window argument for MessageBox

Since the vast majority of message boxes should be modal, require
the parent window to be passed in, which can be nullptr for the
rare case that they don't. By it being the first argument, the
default arguments also don't need to be explicitly stated in most
cases, and it encourages passing in a parent window handle.

Fix up several message boxes that should have been modal.
This commit is contained in:
Tom 2020-07-15 20:45:11 -06:00 committed by Andreas Kling
parent 6568765e8f
commit 27bd2eab22
30 changed files with 109 additions and 135 deletions

View file

@ -153,12 +153,10 @@ void VariablesModel::set_variable_value(const GUI::ModelIndex& index, const Stri
return;
}
GUI::MessageBox::show(
GUI::MessageBox::show(parent_window,
String::format("String value \"%s\" could not be converted to a value of type %s.", string_value.to_string().characters(), variable->type_name.characters()),
"Set value failed",
GUI::MessageBox::Type::Error,
GUI::MessageBox::InputType::OK,
parent_window);
GUI::MessageBox::Type::Error);
}
GUI::Variant VariablesModel::data(const GUI::ModelIndex& index, Role role) const