2021-07-30 04:03:55 +03:00
|
|
|
/*
|
2021-10-04 12:54:23 +03:00
|
|
|
* Copyright (c) 2021, the SerenityOS developers.
|
2021-11-20 17:45:57 +03:00
|
|
|
* Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
|
2021-07-30 04:03:55 +03:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
2021-11-20 17:45:57 +03:00
|
|
|
#include "MailSettingsWidget.h"
|
2021-08-28 17:04:51 +03:00
|
|
|
#include <LibConfig/Client.h>
|
2021-11-27 19:21:28 +03:00
|
|
|
#include <LibCore/System.h>
|
2021-07-30 04:03:55 +03:00
|
|
|
#include <LibGUI/Application.h>
|
|
|
|
#include <LibGUI/Icon.h>
|
2021-11-20 17:45:57 +03:00
|
|
|
#include <LibGUI/SettingsWindow.h>
|
2021-11-27 19:21:28 +03:00
|
|
|
#include <LibMain/Main.h>
|
2021-07-30 04:03:55 +03:00
|
|
|
|
2021-11-27 19:21:28 +03:00
|
|
|
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
2021-07-30 04:03:55 +03:00
|
|
|
{
|
2021-11-27 19:21:28 +03:00
|
|
|
TRY(Core::System::pledge("stdio rpath recvfd sendfd unix"));
|
2021-07-30 04:03:55 +03:00
|
|
|
|
2021-11-27 19:21:28 +03:00
|
|
|
auto app = TRY(GUI::Application::try_create(arguments));
|
2021-07-30 04:03:55 +03:00
|
|
|
|
2021-08-28 17:04:51 +03:00
|
|
|
Config::pledge_domains("Mail");
|
|
|
|
|
2021-11-27 19:21:28 +03:00
|
|
|
TRY(Core::System::pledge("stdio rpath recvfd sendfd"));
|
|
|
|
TRY(Core::System::unveil("/res", "r"));
|
|
|
|
TRY(Core::System::unveil(nullptr, nullptr));
|
2021-08-28 17:05:10 +03:00
|
|
|
|
2021-08-28 13:22:50 +03:00
|
|
|
auto app_icon = GUI::Icon::default_icon("app-mail");
|
2021-07-30 04:03:55 +03:00
|
|
|
|
2021-11-28 10:34:04 +03:00
|
|
|
auto window = TRY(GUI::SettingsWindow::create("Mail Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes));
|
2021-12-03 12:53:24 +03:00
|
|
|
(void)TRY(window->add_tab<MailSettingsWidget>("Mail"));
|
2021-07-30 04:03:55 +03:00
|
|
|
window->set_icon(app_icon.bitmap_for_size(16));
|
|
|
|
|
|
|
|
window->show();
|
|
|
|
return app->exec();
|
|
|
|
}
|