From c2d11d5aa0d8f7830afde9d1ec379862203f69f6 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Thu, 17 Mar 2022 23:09:34 +0000 Subject: [PATCH] Eyes: Add 'Contents' action to help menu --- Userland/Demos/Eyes/CMakeLists.txt | 2 +- Userland/Demos/Eyes/main.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Userland/Demos/Eyes/CMakeLists.txt b/Userland/Demos/Eyes/CMakeLists.txt index a8f47092e8..02a2606ba0 100644 --- a/Userland/Demos/Eyes/CMakeLists.txt +++ b/Userland/Demos/Eyes/CMakeLists.txt @@ -9,4 +9,4 @@ set(SOURCES ) serenity_app(Eyes ICON app-eyes) -target_link_libraries(Eyes LibGUI LibGfx LibMain) +target_link_libraries(Eyes LibDesktop LibGUI LibGfx LibMain) diff --git a/Userland/Demos/Eyes/main.cpp b/Userland/Demos/Eyes/main.cpp index 21a91d65b1..e308000daa 100644 --- a/Userland/Demos/Eyes/main.cpp +++ b/Userland/Demos/Eyes/main.cpp @@ -5,8 +5,10 @@ */ #include "EyesWidget.h" +#include #include #include +#include #include #include #include @@ -35,8 +37,8 @@ ErrorOr serenity_main(Main::Arguments arguments) auto app = TRY(GUI::Application::try_create(arguments)); - TRY(Core::System::pledge("stdio recvfd sendfd rpath cpath wpath thread")); TRY(Core::System::unveil("/res", "r")); + TRY(Core::System::unveil("/tmp/portal/launch", "rw")); TRY(Core::System::unveil(nullptr, nullptr)); if ((grid_rows > 0) ^ (grid_columns > 0)) { @@ -70,6 +72,9 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(file_menu->try_add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }))); auto help_menu = TRY(window->try_add_menu("&Help")); + TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) { + Desktop::Launcher::open(URL::create_with_file_protocol("/usr/share/man/man1/Eyes.md"), "/bin/Help"); + }))); TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Eyes Demo", app_icon, window))); window->show();