mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:27:44 +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:
parent
6568765e8f
commit
27bd2eab22
30 changed files with 109 additions and 135 deletions
|
@ -173,14 +173,14 @@ void DownloadWidget::did_finish(bool success, const ByteBuffer& payload, RefPtr<
|
|||
m_cancel_button->update();
|
||||
|
||||
if (!success) {
|
||||
GUI::MessageBox::show(String::format("Download failed for some reason"), "Download failed", GUI::MessageBox::Type::Error, GUI::MessageBox::InputType::OK, window());
|
||||
GUI::MessageBox::show(window(), String::format("Download failed for some reason"), "Download failed", GUI::MessageBox::Type::Error);
|
||||
window()->close();
|
||||
return;
|
||||
}
|
||||
|
||||
auto file_or_error = Core::File::open(m_destination_path, Core::IODevice::WriteOnly);
|
||||
if (file_or_error.is_error()) {
|
||||
GUI::MessageBox::show(String::format("Cannot open %s for writing", m_destination_path.characters()), "Download failed", GUI::MessageBox::Type::Error, GUI::MessageBox::InputType::OK, window());
|
||||
GUI::MessageBox::show(window(), String::format("Cannot open %s for writing", m_destination_path.characters()), "Download failed", GUI::MessageBox::Type::Error);
|
||||
window()->close();
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue