Calendar: Add a link to the Manual in Help Menu

This commit is contained in:
Mr.UNIX 2023-12-25 18:56:19 +01:00 committed by Andreas Kling
parent 863e8c30ad
commit 467faee1b8
Notes: sideshowbarker 2024-07-16 22:14:49 +09:00
3 changed files with 6 additions and 2 deletions

View file

@ -19,4 +19,4 @@ set(GENERATED_SOURCES
)
serenity_app(Calendar ICON app-calendar)
target_link_libraries(Calendar PRIVATE LibConfig LibCore LibFileSystem LibFileSystemAccessClient LibGfx LibGUI LibMain)
target_link_libraries(Calendar PRIVATE LibConfig LibCore LibFileSystem LibFileSystemAccessClient LibGfx LibGUI LibMain LibDesktop)

View file

@ -11,6 +11,7 @@
#include <Applications/Calendar/CalendarWindowGML.h>
#include <LibConfig/Client.h>
#include <LibCore/System.h>
#include <LibDesktop/Launcher.h>
#include <LibGUI/Action.h>
#include <LibGUI/ActionGroup.h>
#include <LibGUI/Application.h>
@ -105,6 +106,9 @@ ErrorOr<NonnullRefPtr<CalendarWidget>> CalendarWidget::create(GUI::Window* paren
auto help_menu = parent_window->add_menu("&Help"_string);
help_menu->add_action(GUI::CommonActions::make_command_palette_action(parent_window));
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/Calendar.md"sv), "/bin/Help");
}));
help_menu->add_action(GUI::CommonActions::make_about_action("Calendar"_string, TRY(GUI::Icon::try_create_default_icon("app-calendar"sv)), parent_window));
return widget;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "AddEventDialog.h"
#include "CalendarWidget.h"
#include <LibConfig/Client.h>
#include <LibCore/ArgsParser.h>
@ -55,6 +54,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::unveil("/res", "r"));
TRY(Core::System::unveil("/bin/CalendarSettings", "x"));
TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw"));
TRY(Core::System::unveil("/tmp/session/%sid/portal/launch", "rw"));
TRY(Core::System::unveil(nullptr, nullptr));
auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-calendar"sv));