summaryrefslogtreecommitdiff
path: root/Userland/Applications/MouseSettings
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-11-23 23:08:57 +0100
committerAndreas Kling <kling@serenityos.org>2021-11-24 00:25:23 +0100
commit10b539350670ddfd5dafbeb23ee1f93ca3f0fd4c (patch)
tree1337e4ea5e586c62aee6be88b3dfe251465a7b1d /Userland/Applications/MouseSettings
parent788be69bcdbc7e77f6dc693cbd9e6d910c8fa9ef (diff)
downloadserenity-10b539350670ddfd5dafbeb23ee1f93ca3f0fd4c.zip
MouseSettings: Port to LibMain :^)
Diffstat (limited to 'Userland/Applications/MouseSettings')
-rw-r--r--Userland/Applications/MouseSettings/CMakeLists.txt2
-rw-r--r--Userland/Applications/MouseSettings/main.cpp20
2 files changed, 8 insertions, 14 deletions
diff --git a/Userland/Applications/MouseSettings/CMakeLists.txt b/Userland/Applications/MouseSettings/CMakeLists.txt
index 586f5cb6ff..974f07bc02 100644
--- a/Userland/Applications/MouseSettings/CMakeLists.txt
+++ b/Userland/Applications/MouseSettings/CMakeLists.txt
@@ -19,4 +19,4 @@ set(SOURCES
)
serenity_app(MouseSettings ICON app-mouse)
-target_link_libraries(MouseSettings LibGUI)
+target_link_libraries(MouseSettings LibGUI LibMain)
diff --git a/Userland/Applications/MouseSettings/main.cpp b/Userland/Applications/MouseSettings/main.cpp
index 9a906c331c..d864582316 100644
--- a/Userland/Applications/MouseSettings/main.cpp
+++ b/Userland/Applications/MouseSettings/main.cpp
@@ -9,29 +9,23 @@
#include "MouseWidget.h"
#include "ThemeWidget.h"
-#include <LibGUI/Action.h>
+#include <LibCore/System.h>
#include <LibGUI/Application.h>
#include <LibGUI/Icon.h>
#include <LibGUI/SettingsWindow.h>
-#include <unistd.h>
+#include <LibMain/Main.h>
-int main(int argc, char** argv)
+ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- if (pledge("stdio cpath rpath recvfd sendfd unix", nullptr) < 0) {
- perror("pledge");
- return 1;
- }
+ TRY(Core::System::pledge("stdio cpath rpath recvfd sendfd unix", nullptr));
- auto app = GUI::Application::construct(argc, argv);
+ auto app = TRY(GUI::Application::try_create(arguments));
- if (pledge("stdio cpath rpath recvfd sendfd", nullptr) < 0) {
- perror("pledge");
- return 1;
- }
+ TRY(Core::System::pledge("stdio cpath rpath recvfd sendfd", nullptr));
auto app_icon = GUI::Icon::default_icon("app-mouse");
- auto window = GUI::SettingsWindow::construct("Mouse Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes);
+ auto window = TRY(GUI::SettingsWindow::try_create("Mouse Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes));
window->add_tab<MouseWidget>("Mouse");
window->add_tab<ThemeWidget>("Cursor Theme");
window->set_icon(app_icon.bitmap_for_size(16));