summaryrefslogtreecommitdiff
path: root/Applications/Help
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/Help
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/Help')
-rw-r--r--Applications/Help/main.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/Applications/Help/main.cpp b/Applications/Help/main.cpp
index 145fdd0acf..406bcab5d6 100644
--- a/Applications/Help/main.cpp
+++ b/Applications/Help/main.cpp
@@ -130,7 +130,7 @@ int main(int argc, char* argv[])
if (!file->open(Core::IODevice::OpenMode::ReadOnly)) {
int saved_errno = errno;
- GUI::MessageBox::show(strerror(saved_errno), "Failed to open man page", GUI::MessageBox::Type::Error, GUI::MessageBox::InputType::OK, window);
+ GUI::MessageBox::show(window, strerror(saved_errno), "Failed to open man page", GUI::MessageBox::Type::Error);
return;
}
auto buffer = file->read_all();
@@ -167,12 +167,10 @@ int main(int argc, char* argv[])
auto open_external = [&](auto& url) {
if (!Desktop::Launcher::open(url)) {
- GUI::MessageBox::show(
+ GUI::MessageBox::show(window,
String::format("The link to '%s' could not be opened.", url.to_string().characters()),
"Failed to open link",
- GUI::MessageBox::Type::Error,
- GUI::MessageBox::InputType::OK,
- window);
+ GUI::MessageBox::Type::Error);
}
};