diff --git a/Userland/Applications/Presenter/CMakeLists.txt b/Userland/Applications/Presenter/CMakeLists.txt index 8add0c3d24..40938869ed 100644 --- a/Userland/Applications/Presenter/CMakeLists.txt +++ b/Userland/Applications/Presenter/CMakeLists.txt @@ -14,4 +14,4 @@ set(SOURCES SlideObject.cpp ) serenity_app(Presenter ICON app-presenter) -target_link_libraries(Presenter PRIVATE LibWebView LibGUI LibGfx LibFileSystemAccessClient LibCore LibMain) +target_link_libraries(Presenter PRIVATE LibWebView LibGUI LibGfx LibFileSystemAccessClient LibCore LibDesktop LibMain) diff --git a/Userland/Applications/Presenter/PresenterWidget.cpp b/Userland/Applications/Presenter/PresenterWidget.cpp index 7118b66f6e..2058f30181 100644 --- a/Userland/Applications/Presenter/PresenterWidget.cpp +++ b/Userland/Applications/Presenter/PresenterWidget.cpp @@ -8,6 +8,7 @@ #include "PresenterWidget.h" #include "Presentation.h" #include +#include #include #include #include @@ -118,6 +119,9 @@ ErrorOr PresenterWidget::initialize_menubar() update_slides_actions(); auto help_menu = window->add_menu("&Help"_string); + help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) { + Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/Presenter.md"), "/bin/Help"); + })); help_menu->add_action(GUI::CommonActions::make_about_action("Presenter"_string, GUI::Icon::default_icon("app-presenter"sv))); return {}; diff --git a/Userland/Applications/Presenter/main.cpp b/Userland/Applications/Presenter/main.cpp index d49fc9b303..228d956e25 100644 --- a/Userland/Applications/Presenter/main.cpp +++ b/Userland/Applications/Presenter/main.cpp @@ -8,6 +8,7 @@ #include "PresenterWidget.h" #include #include +#include #include #include #include @@ -24,6 +25,10 @@ ErrorOr serenity_main(Main::Arguments arguments) argument_parser.parse(arguments); auto app = TRY(GUI::Application::create(arguments)); + + TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man1/Applications/Presenter.md") })); + TRY(Desktop::Launcher::seal_allowlist()); + auto window = GUI::Window::construct(); window->set_title("Presenter"); window->set_icon(GUI::Icon::default_icon("app-presenter"sv).bitmap_for_size(16));