summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-11-27 12:49:54 +0100
committerAndreas Kling <kling@serenityos.org>2021-11-28 08:10:53 +0100
commit984cf1fe7acab8df1bf7f07bc7ae2cb2239683b4 (patch)
tree89011c259b825b49ac720e56774c9bacc5dd8dc1
parent343de29652ec5f543fb7c9adf0092c60c8e69c3f (diff)
downloadserenity-984cf1fe7acab8df1bf7f07bc7ae2cb2239683b4.zip
DisplaySettings: Port to LibMain :^)
-rw-r--r--Userland/Applications/DisplaySettings/CMakeLists.txt2
-rw-r--r--Userland/Applications/DisplaySettings/main.cpp15
2 files changed, 7 insertions, 10 deletions
diff --git a/Userland/Applications/DisplaySettings/CMakeLists.txt b/Userland/Applications/DisplaySettings/CMakeLists.txt
index 457e70d4be..c1ab36a1c2 100644
--- a/Userland/Applications/DisplaySettings/CMakeLists.txt
+++ b/Userland/Applications/DisplaySettings/CMakeLists.txt
@@ -23,4 +23,4 @@ set(SOURCES
)
serenity_app(DisplaySettings ICON app-display-settings)
-target_link_libraries(DisplaySettings LibDesktop LibGUI LibConfig)
+target_link_libraries(DisplaySettings LibDesktop LibGUI LibConfig LibMain)
diff --git a/Userland/Applications/DisplaySettings/main.cpp b/Userland/Applications/DisplaySettings/main.cpp
index d42a07cdbf..fbfd8490b2 100644
--- a/Userland/Applications/DisplaySettings/main.cpp
+++ b/Userland/Applications/DisplaySettings/main.cpp
@@ -11,25 +11,22 @@
#include "FontSettingsWidget.h"
#include "MonitorSettingsWidget.h"
#include <LibConfig/Client.h>
+#include <LibCore/System.h>
#include <LibGUI/Application.h>
#include <LibGUI/Icon.h>
#include <LibGUI/SettingsWindow.h>
-#include <stdio.h>
-#include <unistd.h>
+#include <LibMain/Main.h>
-int main(int argc, char** argv)
+ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- if (pledge("stdio thread recvfd sendfd rpath cpath wpath unix", nullptr) < 0) {
- perror("pledge");
- return 1;
- }
+ TRY(Core::System::pledge("stdio thread recvfd sendfd rpath cpath wpath unix"));
- auto app = GUI::Application::construct(argc, argv);
+ auto app = TRY(GUI::Application::try_create(arguments));
Config::pledge_domains("WindowManager");
auto app_icon = GUI::Icon::default_icon("app-display-settings");
- auto window = GUI::SettingsWindow::construct("Display Settings");
+ auto window = TRY(GUI::SettingsWindow::try_create("Display Settings"));
window->add_tab<DisplaySettings::BackgroundSettingsWidget>("Background");
window->add_tab<DisplaySettings::FontSettingsWidget>("Fonts");
window->add_tab<DisplaySettings::MonitorSettingsWidget>("Monitor");