main.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) 2021, the SerenityOS developers.
  3. * Copyright (c) 2021-2022, Sam Atkins <atkinssj@serenityos.org>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #include "MailSettingsWidget.h"
  8. #include <LibConfig/Client.h>
  9. #include <LibCore/System.h>
  10. #include <LibGUI/Application.h>
  11. #include <LibGUI/Icon.h>
  12. #include <LibGUI/SettingsWindow.h>
  13. #include <LibMain/Main.h>
  14. ErrorOr<int> serenity_main(Main::Arguments arguments)
  15. {
  16. TRY(Core::System::pledge("stdio rpath recvfd sendfd unix"));
  17. auto app = TRY(GUI::Application::try_create(arguments));
  18. Config::pledge_domain("Mail");
  19. TRY(Core::System::pledge("stdio rpath recvfd sendfd"));
  20. TRY(Core::System::unveil("/res", "r"));
  21. TRY(Core::System::unveil(nullptr, nullptr));
  22. auto app_icon = GUI::Icon::default_icon("app-mail");
  23. auto window = TRY(GUI::SettingsWindow::create("Mail Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes));
  24. (void)TRY(window->add_tab<MailSettingsWidget>("Mail", "mail"));
  25. window->set_icon(app_icon.bitmap_for_size(16));
  26. window->show();
  27. return app->exec();
  28. }