summaryrefslogtreecommitdiff
path: root/Applications/Browser
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2020-07-15 20:45:11 -0600
committerAndreas Kling <kling@serenityos.org>2020-07-16 16:10:21 +0200
commit27bd2eab2288c79206f3571bc2c46a20fc9a4254 (patch)
tree2391eb84dc9fc1a7be2bf1391daf13020b1e0076 /Applications/Browser
parent6568765e8f89563fa76407ce5e369ec1eb09c125 (diff)
downloadserenity-27bd2eab2288c79206f3571bc2c46a20fc9a4254.zip
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.
Diffstat (limited to 'Applications/Browser')
-rw-r--r--Applications/Browser/DownloadWidget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Applications/Browser/DownloadWidget.cpp b/Applications/Browser/DownloadWidget.cpp
index 5a4fe9a021..2a7de0e05f 100644
--- a/Applications/Browser/DownloadWidget.cpp
+++ b/Applications/Browser/DownloadWidget.cpp
@@ -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;
}