diff options
author | Brendan Coles <bcoles@gmail.com> | 2021-02-23 12:44:41 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-23 13:52:16 +0100 |
commit | 501834ba4542023fd63b1a14277b1870a4e73901 (patch) | |
tree | 4a6e1a9c1c53a8eda76ee8aa05b90ca16698396f /Userland/DevTools/Inspector | |
parent | 82278d632f4305da9867c37c2101bf99565e7172 (diff) | |
download | serenity-501834ba4542023fd63b1a14277b1870a4e73901.zip |
Inspector: Add help documentation
Diffstat (limited to 'Userland/DevTools/Inspector')
-rw-r--r-- | Userland/DevTools/Inspector/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Userland/DevTools/Inspector/main.cpp | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/Userland/DevTools/Inspector/CMakeLists.txt b/Userland/DevTools/Inspector/CMakeLists.txt index dd980cec99..e7735b5ea3 100644 --- a/Userland/DevTools/Inspector/CMakeLists.txt +++ b/Userland/DevTools/Inspector/CMakeLists.txt @@ -7,4 +7,4 @@ set(SOURCES ) serenity_app(Inspector ICON app-inspector) -target_link_libraries(Inspector LibGUI) +target_link_libraries(Inspector LibDesktop LibGUI) diff --git a/Userland/DevTools/Inspector/main.cpp b/Userland/DevTools/Inspector/main.cpp index b3234f536a..46f7e411b4 100644 --- a/Userland/DevTools/Inspector/main.cpp +++ b/Userland/DevTools/Inspector/main.cpp @@ -28,7 +28,9 @@ #include "RemoteObjectGraphModel.h" #include "RemoteObjectPropertyModel.h" #include "RemoteProcess.h" +#include <AK/URL.h> #include <LibCore/ProcessStatisticsReader.h> +#include <LibDesktop/Launcher.h> #include <LibGUI/Application.h> #include <LibGUI/BoxLayout.h> #include <LibGUI/Menu.h> @@ -101,6 +103,14 @@ int main(int argc, char** argv) auto window = GUI::Window::construct(); + if (!Desktop::Launcher::add_allowed_handler_with_only_specific_urls( + "/bin/Help", + { URL::create_with_file_protocol("/usr/share/man/man1/Inspector.md") }) + || !Desktop::Launcher::seal_allowlist()) { + warnln("Failed to set up allowed launch URLs"); + return 1; + } + auto all_processes = Core::ProcessStatisticsReader::get_all(); for (auto& it : all_processes.value()) { if (it.value.pid != pid) @@ -123,6 +133,9 @@ int main(int argc, char** argv) app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); auto& help_menu = menubar->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/Inspector.md"), "/bin/Help"); + })); help_menu.add_action(GUI::CommonActions::make_about_action("Inspector", app_icon, window)); auto& widget = window->set_main_widget<GUI::Widget>(); |