diff --git a/Userland/Applications/3DFileViewer/CMakeLists.txt b/Userland/Applications/3DFileViewer/CMakeLists.txt index 9ca95b73d3..49d8c45bf0 100644 --- a/Userland/Applications/3DFileViewer/CMakeLists.txt +++ b/Userland/Applications/3DFileViewer/CMakeLists.txt @@ -12,4 +12,4 @@ set(SOURCES ) serenity_app(3DFileViewer ICON app-3d-file-viewer) -target_link_libraries(3DFileViewer PRIVATE LibCore LibGfx LibGUI LibGL LibFileSystemAccessClient LibMain) +target_link_libraries(3DFileViewer PRIVATE LibCore LibDesktop LibGfx LibGUI LibGL LibFileSystemAccessClient LibMain) diff --git a/Userland/Applications/3DFileViewer/main.cpp b/Userland/Applications/3DFileViewer/main.cpp index a5d72cca4a..bdd94df5b5 100644 --- a/Userland/Applications/3DFileViewer/main.cpp +++ b/Userland/Applications/3DFileViewer/main.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -338,6 +339,11 @@ ErrorOr serenity_main(Main::Arguments arguments) { auto app = TRY(GUI::Application::create(arguments)); + auto const man_file = "/usr/share/man/man1/Applications/3DFileViewer.md"; + + TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme(man_file) })); + TRY(Desktop::Launcher::seal_allowlist()); + StringView filename; Core::ArgsParser args_parser; @@ -564,6 +570,9 @@ ErrorOr serenity_main(Main::Arguments arguments) auto help_menu = window->add_menu("&Help"_string); help_menu->add_action(GUI::CommonActions::make_command_palette_action(window)); + help_menu->add_action(GUI::CommonActions::make_help_action([&man_file](auto&) { + Desktop::Launcher::open(URL::create_with_file_scheme(man_file), "/bin/Help"); + })); help_menu->add_action(GUI::CommonActions::make_about_action("3D File Viewer"_string, app_icon, window)); window->show();