diff --git a/Userland/Applications/Mail/MailWidget.cpp b/Userland/Applications/Mail/MailWidget.cpp index 3a5d9636f4..996246d652 100644 --- a/Userland/Applications/Mail/MailWidget.cpp +++ b/Userland/Applications/Mail/MailWidget.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2021, Luke Wilde + * Copyright (c) 2021, Undefine * * SPDX-License-Identifier: BSD-2-Clause */ @@ -103,7 +104,9 @@ bool MailWidget::connect_and_login() auto server = Config::read_string("Mail", "Connection", "Server", {}); if (server.is_empty()) { - GUI::MessageBox::show_error(window(), "Mail has no servers configured. Refer to the Mail(1) man page for more information."); + int result = GUI::MessageBox::show(window(), "Mail has no servers configured. Do you want configure them now?", "Error", GUI::MessageBox::Type::Error, GUI::MessageBox::InputType::YesNo); + if (result == GUI::MessageBox::ExecResult::ExecYes) + Desktop::Launcher::open(URL::create_with_file_protocol("/bin/MailSettings"), "/bin/MailSettings"); return false; } diff --git a/Userland/Applications/Mail/main.cpp b/Userland/Applications/Mail/main.cpp index 9611491040..9638bf3233 100644 --- a/Userland/Applications/Mail/main.cpp +++ b/Userland/Applications/Mail/main.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2021, Luke Wilde + * Copyright (c) 2021, Undefine * * SPDX-License-Identifier: BSD-2-Clause */ @@ -7,6 +8,7 @@ #include "MailWidget.h" #include #include +#include #include #include #include @@ -26,8 +28,13 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::unveil("/etc", "r")); TRY(Core::System::unveil("/tmp/portal/webcontent", "rw")); TRY(Core::System::unveil("/tmp/portal/lookup", "rw")); + TRY(Core::System::unveil("/tmp/portal/launch", "rw")); TRY(Core::System::unveil(nullptr, nullptr)); + TRY(Desktop::Launcher::add_allowed_url(URL::create_with_file_protocol("/bin/MailSettings"))); + TRY(Desktop::Launcher::add_allowed_handler_with_any_url("/bin/MailSettings")); + TRY(Desktop::Launcher::seal_allowlist()); + auto window = GUI::Window::construct(); auto app_icon = GUI::Icon::default_icon("app-mail");