diff --git a/Userland/Applications/HexEditor/CMakeLists.txt b/Userland/Applications/HexEditor/CMakeLists.txt index c40ee14c21..014d249fec 100644 --- a/Userland/Applications/HexEditor/CMakeLists.txt +++ b/Userland/Applications/HexEditor/CMakeLists.txt @@ -21,4 +21,4 @@ set(SOURCES ) serenity_app(HexEditor ICON app-hex-editor) -target_link_libraries(HexEditor LibGUI LibConfig LibFileSystemAccessClient LibMain) +target_link_libraries(HexEditor LibGUI LibConfig LibDesktop LibFileSystemAccessClient LibMain) diff --git a/Userland/Applications/HexEditor/HexEditorWidget.cpp b/Userland/Applications/HexEditor/HexEditorWidget.cpp index b192d037e6..40465d2569 100644 --- a/Userland/Applications/HexEditor/HexEditorWidget.cpp +++ b/Userland/Applications/HexEditor/HexEditorWidget.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -468,6 +469,9 @@ void HexEditorWidget::initialize_menubar(GUI::Window& window) little_endian_mode->set_checked(true); auto& help_menu = window.add_menu("&Help"); + help_menu.add_action(GUI::CommonActions::make_help_action([](auto&) { + Desktop::Launcher::open(URL::create_with_file_protocol("/usr/share/man/man1/HexEditor.md"), "/bin/Help"); + })); help_menu.add_action(GUI::CommonActions::make_about_action("Hex Editor", GUI::Icon::default_icon("app-hex-editor"sv), &window)); } diff --git a/Userland/Applications/HexEditor/main.cpp b/Userland/Applications/HexEditor/main.cpp index d5c08380cd..8a262f8d5a 100644 --- a/Userland/Applications/HexEditor/main.cpp +++ b/Userland/Applications/HexEditor/main.cpp @@ -9,6 +9,7 @@ #include "HexEditorWidget.h" #include #include +#include #include #include #include @@ -23,6 +24,9 @@ ErrorOr serenity_main(Main::Arguments arguments) auto app = TRY(GUI::Application::try_create(arguments)); + TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_protocol("/usr/share/man/man1/HexEditor.md") })); + TRY(Desktop::Launcher::seal_allowlist()); + Config::pledge_domain("HexEditor"); auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-hex-editor"sv));