summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarol Kosek <krkk@serenityos.org>2023-04-16 11:56:01 +0200
committerAndreas Kling <kling@serenityos.org>2023-04-19 07:59:54 +0200
commit969543a847c7792cb5ebe967c44b744bc24fb2cb (patch)
tree1c5ee0e5040655c0783bc4940d158af192e5c755
parent60a338758ce1b8bcf09f00cc9ba4694348292a91 (diff)
downloadserenity-969543a847c7792cb5ebe967c44b744bc24fb2cb.zip
LibGUI+Userland: Make Window::*add_menu take name using new string
-rw-r--r--Userland/Applications/3DFileViewer/main.cpp8
-rw-r--r--Userland/Applications/Browser/BrowserWindow.cpp14
-rw-r--r--Userland/Applications/Calculator/main.cpp10
-rw-r--r--Userland/Applications/Calendar/main.cpp6
-rw-r--r--Userland/Applications/CharacterMap/CharacterMapWidget.cpp4
-rw-r--r--Userland/Applications/FileManager/main.cpp10
-rw-r--r--Userland/Applications/FontEditor/MainWidget.cpp10
-rw-r--r--Userland/Applications/Help/MainWidget.cpp6
-rw-r--r--Userland/Applications/HexEditor/HexEditorWidget.cpp8
-rw-r--r--Userland/Applications/ImageViewer/main.cpp10
-rw-r--r--Userland/Applications/KeyboardMapper/main.cpp6
-rw-r--r--Userland/Applications/Magnifier/main.cpp8
-rw-r--r--Userland/Applications/Mail/main.cpp4
-rw-r--r--Userland/Applications/PDFViewer/PDFViewerWidget.cpp6
-rw-r--r--Userland/Applications/PartitionEditor/main.cpp4
-rw-r--r--Userland/Applications/Piano/main.cpp6
-rw-r--r--Userland/Applications/PixelPaint/MainWidget.cpp16
-rw-r--r--Userland/Applications/Presenter/PresenterWidget.cpp8
-rw-r--r--Userland/Applications/Settings/main.cpp4
-rw-r--r--Userland/Applications/SoundPlayer/main.cpp8
-rw-r--r--Userland/Applications/SpaceAnalyzer/main.cpp4
-rw-r--r--Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp6
-rw-r--r--Userland/Applications/SystemMonitor/main.cpp6
-rw-r--r--Userland/Applications/Terminal/main.cpp8
-rw-r--r--Userland/Applications/TextEditor/MainWidget.cpp8
-rw-r--r--Userland/Applications/ThemeEditor/MainWidget.cpp4
-rw-r--r--Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp8
-rw-r--r--Userland/Demos/Eyes/main.cpp4
-rw-r--r--Userland/Demos/LibGfxDemo/main.cpp2
-rw-r--r--Userland/Demos/LibGfxScaleDemo/main.cpp2
-rw-r--r--Userland/Demos/Mandelbrot/Mandelbrot.cpp6
-rw-r--r--Userland/Demos/Screensaver/main.cpp4
-rw-r--r--Userland/DevTools/GMLPlayground/main.cpp8
-rw-r--r--Userland/DevTools/HackStudio/HackStudioWidget.cpp10
-rw-r--r--Userland/DevTools/Inspector/main.cpp4
-rw-r--r--Userland/DevTools/Profiler/main.cpp6
-rw-r--r--Userland/DevTools/SQLStudio/MainWidget.cpp6
-rw-r--r--Userland/Games/2048/main.cpp4
-rw-r--r--Userland/Games/BrickGame/main.cpp4
-rw-r--r--Userland/Games/Chess/main.cpp6
-rw-r--r--Userland/Games/ColorLines/main.cpp4
-rw-r--r--Userland/Games/FlappyBug/main.cpp4
-rw-r--r--Userland/Games/Flood/main.cpp4
-rw-r--r--Userland/Games/GameOfLife/main.cpp4
-rw-r--r--Userland/Games/Hearts/main.cpp4
-rw-r--r--Userland/Games/MasterWord/main.cpp8
-rw-r--r--Userland/Games/Minesweeper/main.cpp6
-rw-r--r--Userland/Games/Snake/main.cpp4
-rw-r--r--Userland/Games/Solitaire/main.cpp4
-rw-r--r--Userland/Games/Spider/main.cpp6
-rw-r--r--Userland/Libraries/LibGUI/Window.cpp6
-rw-r--r--Userland/Libraries/LibGUI/Window.h4
52 files changed, 162 insertions, 162 deletions
diff --git a/Userland/Applications/3DFileViewer/main.cpp b/Userland/Applications/3DFileViewer/main.cpp
index 59fc2b8e48..5cced716e0 100644
--- a/Userland/Applications/3DFileViewer/main.cpp
+++ b/Userland/Applications/3DFileViewer/main.cpp
@@ -375,7 +375,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
time.set_x(widget->width() - time.width() - 6);
widget->set_stat_label(time);
- auto& file_menu = window->add_menu("&File");
+ auto& file_menu = window->add_menu("&File"_short_string);
file_menu.add_action(GUI::CommonActions::make_open_action([&](auto&) {
auto response = FileSystemAccessClient::Client::the().open_file(window);
@@ -390,7 +390,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
app->quit();
}));
- auto& view_menu = window->add_menu("&View");
+ auto& view_menu = window->add_menu("&View"_short_string);
view_menu.add_action(GUI::CommonActions::make_fullscreen_action([&](auto&) {
window->set_fullscreen(!window->is_fullscreen());
}));
@@ -448,7 +448,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
view_menu.add_action(*show_frame_rate_action);
- auto& texture_menu = window->add_menu("&Texture");
+ auto& texture_menu = window->add_menu(TRY("&Texture"_string));
auto texture_enabled_action = GUI::Action::create_checkable("&Enable Texture", [&widget](auto& action) {
widget->set_texture_enabled(action.is_checked());
@@ -562,7 +562,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
texture_mag_filter_nearest_action->set_checked(true);
- auto& help_menu = window->add_menu("&Help");
+ auto& help_menu = window->add_menu("&Help"_short_string);
help_menu.add_action(GUI::CommonActions::make_command_palette_action(window));
help_menu.add_action(GUI::CommonActions::make_about_action("3D File Viewer", app_icon, window));
diff --git a/Userland/Applications/Browser/BrowserWindow.cpp b/Userland/Applications/Browser/BrowserWindow.cpp
index 53c0e4d97c..57b24a4454 100644
--- a/Userland/Applications/Browser/BrowserWindow.cpp
+++ b/Userland/Applications/Browser/BrowserWindow.cpp
@@ -154,7 +154,7 @@ BrowserWindow::BrowserWindow(CookieJar& cookie_jar, URL url)
void BrowserWindow::build_menus()
{
- auto& file_menu = add_menu("&File");
+ auto& file_menu = add_menu("&File"_short_string);
file_menu.add_action(WindowActions::the().create_new_tab_action());
file_menu.add_action(WindowActions::the().create_new_window_action());
@@ -169,7 +169,7 @@ void BrowserWindow::build_menus()
GUI::Application::the()->quit();
}));
- auto& view_menu = add_menu("&View");
+ auto& view_menu = add_menu("&View"_short_string);
view_menu.add_action(WindowActions::the().show_bookmarks_bar_action());
view_menu.add_action(WindowActions::the().vertical_tabs_action());
view_menu.add_separator();
@@ -221,7 +221,7 @@ void BrowserWindow::build_menus()
m_reload_action = GUI::CommonActions::make_reload_action([this](auto&) { active_tab().reload(); }, this);
m_reload_action->set_status_tip("Reload current page");
- auto& go_menu = add_menu("&Go");
+ auto& go_menu = add_menu("&Go"_short_string);
go_menu.add_action(*m_go_back_action);
go_menu.add_action(*m_go_forward_action);
go_menu.add_action(*m_go_home_action);
@@ -276,7 +276,7 @@ void BrowserWindow::build_menus()
this);
m_take_full_screenshot_action->set_status_tip("Save a screenshot of the entirety of the current tab to the Downloads directory"sv);
- auto& inspect_menu = add_menu("&Inspect");
+ auto& inspect_menu = add_menu("&Inspect"_string.release_value_but_fixme_should_propagate_errors());
inspect_menu.add_action(*m_view_source_action);
inspect_menu.add_action(*m_inspect_dom_tree_action);
@@ -304,7 +304,7 @@ void BrowserWindow::build_menus()
storage_window_action->set_status_tip("Show History inspector for this tab");
inspect_menu.add_action(history_window_action);
- auto& settings_menu = add_menu("&Settings");
+ auto& settings_menu = add_menu("&Settings"_string.release_value_but_fixme_should_propagate_errors());
m_change_homepage_action = GUI::Action::create(
"Set Homepage URL...", g_icon_bag.go_home, [this](auto&) {
@@ -358,7 +358,7 @@ void BrowserWindow::build_menus()
});
settings_menu.add_action(move(open_settings_action));
- auto& debug_menu = add_menu("&Debug");
+ auto& debug_menu = add_menu("&Debug"_short_string);
debug_menu.add_action(GUI::Action::create(
"Dump &DOM Tree", g_icon_bag.dom_tree, [this](auto&) {
active_tab().view().debug_request("dump-dom-tree");
@@ -475,7 +475,7 @@ void BrowserWindow::build_menus()
same_origin_policy_action->set_checked(false);
debug_menu.add_action(same_origin_policy_action);
- auto& help_menu = add_menu("&Help");
+ auto& help_menu = add_menu("&Help"_short_string);
help_menu.add_action(GUI::CommonActions::make_command_palette_action(this));
help_menu.add_action(WindowActions::the().about_action());
}
diff --git a/Userland/Applications/Calculator/main.cpp b/Userland/Applications/Calculator/main.cpp
index f299edb7ce..13e19e4add 100644
--- a/Userland/Applications/Calculator/main.cpp
+++ b/Userland/Applications/Calculator/main.cpp
@@ -39,12 +39,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->set_icon(app_icon.bitmap_for_size(16));
- auto& file_menu = window->add_menu("&File");
+ auto& file_menu = window->add_menu("&File"_short_string);
file_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
GUI::Application::the()->quit();
}));
- auto& edit_menu = window->add_menu("&Edit");
+ auto& edit_menu = window->add_menu("&Edit"_short_string);
edit_menu.add_action(GUI::CommonActions::make_copy_action([&](auto&) {
GUI::Clipboard::the().set_plain_text(widget->get_entry());
}));
@@ -58,7 +58,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
}
}));
- auto& constants_menu = window->add_menu("&Constants");
+ auto& constants_menu = window->add_menu(TRY("&Constants"_string));
auto const power = Crypto::NumberTheory::Power("10"_bigint, "10"_bigint);
constants_menu.add_action(GUI::Action::create("&Pi", TRY(Gfx::Bitmap::load_from_file("/res/icons/calculator/pi.png"sv)), [&](auto&) {
@@ -71,7 +71,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
widget->set_typed_entry(Crypto::BigFraction { Crypto::SignedBigInteger(16180339887), power });
}));
- auto& round_menu = window->add_menu("&Round");
+ auto& round_menu = window->add_menu("&Round"_short_string);
GUI::ActionGroup preview_actions;
static constexpr auto rounding_modes = Array { 0, 2, 4 };
@@ -121,7 +121,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
round_menu.action_at(last_rounding_mode.value())->activate();
- auto& help_menu = window->add_menu("&Help");
+ auto& help_menu = window->add_menu("&Help"_short_string);
help_menu.add_action(GUI::CommonActions::make_command_palette_action(window));
help_menu.add_action(GUI::CommonActions::make_about_action("Calculator", app_icon, window));
diff --git a/Userland/Applications/Calendar/main.cpp b/Userland/Applications/Calendar/main.cpp
index 8fe3886026..7b4d9afd6c 100644
--- a/Userland/Applications/Calendar/main.cpp
+++ b/Userland/Applications/Calendar/main.cpp
@@ -128,7 +128,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
view_month_action->set_checked(true);
};
- auto& file_menu = window->add_menu("&File");
+ auto& file_menu = window->add_menu("&File"_short_string);
file_menu.add_action(GUI::Action::create("&Add Event", { Mod_Ctrl | Mod_Shift, Key_E }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/add-event.png"sv)),
[&](const GUI::Action&) {
AddEventDialog::show(calendar->selected_date(), window);
@@ -141,11 +141,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
GUI::Application::the()->quit();
})));
- auto view_menu = TRY(window->try_add_menu("&View"));
+ auto view_menu = TRY(window->try_add_menu("&View"_short_string));
TRY(view_menu->try_add_action(*view_month_action));
TRY(view_menu->try_add_action(*view_year_action));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Calendar", app_icon, window)));
diff --git a/Userland/Applications/CharacterMap/CharacterMapWidget.cpp b/Userland/Applications/CharacterMap/CharacterMapWidget.cpp
index 59c80781ee..13a625a5d6 100644
--- a/Userland/Applications/CharacterMap/CharacterMapWidget.cpp
+++ b/Userland/Applications/CharacterMap/CharacterMapWidget.cpp
@@ -151,12 +151,12 @@ CharacterMapWidget::CharacterMapWidget()
void CharacterMapWidget::initialize_menubar(GUI::Window& window)
{
- auto& file_menu = window.add_menu("&File");
+ auto& file_menu = window.add_menu("&File"_short_string);
file_menu.add_action(GUI::CommonActions::make_quit_action([](GUI::Action&) {
GUI::Application::the()->quit();
}));
- auto& help_menu = window.add_menu("&Help");
+ auto& help_menu = window.add_menu("&Help"_short_string);
help_menu.add_action(GUI::CommonActions::make_command_palette_action(&window));
help_menu.add_action(GUI::CommonActions::make_help_action([&](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/CharacterMap.md"), "/bin/Help");
diff --git a/Userland/Applications/FileManager/main.cpp b/Userland/Applications/FileManager/main.cpp
index 9791fcf85d..b3c18edc4a 100644
--- a/Userland/Applications/FileManager/main.cpp
+++ b/Userland/Applications/FileManager/main.cpp
@@ -998,7 +998,7 @@ ErrorOr<int> run_in_windowed_mode(DeprecatedString const& initial_location, Depr
refresh_tree_view();
});
- auto file_menu = TRY(window->try_add_menu("&File"));
+ auto file_menu = TRY(window->try_add_menu("&File"_short_string));
TRY(file_menu->try_add_action(mkdir_action));
TRY(file_menu->try_add_action(touch_action));
TRY(file_menu->try_add_action(focus_dependent_delete_action));
@@ -1010,7 +1010,7 @@ ErrorOr<int> run_in_windowed_mode(DeprecatedString const& initial_location, Depr
GUI::Application::the()->quit();
})));
- auto edit_menu = TRY(window->try_add_menu("&Edit"));
+ auto edit_menu = TRY(window->try_add_menu("&Edit"_short_string));
TRY(edit_menu->try_add_action(cut_action));
TRY(edit_menu->try_add_action(copy_action));
TRY(edit_menu->try_add_action(paste_action));
@@ -1033,7 +1033,7 @@ ErrorOr<int> run_in_windowed_mode(DeprecatedString const& initial_location, Depr
show_dotfiles_action->set_checked(show_dotfiles);
show_dotfiles_in_view(show_dotfiles);
- auto view_menu = TRY(window->try_add_menu("&View"));
+ auto view_menu = TRY(window->try_add_menu("&View"_short_string));
auto layout_menu = TRY(view_menu->try_add_submenu("&Layout"));
TRY(layout_menu->try_add_action(*layout_toolbar_action));
TRY(layout_menu->try_add_action(*layout_location_action));
@@ -1054,7 +1054,7 @@ ErrorOr<int> run_in_windowed_mode(DeprecatedString const& initial_location, Depr
breadcrumbbar.show_location_text_box();
});
- auto go_menu = TRY(window->try_add_menu("&Go"));
+ auto go_menu = TRY(window->try_add_menu("&Go"_short_string));
TRY(go_menu->try_add_action(go_back_action));
TRY(go_menu->try_add_action(go_forward_action));
TRY(go_menu->try_add_action(open_parent_directory_action));
@@ -1064,7 +1064,7 @@ ErrorOr<int> run_in_windowed_mode(DeprecatedString const& initial_location, Depr
TRY(go_menu->try_add_separator());
TRY(go_menu->try_add_action(directory_view->open_terminal_action()));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("File Manager"sv, GUI::Icon::default_icon("app-file-manager"sv), window)));
diff --git a/Userland/Applications/FontEditor/MainWidget.cpp b/Userland/Applications/FontEditor/MainWidget.cpp
index 135a34aafb..d1a0d0dc13 100644
--- a/Userland/Applications/FontEditor/MainWidget.cpp
+++ b/Userland/Applications/FontEditor/MainWidget.cpp
@@ -664,7 +664,7 @@ ErrorOr<void> MainWidget::initialize(DeprecatedString const& path, RefPtr<Gfx::B
ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
{
- auto file_menu = TRY(window.try_add_menu("&File"));
+ auto file_menu = TRY(window.try_add_menu("&File"_short_string));
TRY(file_menu->try_add_action(*m_new_action));
TRY(file_menu->try_add_action(*m_open_action));
TRY(file_menu->try_add_action(*m_save_action));
@@ -676,7 +676,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
GUI::Application::the()->quit();
})));
- auto edit_menu = TRY(window.try_add_menu("&Edit"));
+ auto edit_menu = TRY(window.try_add_menu("&Edit"_short_string));
TRY(edit_menu->try_add_action(*m_undo_action));
TRY(edit_menu->try_add_action(*m_redo_action));
TRY(edit_menu->try_add_separator());
@@ -691,12 +691,12 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
m_context_menu = edit_menu;
- auto go_menu = TRY(window.try_add_menu("&Go"));
+ auto go_menu = TRY(window.try_add_menu("&Go"_short_string));
TRY(go_menu->try_add_action(*m_previous_glyph_action));
TRY(go_menu->try_add_action(*m_next_glyph_action));
TRY(go_menu->try_add_action(*m_go_to_glyph_action));
- auto view_menu = TRY(window.try_add_menu("&View"));
+ auto view_menu = TRY(window.try_add_menu("&View"_short_string));
auto layout_menu = TRY(view_menu->try_add_submenu("&Layout"));
TRY(layout_menu->try_add_action(*m_show_toolbar_action));
TRY(layout_menu->try_add_action(*m_show_statusbar_action));
@@ -714,7 +714,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
TRY(scale_menu->try_add_action(*m_scale_ten_action));
TRY(scale_menu->try_add_action(*m_scale_fifteen_action));
- auto help_menu = TRY(window.try_add_menu("&Help"));
+ auto help_menu = TRY(window.try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(&window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/FontEditor.md"), "/bin/Help");
diff --git a/Userland/Applications/Help/MainWidget.cpp b/Userland/Applications/Help/MainWidget.cpp
index 23f4bcb15c..6dcd055880 100644
--- a/Userland/Applications/Help/MainWidget.cpp
+++ b/Userland/Applications/Help/MainWidget.cpp
@@ -202,17 +202,17 @@ ErrorOr<void> MainWidget::initialize_fallibles(GUI::Window& window)
(void)TRY(m_toolbar->try_add_action(*m_go_forward_action));
(void)TRY(m_toolbar->try_add_action(*m_go_home_action));
- auto file_menu = TRY(window.try_add_menu("&File"));
+ auto file_menu = TRY(window.try_add_menu("&File"_short_string));
TRY(file_menu->try_add_action(GUI::CommonActions::make_quit_action([](auto&) {
GUI::Application::the()->quit();
})));
- auto go_menu = TRY(window.try_add_menu("&Go"));
+ auto go_menu = TRY(window.try_add_menu("&Go"_short_string));
TRY(go_menu->try_add_action(*m_go_back_action));
TRY(go_menu->try_add_action(*m_go_forward_action));
TRY(go_menu->try_add_action(*m_go_home_action));
- auto help_menu = TRY(window.try_add_menu("&Help"));
+ auto help_menu = TRY(window.try_add_menu("&Help"_short_string));
String help_page_path = TRY(TRY(try_make_ref_counted<Manual::PageNode>(Manual::sections[1 - 1], TRY("Help"_string)))->path());
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(&window)));
TRY(help_menu->try_add_action(GUI::Action::create("&Contents", { Key_F1 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-unknown.png"sv)), [this, help_page_path = move(help_page_path)](auto&) {
diff --git a/Userland/Applications/HexEditor/HexEditorWidget.cpp b/Userland/Applications/HexEditor/HexEditorWidget.cpp
index 712db290a5..111312df1a 100644
--- a/Userland/Applications/HexEditor/HexEditorWidget.cpp
+++ b/Userland/Applications/HexEditor/HexEditorWidget.cpp
@@ -403,7 +403,7 @@ void HexEditorWidget::update_inspector_values(size_t position)
void HexEditorWidget::initialize_menubar(GUI::Window& window)
{
- auto& file_menu = window.add_menu("&File");
+ auto& file_menu = window.add_menu("&File"_short_string);
file_menu.add_action(*m_new_action);
file_menu.add_action(*m_open_action);
file_menu.add_action(*m_save_action);
@@ -415,7 +415,7 @@ void HexEditorWidget::initialize_menubar(GUI::Window& window)
GUI::Application::the()->quit();
}));
- auto& edit_menu = window.add_menu("&Edit");
+ auto& edit_menu = window.add_menu("&Edit"_short_string);
edit_menu.add_action(*m_undo_action);
edit_menu.add_action(*m_redo_action);
edit_menu.add_separator();
@@ -462,7 +462,7 @@ void HexEditorWidget::initialize_menubar(GUI::Window& window)
edit_menu.add_separator();
edit_menu.add_action(*m_goto_offset_action);
- auto& view_menu = window.add_menu("&View");
+ auto& view_menu = window.add_menu("&View"_short_string);
auto show_toolbar = Config::read_bool("HexEditor"sv, "Layout"sv, "ShowToolbar"sv, true);
m_layout_toolbar_action->set_checked(show_toolbar);
@@ -509,7 +509,7 @@ void HexEditorWidget::initialize_menubar(GUI::Window& window)
// Default to little endian mode
little_endian_mode->set_checked(true);
- auto& help_menu = window.add_menu("&Help");
+ auto& help_menu = window.add_menu("&Help"_short_string);
help_menu.add_action(GUI::CommonActions::make_command_palette_action(&window));
help_menu.add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/HexEditor.md"), "/bin/Help");
diff --git a/Userland/Applications/ImageViewer/main.cpp b/Userland/Applications/ImageViewer/main.cpp
index 97376771dd..b60e31de43 100644
--- a/Userland/Applications/ImageViewer/main.cpp
+++ b/Userland/Applications/ImageViewer/main.cpp
@@ -297,7 +297,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
(void)TRY(main_toolbar->try_add_action(reset_zoom_action));
(void)TRY(main_toolbar->try_add_action(zoom_out_action));
- auto file_menu = TRY(window->try_add_menu("&File"));
+ auto file_menu = TRY(window->try_add_menu("&File"_short_string));
TRY(file_menu->try_add_action(open_action));
TRY(file_menu->try_add_action(delete_action));
TRY(file_menu->try_add_separator());
@@ -314,7 +314,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(file_menu->try_add_action(quit_action));
- auto image_menu = TRY(window->try_add_menu("&Image"));
+ auto image_menu = TRY(window->try_add_menu("&Image"_short_string));
TRY(image_menu->try_add_action(rotate_counterclockwise_action));
TRY(image_menu->try_add_action(rotate_clockwise_action));
TRY(image_menu->try_add_action(vertical_flip_action));
@@ -322,13 +322,13 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(image_menu->try_add_separator());
TRY(image_menu->try_add_action(desktop_wallpaper_action));
- auto navigate_menu = TRY(window->try_add_menu("&Navigate"));
+ auto navigate_menu = TRY(window->try_add_menu(TRY("&Navigate"_string)));
TRY(navigate_menu->try_add_action(go_first_action));
TRY(navigate_menu->try_add_action(go_back_action));
TRY(navigate_menu->try_add_action(go_forward_action));
TRY(navigate_menu->try_add_action(go_last_action));
- auto view_menu = TRY(window->try_add_menu("&View"));
+ auto view_menu = TRY(window->try_add_menu("&View"_short_string));
TRY(view_menu->try_add_action(full_screen_action));
TRY(view_menu->try_add_separator());
TRY(view_menu->try_add_action(zoom_in_action));
@@ -353,7 +353,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(view_menu->try_add_separator());
TRY(view_menu->try_add_action(hide_show_toolbar_action));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/ImageViewer.md"), "/bin/Help");
diff --git a/Userland/Applications/KeyboardMapper/main.cpp b/Userland/Applications/KeyboardMapper/main.cpp
index 015e0270a2..22f4a75c5c 100644
--- a/Userland/Applications/KeyboardMapper/main.cpp
+++ b/Userland/Applications/KeyboardMapper/main.cpp
@@ -86,17 +86,17 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto_modifier_action->set_checkable(true);
auto_modifier_action->set_checked(false);
- auto& file_menu = window->add_menu("&File");
+ auto& file_menu = window->add_menu("&File"_short_string);
file_menu.add_action(open_action);
file_menu.add_action(save_action);
file_menu.add_action(save_as_action);
file_menu.add_separator();
file_menu.add_action(quit_action);
- auto& settings_menu = window->add_menu("&Settings");
+ auto& settings_menu = window->add_menu(TRY("&Settings"_string));
settings_menu.add_action(auto_modifier_action);
- auto& help_menu = window->add_menu("&Help");
+ auto& help_menu = window->add_menu("&Help"_short_string);
help_menu.add_action(GUI::CommonActions::make_command_palette_action(window));
help_menu.add_action(GUI::CommonActions::make_about_action("Keyboard Mapper", app_icon, window));
diff --git a/Userland/Applications/Magnifier/main.cpp b/Userland/Applications/Magnifier/main.cpp
index 19138489e6..40e8aa099e 100644
--- a/Userland/Applications/Magnifier/main.cpp
+++ b/Userland/Applications/Magnifier/main.cpp
@@ -61,7 +61,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->set_icon(app_icon.bitmap_for_size(16));
auto magnifier = TRY(window->set_main_widget<MagnifierWidget>());
- auto file_menu = TRY(window->try_add_menu("&File"));
+ auto file_menu = TRY(window->try_add_menu("&File"_short_string));
TRY(file_menu->try_add_action(GUI::CommonActions::make_save_as_action([&](auto&) {
AK::DeprecatedString filename = "file for saving";
auto do_save = [&]() -> ErrorOr<void> {
@@ -140,7 +140,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
size_action_group->add_action(eight_x_action);
size_action_group->set_exclusive(true);
- auto view_menu = TRY(window->try_add_menu("&View"));
+ auto view_menu = TRY(window->try_add_menu("&View"_short_string));
TRY(view_menu->try_add_action(two_x_action));
TRY(view_menu->try_add_action(four_x_action));
TRY(view_menu->try_add_action(eight_x_action));
@@ -152,7 +152,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(view_menu->try_add_action(show_grid_action));
TRY(view_menu->try_add_action(choose_grid_color_action));
- auto timeline_menu = TRY(window->try_add_menu("&Timeline"));
+ auto timeline_menu = TRY(window->try_add_menu(TRY("&Timeline"_string)));
auto previous_frame_action = GUI::Action::create(
"&Previous frame", { Key_Left }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-back.png"sv)), [&](auto&) {
pause_action->set_checked(true);
@@ -170,7 +170,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(window->try_add_menu(TRY(GUI::CommonMenus::make_accessibility_menu(magnifier))));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Magnifier.md"), "/bin/Help");
diff --git a/Userland/Applications/Mail/main.cpp b/Userland/Applications/Mail/main.cpp
index 9ab66d589c..123d789a4b 100644
--- a/Userland/Applications/Mail/main.cpp
+++ b/Userland/Applications/Mail/main.cpp
@@ -45,14 +45,14 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->set_title("Mail");
window->resize(640, 400);
- auto& file_menu = window->add_menu("&File");
+ auto& file_menu = window->add_menu("&File"_short_string);
file_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) {
mail_widget->on_window_close();
app->quit();
}));
- auto& help_menu = window->add_menu("&Help");
+ auto& help_menu = window->add_menu("&Help"_short_string);
help_menu.add_action(GUI::CommonActions::make_command_palette_action(window));
help_menu.add_action(GUI::CommonActions::make_about_action("Mail", app_icon, window));
diff --git a/Userland/Applications/PDFViewer/PDFViewerWidget.cpp b/Userland/Applications/PDFViewer/PDFViewerWidget.cpp
index b5a316121e..54ac99dd69 100644
--- a/Userland/Applications/PDFViewer/PDFViewerWidget.cpp
+++ b/Userland/Applications/PDFViewer/PDFViewerWidget.cpp
@@ -208,7 +208,7 @@ PDFViewerWidget::PDFViewerWidget()
void PDFViewerWidget::initialize_menubar(GUI::Window& window)
{
- auto& file_menu = window.add_menu("&File");
+ auto& file_menu = window.add_menu("&File"_short_string);
file_menu.add_action(GUI::CommonActions::make_open_action([&](auto&) {
auto response = FileSystemAccessClient::Client::the().open_file(&window);
if (!response.is_error())
@@ -225,7 +225,7 @@ void PDFViewerWidget::initialize_menubar(GUI::Window& window)
GUI::Application::the()->quit();
}));
- auto& view_menu = window.add_menu("&View");
+ auto& view_menu = window.add_menu("&View"_short_string);
view_menu.add_action(*m_toggle_sidebar_action);
view_menu.add_separator();
auto& view_mode_menu = view_menu.add_submenu("View &Mode");
@@ -236,7 +236,7 @@ void PDFViewerWidget::initialize_menubar(GUI::Window& window)
view_menu.add_action(*m_zoom_out_action);
view_menu.add_action(*m_reset_zoom_action);
- auto& help_menu = window.add_menu("&Help");
+ auto& help_menu = window.add_menu("&Help"_short_string);
help_menu.add_action(GUI::CommonActions::make_command_palette_action(&window));
help_menu.add_action(GUI::CommonActions::make_about_action("PDF Viewer", GUI::Icon::default_icon("app-pdf-viewer"sv), &window));
}
diff --git a/Userland/Applications/PartitionEditor/main.cpp b/Userland/Applications/PartitionEditor/main.cpp
index 202726fe59..5316366750 100644
--- a/Userland/Applications/PartitionEditor/main.cpp
+++ b/Userland/Applications/PartitionEditor/main.cpp
@@ -80,12 +80,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
partition_table_view.set_model(partition_model);
partition_table_view.set_focus(true);
- auto& file_menu = window->add_menu("&File");
+ auto& file_menu = window->add_menu("&File"_short_string);
file_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) {
app->quit();
}));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Partition Editor", app_icon, window)));
diff --git a/Userland/Applications/Piano/main.cpp b/Userland/Applications/Piano/main.cpp
index ac15d9a81c..b3f386cbfa 100644
--- a/Userland/Applications/Piano/main.cpp
+++ b/Userland/Applications/Piano/main.cpp
@@ -58,7 +58,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
}));
main_widget_updater->start();
- auto file_menu = TRY(window->try_add_menu("&File"));
+ auto file_menu = TRY(window->try_add_menu("&File"_short_string));
TRY(file_menu->try_add_action(GUI::Action::create("Export", { Mod_Ctrl, Key_E }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/file-export.png"sv)), [&](const GUI::Action&) {
save_path = GUI::FilePicker::get_save_filepath(window, "Untitled", "wav");
if (!save_path.has_value())
@@ -83,10 +83,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
return;
})));
- auto edit_menu = TRY(window->try_add_menu("&Edit"));
+ auto edit_menu = TRY(window->try_add_menu("&Edit"_short_string));
TRY(main_widget->add_track_actions(edit_menu));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Piano", app_icon, window)));
diff --git a/Userland/Applications/PixelPaint/MainWidget.cpp b/Userland/Applications/PixelPaint/MainWidget.cpp
index 9f3b639bfe..1285f30d4e 100644
--- a/Userland/Applications/PixelPaint/MainWidget.cpp
+++ b/Userland/Applications/PixelPaint/MainWidget.cpp
@@ -148,7 +148,7 @@ static constexpr int s_zoom_level_fit_image = 10;
ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
{
- auto file_menu = TRY(window.try_add_menu("&File"));
+ auto file_menu = TRY(window.try_add_menu("&File"_short_string));
m_new_image_action = GUI::Action::create(
"&New Image...", { Mod_Ctrl, Key_N }, g_icon_bag.filetype_pixelpaint, [&](auto&) {
@@ -289,7 +289,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
GUI::Application::the()->quit();
})));
- m_edit_menu = TRY(window.try_add_menu("&Edit"));
+ m_edit_menu = TRY(window.try_add_menu("&Edit"_short_string));
m_cut_action = GUI::CommonActions::make_cut_action([&](auto&) {
auto* editor = current_image_editor();
@@ -477,7 +477,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
GUI::MessageBox::show_error(&window, MUST(String::formatted("Writing color palette failed: {}", result.release_error())));
})));
- m_view_menu = TRY(window.try_add_menu("&View"));
+ m_view_menu = TRY(window.try_add_menu("&View"_short_string));
m_zoom_in_action = GUI::CommonActions::make_zoom_in_action(
[&](auto&) {
@@ -593,14 +593,14 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
TRY(scopes_menu->try_add_action(histogram_action));
TRY(scopes_menu->try_add_action(vectorscope_action));
- m_tool_menu = TRY(window.try_add_menu("&Tool"));
+ m_tool_menu = TRY(window.try_add_menu("&Tool"_short_string));
m_toolbox->for_each_tool([&](auto& tool) {
if (tool.action())
m_tool_menu->add_action(*tool.action());
return IterationDecision::Continue;
});
- m_image_menu = TRY(window.try_add_menu("&Image"));
+ m_image_menu = TRY(window.try_add_menu("&Image"_short_string));
TRY(m_image_menu->try_add_action(GUI::Action::create(
"Flip Image &Vertically", g_icon_bag.edit_flip_vertical, [&](auto&) {
auto* editor = current_image_editor();
@@ -697,7 +697,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
editor->did_complete_action("Crop Image to Content"sv);
})));
- m_layer_menu = TRY(window.try_add_menu("&Layer"));
+ m_layer_menu = TRY(window.try_add_menu("&Layer"_short_string));
m_layer_menu->on_visibility_change = [this](bool visible) {
if (!visible)
@@ -1058,7 +1058,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
editor->did_complete_action("Crop Layer to Content"sv);
})));
- m_filter_menu = TRY(window.try_add_menu("&Filter"));
+ m_filter_menu = TRY(window.try_add_menu("&Filter"_short_string));
TRY(m_filter_menu->try_add_action(GUI::Action::create("Filter &Gallery", g_icon_bag.filter, [&](auto&) {
auto* editor = current_image_editor();
@@ -1082,7 +1082,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
}
})));
- auto help_menu = TRY(window.try_add_menu("&Help"));
+ auto help_menu = TRY(window.try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(&window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Pixel Paint", GUI::Icon::default_icon("app-pixel-paint"sv), &window)));
diff --git a/Userland/Applications/Presenter/PresenterWidget.cpp b/Userland/Applications/Presenter/PresenterWidget.cpp
index 92cedb0e9d..99d8e8dbc8 100644
--- a/Userland/Applications/Presenter/PresenterWidget.cpp
+++ b/Userland/Applications/Presenter/PresenterWidget.cpp
@@ -55,7 +55,7 @@ ErrorOr<void> PresenterWidget::initialize_menubar()
{
auto* window = this->window();
// Set up the menu bar.
- auto file_menu = TRY(window->try_add_menu("&File"));
+ auto file_menu = TRY(window->try_add_menu("&File"_short_string));
auto open_action = GUI::CommonActions::make_open_action([this](auto&) {
auto response = FileSystemAccessClient::Client::the().open_file(this->window());
if (response.is_error())
@@ -68,7 +68,7 @@ ErrorOr<void> PresenterWidget::initialize_menubar()
GUI::Application::the()->quit();
})));
- auto presentation_menu = TRY(window->try_add_menu("&Presentation"));
+ auto presentation_menu = TRY(window->try_add_menu(TRY("&Presentation"_string)));
m_next_slide_action = GUI::Action::create("&Next", { KeyCode::Key_Right }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"sv)), [this](auto&) {
if (m_current_presentation) {
m_current_presentation->next_frame();
@@ -95,7 +95,7 @@ ErrorOr<void> PresenterWidget::initialize_menubar()
TRY(presentation_menu->try_add_action(*m_previous_slide_action));
TRY(presentation_menu->try_add_action(*m_present_from_first_slide_action));
- auto view_menu = TRY(window->try_add_menu("&View"));
+ auto view_menu = TRY(window->try_add_menu("&View"_short_string));
m_full_screen_action = GUI::Action::create("Toggle &Full Screen", { KeyModifier::Mod_Shift, KeyCode::Key_F5 }, { KeyCode::Key_F11 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/fullscreen.png"sv)), [this](auto&) {
auto* window = this->window();
window->set_fullscreen(!window->is_fullscreen());
@@ -114,7 +114,7 @@ ErrorOr<void> PresenterWidget::initialize_menubar()
update_slides_actions();
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Presenter", GUI::Icon::default_icon("app-presenter"sv))));
return {};
diff --git a/Userland/Applications/Settings/main.cpp b/Userland/Applications/Settings/main.cpp
index 182c732759..c936cca845 100644
--- a/Userland/Applications/Settings/main.cpp
+++ b/Userland/Applications/Settings/main.cpp
@@ -92,12 +92,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->set_title("Settings");
window->resize(420, 265);
- auto file_menu = TRY(window->try_add_menu("&File"));
+ auto file_menu = TRY(window->try_add_menu("&File"_short_string));
file_menu->add_action(GUI::CommonActions::make_quit_action([&](auto&) {
app->quit();
}));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Settings", app_icon, window)));
diff --git a/Userland/Applications/SoundPlayer/main.cpp b/Userland/Applications/SoundPlayer/main.cpp
index e9c5ecfa9a..71a7ea7ccc 100644
--- a/Userland/Applications/SoundPlayer/main.cpp
+++ b/Userland/Applications/SoundPlayer/main.cpp
@@ -60,7 +60,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
player->set_loop_mode(Player::LoopMode::Playlist);
}
- auto file_menu = TRY(window->try_add_menu("&File"));
+ auto file_menu = TRY(window->try_add_menu("&File"_short_string));
TRY(file_menu->try_add_action(GUI::CommonActions::make_open_action([&](auto&) {
Optional<DeprecatedString> path = GUI::FilePicker::get_open_filepath(window, "Open sound file...");
if (path.has_value()) {
@@ -73,7 +73,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
app->quit();
})));
- auto playback_menu = TRY(window->try_add_menu("&Playback"));
+ auto playback_menu = TRY(window->try_add_menu(TRY("&Playback"_string)));
GUI::ActionGroup loop_actions;
loop_actions.set_exclusive(true);
auto loop_none = GUI::Action::create_checkable("&No Loop", { Mod_Ctrl, Key_N }, [&](auto&) {
@@ -120,7 +120,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
});
TRY(playback_menu->try_add_action(shuffle_mode));
- auto visualization_menu = TRY(window->try_add_menu("&Visualization"));
+ auto visualization_menu = TRY(window->try_add_menu(TRY("&Visualization"_string)));
GUI::ActionGroup visualization_actions;
visualization_actions.set_exclusive(true);
@@ -163,7 +163,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
selected_visualization_widget->set_checked(true);
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Sound Player", app_icon, window)));
diff --git a/Userland/Applications/SpaceAnalyzer/main.cpp b/Userland/Applications/SpaceAnalyzer/main.cpp
index 39d551d64c..7f6b4f94bd 100644
--- a/Userland/Applications/SpaceAnalyzer/main.cpp
+++ b/Userland/Applications/SpaceAnalyzer/main.cpp
@@ -61,7 +61,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
tree_map_widget.set_focus(true);
- auto file_menu = TRY(window->try_add_menu("&File"));
+ auto file_menu = TRY(window->try_add_menu("&File"_short_string));
TRY(file_menu->try_add_action(GUI::Action::create("&Analyze", { KeyCode::Key_F5 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/reload.png"sv)), [&](auto&) {
// FIXME: Just modify the tree in memory instead of traversing the entire file system
if (auto result = tree_map_widget.analyze(statusbar); result.is_error()) {
@@ -73,7 +73,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
app->quit();
})));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action(APP_NAME, app_icon, window)));
diff --git a/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp b/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp
index 608d8e1683..d0499be60c 100644
--- a/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp
+++ b/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp
@@ -649,7 +649,7 @@ void SpreadsheetWidget::clipboard_action(bool is_cut)
ErrorOr<void> SpreadsheetWidget::initialize_menubar(GUI::Window& window)
{
- auto file_menu = TRY(window.try_add_menu("&File"));
+ auto file_menu = TRY(window.try_add_menu("&File"_short_string));
TRY(file_menu->try_add_action(*m_new_action));
TRY(file_menu->try_add_action(*m_open_action));
TRY(file_menu->try_add_action(*m_save_action));
@@ -668,7 +668,7 @@ ErrorOr<void> SpreadsheetWidget::initialize_menubar(GUI::Window& window)
}));
TRY(file_menu->try_add_action(*m_quit_action));
- auto edit_menu = TRY(window.try_add_menu("&Edit"));
+ auto edit_menu = TRY(window.try_add_menu("&Edit"_short_string));
TRY(edit_menu->try_add_action(*m_undo_action));
TRY(edit_menu->try_add_action(*m_redo_action));
TRY(edit_menu->try_add_separator());
@@ -677,7 +677,7 @@ ErrorOr<void> SpreadsheetWidget::initialize_menubar(GUI::Window& window)
TRY(edit_menu->try_add_action(*m_paste_action));
TRY(edit_menu->try_add_action(*m_insert_emoji_action));
- auto help_menu = TRY(window.try_add_menu("&Help"));
+ auto help_menu = TRY(window.try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(*m_search_action));
TRY(help_menu->try_add_action(*m_functions_help_action));
TRY(help_menu->try_add_action(*m_about_action));
diff --git a/Userland/Applications/SystemMonitor/main.cpp b/Userland/Applications/SystemMonitor/main.cpp
index f00a276867..e8de2d637b 100644
--- a/Userland/Applications/SystemMonitor/main.cpp
+++ b/Userland/Applications/SystemMonitor/main.cpp
@@ -424,7 +424,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
},
&process_table_view);
- auto& file_menu = window->add_menu("&File");
+ auto& file_menu = window->add_menu("&File"_short_string);
file_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
GUI::Application::the()->quit();
}));
@@ -443,7 +443,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
process_context_menu->popup(event.screen_position(), process_properties_action);
};
- auto& frequency_menu = window->add_menu("F&requency");
+ auto& frequency_menu = window->add_menu(TRY("F&requency"_string));
GUI::ActionGroup frequency_action_group;
frequency_action_group.set_exclusive(true);
@@ -462,7 +462,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
make_frequency_action(3);
make_frequency_action(5);
- auto& help_menu = window->add_menu("&Help");
+ auto& help_menu = window->add_menu("&Help"_short_string);
help_menu.add_action(GUI::CommonActions::make_command_palette_action(window));
help_menu.add_action(GUI::CommonActions::make_about_action("System Monitor", app_icon, window));
diff --git a/Userland/Applications/Terminal/main.cpp b/Userland/Applications/Terminal/main.cpp
index 0bb182d6d3..d5c53e3c05 100644
--- a/Userland/Applications/Terminal/main.cpp
+++ b/Userland/Applications/Terminal/main.cpp
@@ -341,7 +341,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(terminal->context_menu().try_add_separator());
TRY(terminal->context_menu().try_add_action(open_settings_action));
- auto file_menu = TRY(window->try_add_menu("&File"));
+ auto file_menu = TRY(window->try_add_menu("&File"_short_string));
TRY(file_menu->try_add_action(GUI::Action::create("Open New &Terminal", { Mod_Ctrl | Mod_Shift, Key_N }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-terminal.png"sv)), [&](auto&) {
GUI::Process::spawn_or_show_error(window, "/bin/Terminal"sv);
})));
@@ -388,7 +388,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
GUI::Application::the()->quit();
})));
- auto edit_menu = TRY(window->try_add_menu("&Edit"));
+ auto edit_menu = TRY(window->try_add_menu("&Edit"_short_string));
TRY(edit_menu->try_add_action(terminal->copy_action()));
TRY(edit_menu->try_add_action(terminal->paste_action()));
TRY(edit_menu->try_add_separator());
@@ -398,7 +398,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
find_window->move_to_front();
})));
- auto view_menu = TRY(window->try_add_menu("&View"));
+ auto view_menu = TRY(window->try_add_menu("&View"_short_string));
TRY(view_menu->try_add_action(GUI::CommonActions::make_fullscreen_action([&](auto&) {
window->set_fullscreen(!window->is_fullscreen());
})));
@@ -422,7 +422,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
adjust_font_size(-1);
})));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Terminal.md"), "/bin/Help");
diff --git a/Userland/Applications/TextEditor/MainWidget.cpp b/Userland/Applications/TextEditor/MainWidget.cpp
index 5b05c6bfcd..9f1ea8e3b1 100644
--- a/Userland/Applications/TextEditor/MainWidget.cpp
+++ b/Userland/Applications/TextEditor/MainWidget.cpp
@@ -369,7 +369,7 @@ WebView::OutOfProcessWebView& MainWidget::ensure_web_view()
void MainWidget::initialize_menubar(GUI::Window& window)
{
- auto& file_menu = window.add_menu("&File");
+ auto& file_menu = window.add_menu("&File"_short_string);
file_menu.add_action(*m_new_action);
file_menu.add_action(*m_open_action);
file_menu.add_action(*m_save_action);
@@ -401,7 +401,7 @@ void MainWidget::initialize_menubar(GUI::Window& window)
GUI::Application::the()->quit();
}));
- auto& edit_menu = window.add_menu("&Edit");
+ auto& edit_menu = window.add_menu("&Edit"_short_string);
edit_menu.add_action(m_editor->undo_action());
edit_menu.add_action(m_editor->redo_action());
edit_menu.add_separator();
@@ -465,7 +465,7 @@ void MainWidget::initialize_menubar(GUI::Window& window)
m_layout_ruler_action->set_checked(show_ruler);
m_editor->set_ruler_visible(show_ruler);
- auto& view_menu = window.add_menu("&View");
+ auto& view_menu = window.add_menu("&View"_short_string);
auto& layout_menu = view_menu.add_submenu("&Layout");
layout_menu.add_action(*m_layout_toolbar_action);
layout_menu.add_action(*m_layout_statusbar_action);
@@ -687,7 +687,7 @@ void MainWidget::initialize_menubar(GUI::Window& window)
syntax_actions.add_action(*m_sql_highlight);
syntax_menu.add_action(*m_sql_highlight);
- auto& help_menu = window.add_menu("&Help");
+ auto& help_menu = window.add_menu("&Help"_short_string);
help_menu.add_action(GUI::CommonActions::make_command_palette_action(&window));
help_menu.add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/TextEditor.md"), "/bin/Help");
diff --git a/Userland/Applications/ThemeEditor/MainWidget.cpp b/Userland/Applications/ThemeEditor/MainWidget.cpp
index 2ca4e5524d..fe7df40623 100644
--- a/Userland/Applications/ThemeEditor/MainWidget.cpp
+++ b/Userland/Applications/ThemeEditor/MainWidget.cpp
@@ -238,7 +238,7 @@ MainWidget::MainWidget(NonnullRefPtr<AlignmentModel> alignment_model)
ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
{
- auto file_menu = TRY(window.try_add_menu("&File"));
+ auto file_menu = TRY(window.try_add_menu("&File"_short_string));
TRY(file_menu->try_add_action(GUI::CommonActions::make_open_action([&](auto&) {
if (request_close() == GUI::Window::CloseRequestDecision::StayOpen)
return;
@@ -282,7 +282,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
TRY(window.try_add_menu(TRY(GUI::CommonMenus::make_accessibility_menu(*m_preview_widget))));
- auto help_menu = TRY(window.try_add_menu("&Help"));
+ auto help_menu = TRY(window.try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(&window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Theme Editor", GUI::Icon::default_icon("app-theme-editor"sv), &window)));
diff --git a/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp b/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp
index 83a40325c6..1f68285f3e 100644
--- a/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp
+++ b/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp
@@ -352,7 +352,7 @@ void VideoPlayerWidget::set_seek_mode(Video::PlaybackManager::SeekMode seek_mode
ErrorOr<void> VideoPlayerWidget::initialize_menubar(GUI::Window& window)
{
// File menu
- auto file_menu = TRY(window.try_add_menu("&File"));
+ auto file_menu = TRY(window.try_add_menu("&File"_short_string));
TRY(file_menu->try_add_action(GUI::CommonActions::make_open_action([&](auto&) {
Optional<DeprecatedString> path = GUI::FilePicker::get_open_filepath(&window, "Open video file...");
if (path.has_value())
@@ -364,7 +364,7 @@ ErrorOr<void> VideoPlayerWidget::initialize_menubar(GUI::Window& window)
})));
// Playback menu
- auto playback_menu = TRY(window.try_add_menu("&Playback"));
+ auto playback_menu = TRY(window.try_add_menu(TRY("&Playback"_string)));
// FIXME: Maybe seek mode should be in an options dialog instead. The playback menu may get crowded.
// For now, leave it here for convenience.
@@ -373,7 +373,7 @@ ErrorOr<void> VideoPlayerWidget::initialize_menubar(GUI::Window& window)
set_seek_mode(Video::PlaybackManager::DEFAULT_SEEK_MODE);
// View menu
- auto view_menu = TRY(window.try_add_menu("&View"));
+ auto view_menu = TRY(window.try_add_menu("&View"_short_string));
TRY(view_menu->try_add_action(*m_toggle_fullscreen_action));
auto sizing_mode_menu = TRY(view_menu->try_add_submenu("&Sizing mode"));
@@ -393,7 +393,7 @@ ErrorOr<void> VideoPlayerWidget::initialize_menubar(GUI::Window& window)
TRY(sizing_mode_menu->try_add_action(*m_size_fullsize_action));
// Help menu
- auto help_menu = TRY(window.try_add_menu("&Help"));
+ auto help_menu = TRY(window.try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Video Player", TRY(GUI::Icon::try_create_default_icon("app-video-player"sv)), &window)));
return {};
diff --git a/Userland/Demos/Eyes/main.cpp b/Userland/Demos/Eyes/main.cpp
index 66b5eabd4c..053a6640d8 100644
--- a/Userland/Demos/Eyes/main.cpp
+++ b/Userland/Demos/Eyes/main.cpp
@@ -84,12 +84,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
set_window_frame_enabled(!hide_window_frame);
show_window_frame_action->set_checked(window_frame_enabled);
- auto file_menu = TRY(window->try_add_menu("&File"));
+ auto file_menu = TRY(window->try_add_menu("&File"_short_string));
TRY(file_menu->try_add_action(move(show_window_frame_action)));
TRY(file_menu->try_add_separator());
TRY(file_menu->try_add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Eyes.md"), "/bin/Help");
diff --git a/Userland/Demos/LibGfxDemo/main.cpp b/Userland/Demos/LibGfxDemo/main.cpp
index 3209290ffc..b2c73a3821 100644
--- a/Userland/Demos/LibGfxDemo/main.cpp
+++ b/Userland/Demos/LibGfxDemo/main.cpp
@@ -197,7 +197,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->set_resizable(false);
window->resize(WIDTH, HEIGHT);
- auto file_menu = TRY(window->try_add_menu("&File"));
+ auto file_menu = TRY(window->try_add_menu("&File"_short_string));
TRY(file_menu->try_add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })));
auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-libgfx-demo"sv));
diff --git a/Userland/Demos/LibGfxScaleDemo/main.cpp b/Userland/Demos/LibGfxScaleDemo/main.cpp
index 8e54da69b7..d0222ee4f4 100644
--- a/Userland/Demos/LibGfxScaleDemo/main.cpp
+++ b/Userland/Demos/LibGfxScaleDemo/main.cpp
@@ -116,7 +116,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->set_resizable(false);
window->resize(WIDTH * 2, HEIGHT * 3);
- auto file_menu = TRY(window->try_add_menu("&File"));
+ auto file_menu = TRY(window->try_add_menu("&File"_short_string));
TRY(file_menu->try_add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })));
auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-libgfx-demo"sv));
diff --git a/Userland/Demos/Mandelbrot/Mandelbrot.cpp b/Userland/Demos/Mandelbrot/Mandelbrot.cpp
index b3c3064d21..5d38b1f46d 100644
--- a/Userland/Demos/Mandelbrot/Mandelbrot.cpp
+++ b/Userland/Demos/Mandelbrot/Mandelbrot.cpp
@@ -413,7 +413,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->resize(window->minimum_size() * 2);
auto mandelbrot = TRY(window->set_main_widget<Mandelbrot>());
- auto file_menu = TRY(window->try_add_menu("&File"));
+ auto file_menu = TRY(window->try_add_menu("&File"_short_string));
auto& export_submenu = file_menu->add_submenu("&Export");
@@ -469,12 +469,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto app_icon = GUI::Icon::default_icon("app-mandelbrot"sv);
window->set_icon(app_icon.bitmap_for_size(16));
- auto view_menu = TRY(window->try_add_menu("&View"));
+ auto view_menu = TRY(window->try_add_menu("&View"_short_string));
TRY(view_menu->try_add_action(zoom_in_action));
TRY(view_menu->try_add_action(reset_zoom_action));
TRY(view_menu->try_add_action(zoom_out_action));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Mandelbrot Demo", app_icon, window)));
diff --git a/Userland/Demos/Screensaver/main.cpp b/Userland/Demos/Screensaver/main.cpp
index c72251eafa..372fc35016 100644
--- a/Userland/Demos/Screensaver/main.cpp
+++ b/Userland/Demos/Screensaver/main.cpp
@@ -76,12 +76,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->set_title("Screensaver");
window->resize(360, 240);
- auto file_menu = TRY(window->try_add_menu("&File"));
+ auto file_menu = TRY(window->try_add_menu("&File"_short_string));
file_menu->add_action(GUI::CommonActions::make_quit_action([&](auto&) {
app->quit();
}));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Screensaver", app_icon, window)));
diff --git a/Userland/DevTools/GMLPlayground/main.cpp b/Userland/DevTools/GMLPlayground/main.cpp
index 8ff2819243..d174bcbf87 100644
--- a/Userland/DevTools/GMLPlayground/main.cpp
+++ b/Userland/DevTools/GMLPlayground/main.cpp
@@ -141,7 +141,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
GUI::Application::the()->set_most_recently_open_file(file.filename());
};
- auto file_menu = TRY(window->try_add_menu("&File"));
+ auto file_menu = TRY(window->try_add_menu("&File"_short_string));
auto save_as_action = GUI::CommonActions::make_save_as_action([&](auto&) {
auto response = FileSystemAccessClient::Client::the().save_file(window, "Untitled", "gml");
@@ -218,7 +218,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
app->quit();
})));
- auto edit_menu = TRY(window->try_add_menu("&Edit"));
+ auto edit_menu = TRY(window->try_add_menu("&Edit"_short_string));
TRY(edit_menu->try_add_action(editor->undo_action()));
TRY(edit_menu->try_add_action(editor->redo_action()));
TRY(edit_menu->try_add_separator());
@@ -253,7 +253,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
vim_emulation_setting_action->set_checked(false);
TRY(edit_menu->try_add_action(vim_emulation_setting_action));
- auto view_menu = TRY(window->try_add_menu("&View"));
+ auto view_menu = TRY(window->try_add_menu("&View"_short_string));
GUI::ActionGroup views_group;
views_group.set_exclusive(true);
views_group.set_unchecking_allowed(false);
@@ -285,7 +285,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
view_frame_action->activate();
};
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/GMLPlayground.md"), "/bin/Help");
diff --git a/Userland/DevTools/HackStudio/HackStudioWidget.cpp b/Userland/DevTools/HackStudio/HackStudioWidget.cpp
index 51b1886c3e..ef22ed01ff 100644
--- a/Userland/DevTools/HackStudio/HackStudioWidget.cpp
+++ b/Userland/DevTools/HackStudio/HackStudioWidget.cpp
@@ -1409,7 +1409,7 @@ void HackStudioWidget::update_recent_projects_submenu()
ErrorOr<void> HackStudioWidget::create_file_menu(GUI::Window& window)
{
- auto& file_menu = window.add_menu("&File");
+ auto& file_menu = window.add_menu("&File"_short_string);
auto& new_submenu = file_menu.add_submenu("&New...");
new_submenu.add_action(*m_new_project_action);
@@ -1444,7 +1444,7 @@ ErrorOr<void> HackStudioWidget::create_file_menu(GUI::Window& window)
ErrorOr<void> HackStudioWidget::create_edit_menu(GUI::Window& window)
{
- auto& edit_menu = window.add_menu("&Edit");
+ auto& edit_menu = window.add_menu("&Edit"_short_string);
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/find.png"sv));
edit_menu.add_action(GUI::Action::create("&Find in Files...", { Mod_Ctrl | Mod_Shift, Key_F }, icon, [this](auto&) {
reveal_action_tab(*m_find_in_files_widget);
@@ -1472,7 +1472,7 @@ ErrorOr<void> HackStudioWidget::create_edit_menu(GUI::Window& window)
void HackStudioWidget::create_build_menu(GUI::Window& window)
{
- auto& build_menu = window.add_menu("&Build");
+ auto& build_menu = window.add_menu("&Build"_short_string);
build_menu.add_action(*m_build_action);
build_menu.add_separator();
build_menu.add_action(*m_run_action);
@@ -1495,7 +1495,7 @@ ErrorOr<void> HackStudioWidget::create_view_menu(GUI::Window& window)
});
show_dotfiles_action->set_checked(Config::read_bool("HackStudio"sv, "Global"sv, "ShowDotfiles"sv, false));
- auto& view_menu = window.add_menu("&View");
+ auto& view_menu = window.add_menu("&View"_short_string);
view_menu.add_action(hide_action_tabs_action);
view_menu.add_action(open_locator_action);
view_menu.add_action(show_dotfiles_action);
@@ -1574,7 +1574,7 @@ ErrorOr<void> HackStudioWidget::create_view_menu(GUI::Window& window)
void HackStudioWidget::create_help_menu(GUI::Window& window)
{
- auto& help_menu = window.add_menu("&Help");
+ auto& help_menu = window.add_menu("&Help"_short_string);
help_menu.add_action(GUI::CommonActions::make_command_palette_action(&window));
help_menu.add_action(GUI::CommonActions::make_about_action("Hack Studio", GUI::Icon::default_icon("app-hack-studio"sv), &window));
}
diff --git a/Userland/DevTools/Inspector/main.cpp b/Userland/DevTools/Inspector/main.cpp
index b7ac04bb21..5eb8d8c15a 100644
--- a/Userland/DevTools/Inspector/main.cpp
+++ b/Userland/DevTools/Inspector/main.cpp
@@ -89,10 +89,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->resize(685, 500);
window->set_icon(app_icon.bitmap_for_size(16));
- auto& file_menu = window->add_menu("&File");
+ auto& file_menu = window->add_menu("&File"_short_string);
file_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
- auto& help_menu = window->add_menu("&Help");
+ auto& help_menu = window->add_menu("&Help"_short_string);
help_menu.add_action(GUI::CommonActions::make_command_palette_action(window));
help_menu.add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Inspector.md"), "/bin/Help");
diff --git a/Userland/DevTools/Profiler/main.cpp b/Userland/DevTools/Profiler/main.cpp
index e5fc424623..fa330cad29 100644
--- a/Userland/DevTools/Profiler/main.cpp
+++ b/Userland/DevTools/Profiler/main.cpp
@@ -265,10 +265,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
filesystem_events_tree_view->set_selection_behavior(GUI::TreeView::SelectionBehavior::SelectRows);
filesystem_events_tree_view->set_model(profile->file_event_model());
- auto file_menu = TRY(window->try_add_menu("&File"));
+ auto file_menu = TRY(window->try_add_menu("&File"_short_string));
TRY(file_menu->try_add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })));
- auto view_menu = TRY(window->try_add_menu("&View"));
+ auto view_menu = TRY(window->try_add_menu("&View"_short_string));
auto invert_action = GUI::Action::create_checkable("&Invert Tree", { Mod_Ctrl, Key_I }, [&](auto& action) {
profile->set_inverted(action.is_checked());
@@ -294,7 +294,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(view_menu->try_add_action(disassembly_action));
TRY(view_menu->try_add_action(source_action));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Profiler.md"), "/bin/Help");
diff --git a/Userland/DevTools/SQLStudio/MainWidget.cpp b/Userland/DevTools/SQLStudio/MainWidget.cpp
index d9146f72a3..e51aa26f30 100644
--- a/Userland/DevTools/SQLStudio/MainWidget.cpp
+++ b/Userland/DevTools/SQLStudio/MainWidget.cpp
@@ -293,7 +293,7 @@ MainWidget::MainWidget()
void MainWidget::initialize_menu(GUI::Window* window)
{
- auto& file_menu = window->add_menu("&File");
+ auto& file_menu = window->add_menu("&File"_short_string);
file_menu.add_action(*m_new_action);
file_menu.add_action(*m_open_action);
file_menu.add_action(*m_save_action);
@@ -304,7 +304,7 @@ void MainWidget::initialize_menu(GUI::Window* window)
GUI::Application::the()->quit();
}));
- auto& edit_menu = window->add_menu("&Edit");
+ auto& edit_menu = window->add_menu("&Edit"_short_string);
edit_menu.add_action(*m_copy_action);
edit_menu.add_action(*m_cut_action);
edit_menu.add_action(*m_paste_action);
@@ -314,7 +314,7 @@ void MainWidget::initialize_menu(GUI::Window* window)
edit_menu.add_separator();
edit_menu.add_action(*m_run_script_action);
- auto& help_menu = window->add_menu("&Help");
+ auto& help_menu = window->add_menu("&Help"_short_string);
help_menu.add_action(GUI::CommonActions::make_command_palette_action(window));
help_menu.add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/SQLStudio.md"), "/bin/Help");
diff --git a/Userland/Games/2048/main.cpp b/Userland/Games/2048/main.cpp
index 7144160e10..4f298379cb 100644
--- a/Userland/Games/2048/main.cpp
+++ b/Userland/Games/2048/main.cpp
@@ -169,7 +169,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
}
};
- auto game_menu = TRY(window->try_add_menu("&Game"));
+ auto game_menu = TRY(window->try_add_menu("&Game"_short_string));
TRY(game_menu->try_add_action(GUI::Action::create("&New Game", { Mod_None, Key_F2 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/reload.png"sv)), [&](auto&) {
start_a_new_game();
@@ -201,7 +201,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
GUI::Application::the()->quit();
})));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/2048.md"), "/bin/Help");
diff --git a/Userland/Games/BrickGame/main.cpp b/Userland/Games/BrickGame/main.cpp
index ad28031319..a7eaae25c9 100644
--- a/Userland/Games/BrickGame/main.cpp
+++ b/Userland/Games/BrickGame/main.cpp
@@ -51,7 +51,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto game = TRY(window->set_main_widget<BrickGame>(app_name));
- auto game_menu = TRY(window->try_add_menu("&Game"));
+ auto game_menu = TRY(window->try_add_menu("&Game"_short_string));
TRY(game_menu->try_add_action(GUI::Action::create("&New Game", { Mod_None, Key_F2 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/reload.png"sv)), [&](auto&) {
game->reset();
@@ -73,7 +73,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
GUI::Application::the()->quit();
})));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([&man_file](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme(man_file), "/bin/Help");
diff --git a/Userland/Games/Chess/main.cpp b/Userland/Games/Chess/main.cpp
index b4b7b42350..08b40b3dbe 100644
--- a/Userland/Games/Chess/main.cpp
+++ b/Userland/Games/Chess/main.cpp
@@ -57,7 +57,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
widget->set_coordinates(Config::read_bool("Games"sv, "Chess"sv, "ShowCoordinates"sv, true));
widget->set_show_available_moves(Config::read_bool("Games"sv, "Chess"sv, "ShowAvailableMoves"sv, true));
- auto game_menu = TRY(window->try_add_menu("&Game"));
+ auto game_menu = TRY(window->try_add_menu("&Game"_short_string));
TRY(game_menu->try_add_action(GUI::Action::create("&Resign", { Mod_None, Key_F3 }, [&](auto&) {
widget->resign();
@@ -123,7 +123,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
GUI::Application::the()->quit();
})));
- auto engine_menu = TRY(window->try_add_menu("&Engine"));
+ auto engine_menu = TRY(window->try_add_menu("&Engine"_short_string));
GUI::ActionGroup engines_action_group;
engines_action_group.set_exclusive(true);
@@ -144,7 +144,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(engine_submenu->try_add_action(*action));
}
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/Chess.md"), "/bin/Help");
diff --git a/Userland/Games/ColorLines/main.cpp b/Userland/Games/ColorLines/main.cpp
index 204d6c64a0..2528fb7509 100644
--- a/Userland/Games/ColorLines/main.cpp
+++ b/Userland/Games/ColorLines/main.cpp
@@ -50,7 +50,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto game = TRY(window->set_main_widget<ColorLines>(app_name));
- auto game_menu = TRY(window->try_add_menu("&Game"));
+ auto game_menu = TRY(window->try_add_menu("&Game"_short_string));
TRY(game_menu->try_add_action(GUI::Action::create("&New Game", { Mod_None, Key_F2 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/reload.png"sv)), [&](auto&) {
game->reset();
@@ -60,7 +60,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
GUI::Application::the()->quit();
})));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([&man_file](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme(man_file), "/bin/Help");
diff --git a/Userland/Games/FlappyBug/main.cpp b/Userland/Games/FlappyBug/main.cpp
index 9f7e720543..245b7afc82 100644
--- a/Userland/Games/FlappyBug/main.cpp
+++ b/Userland/Games/FlappyBug/main.cpp
@@ -55,12 +55,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
return high_score;
};
- auto game_menu = TRY(window->try_add_menu("&Game"));
+ auto game_menu = TRY(window->try_add_menu("&Game"_short_string));
TRY(game_menu->try_add_action(GUI::CommonActions::make_quit_action([](auto&) {
GUI::Application::the()->quit();
})));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/FlappyBug.md"), "/bin/Help");
diff --git a/Userland/Games/Flood/main.cpp b/Userland/Games/Flood/main.cpp
index 6957675446..1fc3f3d854 100644
--- a/Userland/Games/Flood/main.cpp
+++ b/Userland/Games/Flood/main.cpp
@@ -167,7 +167,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
}
};
- auto game_menu = TRY(window->try_add_menu("&Game"));
+ auto game_menu = TRY(window->try_add_menu("&Game"_short_string));
TRY(game_menu->try_add_action(GUI::Action::create("&New Game", { Mod_None, Key_F2 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/reload.png"sv)), [&](auto&) {
start_a_new_game();
@@ -183,7 +183,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
GUI::Application::the()->quit();
})));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/Flood.md"), "/bin/Help");
diff --git a/Userland/Games/GameOfLife/main.cpp b/Userland/Games/GameOfLife/main.cpp
index e3db2efbdd..40ad80f203 100644
--- a/Userland/Games/GameOfLife/main.cpp
+++ b/Userland/Games/GameOfLife/main.cpp
@@ -126,7 +126,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
rotate_pattern_action->set_enabled(false);
(void)TRY(main_toolbar.try_add_action(rotate_pattern_action));
- auto game_menu = TRY(window->try_add_menu("&Game"));
+ auto game_menu = TRY(window->try_add_menu("&Game"_short_string));
TRY(game_menu->try_add_action(clear_board_action));
TRY(game_menu->try_add_action(randomize_cells_action));
@@ -138,7 +138,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
GUI::Application::the()->quit();
})));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/GameOfLife.md"), "/bin/Help");
diff --git a/Userland/Games/Hearts/main.cpp b/Userland/Games/Hearts/main.cpp
index 7f26bc2b98..fc5b48d2e8 100644
--- a/Userland/Games/Hearts/main.cpp
+++ b/Userland/Games/Hearts/main.cpp
@@ -88,7 +88,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
GUI::MessageBox::show(settings_dialog, "Settings have been successfully saved and will take effect in the next game."sv, "Settings Changed Successfully"sv, GUI::MessageBox::Type::Information);
};
- auto game_menu = TRY(window->try_add_menu("&Game"));
+ auto game_menu = TRY(window->try_add_menu("&Game"_short_string));
TRY(game_menu->try_add_action(GUI::Action::create("&New Game", { Mod_None, Key_F2 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/reload.png"sv)), [&](auto&) {
game.setup(player_name);
@@ -101,7 +101,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(game_menu->try_add_separator());
TRY(game_menu->try_add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/Hearts.md"), "/bin/Help");
diff --git a/Userland/Games/MasterWord/main.cpp b/Userland/Games/MasterWord/main.cpp
index 4a76e1bc5f..17eb9415cc 100644
--- a/Userland/Games/MasterWord/main.cpp
+++ b/Userland/Games/MasterWord/main.cpp
@@ -60,7 +60,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->set_focused_widget(&game);
- auto game_menu = TRY(window->try_add_menu("&Game"));
+ auto game_menu = TRY(window->try_add_menu("&Game"_short_string));
TRY(game_menu->try_add_action(GUI::Action::create("&New Game", { Mod_None, Key_F2 }, [&](auto&) {
game.reset();
@@ -71,7 +71,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
GUI::Application::the()->quit();
})));
- auto settings_menu = TRY(window->try_add_menu("&Settings"));
+ auto settings_menu = TRY(window->try_add_menu(TRY("&Settings"_string)));
TRY(settings_menu->try_add_action(GUI::Action::create("Set &Word Length...", [&](auto&) {
auto word_length = Config::read_i32("MasterWord"sv, ""sv, "word_length"sv, 5);
@@ -98,7 +98,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
toggle_check_guesses->set_checked(game.is_checking_guesses());
TRY(settings_menu->try_add_action(toggle_check_guesses));
- auto theme_menu = TRY(window->try_add_menu("&Theme"));
+ auto theme_menu = TRY(window->try_add_menu("&Theme"_short_string));
auto system_theme_action = GUI::Action::create("&System", [&](auto&) {
game.set_use_system_theme(true);
Config::write_bool("MasterWord"sv, ""sv, "use_system_theme"sv, true);
@@ -121,7 +121,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
theme_actions.add_action(system_theme_action);
theme_actions.add_action(wordle_theme_action);
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/MasterWord.md"), "/bin/Help");
diff --git a/Userland/Games/Minesweeper/main.cpp b/Userland/Games/Minesweeper/main.cpp
index f45d46beb0..2f7f1b6a48 100644
--- a/Userland/Games/Minesweeper/main.cpp
+++ b/Userland/Games/Minesweeper/main.cpp
@@ -58,7 +58,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto field = TRY(Field::create(flag_label, time_label, face_button));
TRY(widget->try_add_child(field));
- auto game_menu = TRY(window->try_add_menu("&Game"));
+ auto game_menu = TRY(window->try_add_menu("&Game"_short_string));
TRY(game_menu->try_add_action(GUI::Action::create("&New Game", { Mod_None, Key_F2 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/reload.png"sv)), [&](auto&) {
field->reset();
@@ -78,7 +78,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
GUI::Application::the()->quit();
})));
- auto difficulty_menu = TRY(window->try_add_menu("&Difficulty"));
+ auto difficulty_menu = TRY(window->try_add_menu(TRY("&Difficulty"_string)));
GUI::ActionGroup difficulty_actions;
difficulty_actions.set_exclusive(true);
@@ -118,7 +118,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(difficulty_menu->try_add_action(action));
difficulty_actions.add_action(action);
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/Minesweeper.md"), "/bin/Help");
diff --git a/Userland/Games/Snake/main.cpp b/Userland/Games/Snake/main.cpp
index d38084351f..8a9cef6b74 100644
--- a/Userland/Games/Snake/main.cpp
+++ b/Userland/Games/Snake/main.cpp
@@ -77,7 +77,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
return true;
};
- auto game_menu = TRY(window->try_add_menu("&Game"));
+ auto game_menu = TRY(window->try_add_menu("&Game"_short_string));
TRY(game_menu->try_add_action(GUI::Action::create("&New Game", { Mod_None, Key_F2 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/reload.png"sv)), [&](auto&) {
game.reset();
@@ -144,7 +144,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
GUI::Application::the()->quit();
})));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/Snake.md"), "/bin/Help");
diff --git a/Userland/Games/Solitaire/main.cpp b/Userland/Games/Solitaire/main.cpp
index 073543c406..92c4969646 100644
--- a/Userland/Games/Solitaire/main.cpp
+++ b/Userland/Games/Solitaire/main.cpp
@@ -204,7 +204,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
toggle_auto_collect_action->set_checked(game.is_auto_collecting());
toggle_auto_collect_action->set_status_tip("Auto-collect to foundation piles");
- auto game_menu = TRY(window->try_add_menu("&Game"));
+ auto game_menu = TRY(window->try_add_menu("&Game"_short_string));
TRY(game_menu->try_add_action(GUI::Action::create("&New Game", { Mod_None, Key_F2 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/reload.png"sv)), [&](auto&) {
if (!confirm_end_current_game())
@@ -227,7 +227,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(game_menu->try_add_separator());
TRY(game_menu->try_add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Solitaire", app_icon, window)));
diff --git a/Userland/Games/Spider/main.cpp b/Userland/Games/Spider/main.cpp
index 0812ecd73d..789fd256eb 100644
--- a/Userland/Games/Spider/main.cpp
+++ b/Userland/Games/Spider/main.cpp
@@ -246,7 +246,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
two_suit_action->set_checked(mode == Spider::Mode::TwoSuit);
suit_actions.add_action(two_suit_action);
- auto game_menu = TRY(window->try_add_menu("&Game"));
+ auto game_menu = TRY(window->try_add_menu("&Game"_short_string));
TRY(game_menu->try_add_action(GUI::Action::create("&New Game", { Mod_None, Key_F2 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/reload.png"sv)), [&](auto&) {
if (!confirm_end_current_game())
return;
@@ -266,7 +266,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(game_menu->try_add_separator());
TRY(game_menu->try_add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })));
- auto view_menu = TRY(window->try_add_menu("&View"));
+ auto view_menu = TRY(window->try_add_menu("&View"_short_string));
GUI::ActionGroup statistic_display_actions;
statistic_display_actions.set_exclusive(true);
@@ -288,7 +288,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(view_menu->try_add_action(high_score_action));
TRY(view_menu->try_add_action(best_time_actions));
- auto help_menu = TRY(window->try_add_menu("&Help"));
+ auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
help_menu->add_action(GUI::CommonActions::make_command_palette_action(window));
help_menu->add_action(GUI::CommonActions::make_about_action("Spider", app_icon, window));
diff --git a/Userland/Libraries/LibGUI/Window.cpp b/Userland/Libraries/LibGUI/Window.cpp
index fee0a09cd2..0edf8c4321 100644
--- a/Userland/Libraries/LibGUI/Window.cpp
+++ b/Userland/Libraries/LibGUI/Window.cpp
@@ -1324,9 +1324,9 @@ ErrorOr<void> Window::try_add_menu(NonnullRefPtr<Menu> menu)
return {};
}
-ErrorOr<NonnullRefPtr<Menu>> Window::try_add_menu(DeprecatedString name)
+ErrorOr<NonnullRefPtr<Menu>> Window::try_add_menu(String name)
{
- auto menu = TRY(m_menubar->try_add_menu({}, TRY(String::from_deprecated_string(name))));
+ auto menu = TRY(m_menubar->try_add_menu({}, move(name)));
if (m_window_id) {
menu->realize_menu_if_needed();
ConnectionToWindowServer::the().async_add_menu(m_window_id, menu->menu_id());
@@ -1334,7 +1334,7 @@ ErrorOr<NonnullRefPtr<Menu>> Window::try_add_menu(DeprecatedString name)
return menu;
}
-Menu& Window::add_menu(DeprecatedString name)
+Menu& Window::add_menu(String name)
{
auto menu = MUST(try_add_menu(move(name)));
return *menu;
diff --git a/Userland/Libraries/LibGUI/Window.h b/Userland/Libraries/LibGUI/Window.h
index 676427fc53..c98197b4b8 100644
--- a/Userland/Libraries/LibGUI/Window.h
+++ b/Userland/Libraries/LibGUI/Window.h
@@ -218,8 +218,8 @@ public:
void did_disable_focused_widget(Badge<Widget>);
- Menu& add_menu(DeprecatedString name);
- ErrorOr<NonnullRefPtr<Menu>> try_add_menu(DeprecatedString name);
+ Menu& add_menu(String name);
+ ErrorOr<NonnullRefPtr<Menu>> try_add_menu(String name);
ErrorOr<void> try_add_menu(NonnullRefPtr<Menu> menu);
void flash_menubar_menu_for(MenuItem const&);