LibGUI+Applications: Use String in make_about_action()

This commit is contained in:
Tim Ledbetter 2023-09-13 20:34:46 +01:00 committed by Andreas Kling
parent e7a5a2e146
commit ccab5ddf9b
Notes: sideshowbarker 2024-07-17 08:27:05 +09:00
53 changed files with 60 additions and 60 deletions

View file

@ -564,7 +564,7 @@ ErrorOr<int> 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_about_action("3D File Viewer", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("3D File Viewer"_string, app_icon, window));
window->show();

View file

@ -75,7 +75,7 @@ WindowActions::WindowActions(GUI::Window& window)
&window));
m_tab_actions.last()->set_status_tip("Switch to last tab"_string);
m_about_action = GUI::CommonActions::make_about_action("Ladybird", GUI::Icon::default_icon("app-browser"sv), &window);
m_about_action = GUI::CommonActions::make_about_action("Ladybird"_string, GUI::Icon::default_icon("app-browser"sv), &window);
m_show_bookmarks_bar_action = GUI::Action::create_checkable(
"&Bookmarks Bar", { Mod_Ctrl, Key_B },

View file

@ -123,7 +123,7 @@ ErrorOr<int> 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_about_action("Calculator", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Calculator"_string, app_icon, window));
window->show();

View file

@ -105,7 +105,7 @@ 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_about_action("Calendar", TRY(GUI::Icon::try_create_default_icon("app-calendar"sv)), parent_window));
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

@ -169,7 +169,7 @@ ErrorOr<void> CharacterMapWidget::initialize_menubar(GUI::Window& window)
help_menu->add_action(GUI::CommonActions::make_help_action([&](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/CharacterMap.md"), "/bin/Help");
}));
help_menu->add_action(GUI::CommonActions::make_about_action("Character Map", GUI::Icon::default_icon("app-character-map"sv), &window));
help_menu->add_action(GUI::CommonActions::make_about_action("Character Map"_string, GUI::Icon::default_icon("app-character-map"sv), &window));
return {};
}

View file

@ -1071,7 +1071,7 @@ ErrorOr<int> run_in_windowed_mode(DeprecatedString const& initial_location, Depr
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_about_action("File Manager"sv, GUI::Icon::default_icon("app-file-manager"sv), window));
help_menu->add_action(GUI::CommonActions::make_about_action("File Manager"_string, GUI::Icon::default_icon("app-file-manager"sv), window));
main_toolbar.add_action(go_back_action);
main_toolbar.add_action(go_forward_action);

View file

@ -798,7 +798,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/FontEditor.md"), "/bin/Help");
}));
help_menu->add_action(GUI::CommonActions::make_about_action("Font Editor", TRY(GUI::Icon::try_create_default_icon("app-font-editor"sv)), &window));
help_menu->add_action(GUI::CommonActions::make_about_action("Font Editor"_string, TRY(GUI::Icon::try_create_default_icon("app-font-editor"sv)), &window));
return {};
}

View file

@ -221,7 +221,7 @@ ErrorOr<void> MainWidget::initialize_fallibles(GUI::Window& window)
help_menu->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&) {
open_page(help_page_path);
}));
help_menu->add_action(GUI::CommonActions::make_about_action("Help", TRY(GUI::Icon::try_create_default_icon("app-help"sv)), &window));
help_menu->add_action(GUI::CommonActions::make_about_action("Help"_string, TRY(GUI::Icon::try_create_default_icon("app-help"sv)), &window));
m_context_menu = TRY(GUI::Menu::try_create());
m_context_menu->add_action(*m_go_back_action);

View file

@ -548,7 +548,7 @@ ErrorOr<void> HexEditorWidget::initialize_menubar(GUI::Window& window)
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/HexEditor.md"), "/bin/Help");
}));
help_menu->add_action(GUI::CommonActions::make_about_action("Hex Editor", GUI::Icon::default_icon("app-hex-editor"sv), &window));
help_menu->add_action(GUI::CommonActions::make_about_action("Hex Editor"_string, GUI::Icon::default_icon("app-hex-editor"sv), &window));
return {};
}

View file

@ -369,7 +369,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/ImageViewer.md"), "/bin/Help");
}));
help_menu->add_action(GUI::CommonActions::make_about_action("Image Viewer", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Image Viewer"_string, app_icon, window));
window->show();

View file

@ -95,7 +95,7 @@ ErrorOr<int> 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_about_action("Keyboard Mapper", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Keyboard Mapper"_string, app_icon, window));
window->on_close_request = [&]() -> GUI::Window::CloseRequestDecision {
if (keyboard_mapper_widget->request_close())

View file

@ -177,7 +177,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/Magnifier.md"), "/bin/Help");
}));
help_menu->add_action(GUI::CommonActions::make_about_action("Magnifier", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Magnifier"_string, app_icon, window));
window->show();
window->set_always_on_top(true);

View file

@ -54,7 +54,7 @@ ErrorOr<int> 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_about_action("Mail", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Mail"_string, app_icon, window));
window->on_close_request = [&] {
mail_widget->on_window_close();

View file

@ -80,7 +80,7 @@ ErrorOr<int> 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_about_action("Maps", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Maps"_string, app_icon, window));
// Main toolbar actions
toolbar->add_action(show_users_action);

View file

@ -243,7 +243,7 @@ ErrorOr<void> PDFViewerWidget::initialize_menubar(GUI::Window& window)
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_about_action("PDF Viewer", GUI::Icon::default_icon("app-pdf-viewer"sv), &window));
help_menu->add_action(GUI::CommonActions::make_about_action("PDF Viewer"_string, GUI::Icon::default_icon("app-pdf-viewer"sv), &window));
return {};
}

View file

@ -87,7 +87,7 @@ ErrorOr<int> 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_about_action("Partition Editor", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Partition Editor"_string, app_icon, window));
window->show();
return app->exec();

View file

@ -88,7 +88,7 @@ ErrorOr<int> 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_about_action("Piano", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Piano"_string, app_icon, window));
window->show();

View file

@ -1164,7 +1164,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
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_about_action("Pixel Paint", GUI::Icon::default_icon("app-pixel-paint"sv), &window));
help_menu->add_action(GUI::CommonActions::make_about_action("Pixel Paint"_string, GUI::Icon::default_icon("app-pixel-paint"sv), &window));
m_levels_dialog_action = GUI::Action::create(
"Change &Levels...", { Mod_Ctrl, Key_L }, g_icon_bag.levels, [&](auto&) {

View file

@ -118,7 +118,7 @@ ErrorOr<void> PresenterWidget::initialize_menubar()
update_slides_actions();
auto help_menu = window->add_menu("&Help"_string);
help_menu->add_action(GUI::CommonActions::make_about_action("Presenter", GUI::Icon::default_icon("app-presenter"sv)));
help_menu->add_action(GUI::CommonActions::make_about_action("Presenter"_string, GUI::Icon::default_icon("app-presenter"sv)));
return {};
}

View file

@ -99,7 +99,7 @@ ErrorOr<int> 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_about_action("Settings", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Settings"_string, app_icon, window));
auto main_widget = TRY(window->set_main_widget<GUI::Widget>());
main_widget->set_fill_with_background_color(true);

View file

@ -165,7 +165,7 @@ ErrorOr<int> 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_about_action("Sound Player", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Sound Player"_string, app_icon, window));
window->show();
return app->exec();

View file

@ -26,7 +26,7 @@
#include <LibGfx/Bitmap.h>
#include <LibMain/Main.h>
static constexpr auto APP_NAME = "Space Analyzer"sv;
static auto const APP_NAME = "Space Analyzer"_string;
static DeprecatedString get_absolute_path_to_selected_node(SpaceAnalyzer::TreeMapWidget const& tree_map_widget, bool include_last_node = true)
{
@ -48,7 +48,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
// Configure application window.
auto app_icon = GUI::Icon::default_icon("app-space-analyzer"sv);
auto window = TRY(GUI::Window::try_create());
window->set_title(APP_NAME);
window->set_title(APP_NAME.bytes_as_string_view());
window->resize(640, 480);
window->set_icon(app_icon.bitmap_for_size(16));

View file

@ -293,7 +293,7 @@ SpreadsheetWidget::SpreadsheetWidget(GUI::Window& parent_window, Vector<NonnullR
m_search_action = GUI::CommonActions::make_command_palette_action(&parent_window);
m_about_action = GUI::CommonActions::make_about_action("Spreadsheet", GUI::Icon::default_icon("app-spreadsheet"sv), &parent_window);
m_about_action = GUI::CommonActions::make_about_action("Spreadsheet"_string, GUI::Icon::default_icon("app-spreadsheet"sv), &parent_window);
toolbar.add_action(*m_new_action);
toolbar.add_action(*m_open_action);

View file

@ -468,7 +468,7 @@ ErrorOr<int> 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_about_action("System Monitor", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("System Monitor"_string, app_icon, window));
process_table_view.on_activation = [&](auto&) {
if (process_properties_action->is_enabled())

View file

@ -423,7 +423,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/Terminal.md"), "/bin/Help");
}));
help_menu->add_action(GUI::CommonActions::make_about_action("Terminal", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Terminal"_string, app_icon, window));
window->on_close_request = [&]() -> GUI::Window::CloseRequestDecision {
if (check_terminal_quit() == GUI::MessageBox::ExecResult::OK)

View file

@ -694,7 +694,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/TextEditor.md"), "/bin/Help");
}));
help_menu->add_action(GUI::CommonActions::make_about_action("Text Editor", GUI::Icon::default_icon("app-text-editor"sv), &window));
help_menu->add_action(GUI::CommonActions::make_about_action("Text Editor"_string, GUI::Icon::default_icon("app-text-editor"sv), &window));
auto wrapping_statusbar_menu = m_line_column_statusbar_menu->add_submenu("&Wrapping Mode"_string);
wrapping_statusbar_menu->add_action(*m_no_wrapping_action);

View file

@ -309,7 +309,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
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_about_action("Theme Editor", GUI::Icon::default_icon("app-theme-editor"sv), &window));
help_menu->add_action(GUI::CommonActions::make_about_action("Theme Editor"_string, GUI::Icon::default_icon("app-theme-editor"sv), &window));
return {};
}

View file

@ -428,7 +428,7 @@ ErrorOr<void> VideoPlayerWidget::initialize_menubar(GUI::Window& window)
// Help menu
auto help_menu = window.add_menu("&Help"_string);
help_menu->add_action(GUI::CommonActions::make_about_action("Video Player", TRY(GUI::Icon::try_create_default_icon("app-video-player"sv)), &window));
help_menu->add_action(GUI::CommonActions::make_about_action("Video Player"_string, TRY(GUI::Icon::try_create_default_icon("app-video-player"sv)), &window));
return {};
}

View file

@ -45,7 +45,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
catdog_widget->set_layout<GUI::VerticalBoxLayout>(GUI::Margins {}, 0);
auto context_menu = TRY(GUI::Menu::try_create());
context_menu->add_action(GUI::CommonActions::make_about_action("CatDog Demo", app_icon, window));
context_menu->add_action(GUI::CommonActions::make_about_action("CatDog Demo"_string, app_icon, window));
context_menu->add_separator();
context_menu->add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));

View file

@ -94,7 +94,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/Eyes.md"), "/bin/Help");
}));
help_menu->add_action(GUI::CommonActions::make_about_action("Eyes Demo", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Eyes Demo"_string, app_icon, window));
auto eyes_widget = TRY(window->set_main_widget<EyesWidget>(num_eyes, full_rows, extra_columns));
eyes_widget->on_context_menu_request = [&](auto& event) {

View file

@ -476,7 +476,7 @@ ErrorOr<int> 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_about_action("Mandelbrot Demo", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Mandelbrot Demo"_string, app_icon, window));
window->show();
window->set_cursor(Gfx::StandardCursor::Zoom);

View file

@ -83,7 +83,7 @@ ErrorOr<int> 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_about_action("Screensaver", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Screensaver"_string, app_icon, window));
auto main_widget = TRY(window->set_main_widget<GUI::Widget>());
main_widget->set_fill_with_background_color(true);

View file

@ -277,7 +277,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/GMLPlayground.md"), "/bin/Help");
}));
help_menu->add_action(GUI::CommonActions::make_about_action("GML Playground", m_icon, &window));
help_menu->add_action(GUI::CommonActions::make_about_action("GML Playground"_string, m_icon, &window));
m_toolbar->add_action(open_action);
m_toolbar->add_action(*m_save_action);

View file

@ -1583,7 +1583,7 @@ void HackStudioWidget::create_help_menu(GUI::Window& window)
{
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_about_action("Hack Studio", GUI::Icon::default_icon("app-hack-studio"sv), &window));
help_menu->add_action(GUI::CommonActions::make_about_action("Hack Studio"_string, GUI::Icon::default_icon("app-hack-studio"sv), &window));
}
ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_stop_action()

View file

@ -305,7 +305,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/Profiler.md"), "/bin/Help");
}));
help_menu->add_action(GUI::CommonActions::make_about_action("Profiler", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Profiler"_string, app_icon, window));
window->show();
return app->exec();

View file

@ -327,7 +327,7 @@ ErrorOr<void> MainWidget::initialize_menu(GUI::Window* window)
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/SQLStudio.md"), "/bin/Help");
}));
help_menu->add_action(GUI::CommonActions::make_about_action("SQL Studio", GUI::Icon::default_icon("app-sql-studio"sv), window));
help_menu->add_action(GUI::CommonActions::make_about_action("SQL Studio"_string, GUI::Icon::default_icon("app-sql-studio"sv), window));
return {};
}

View file

@ -221,7 +221,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/2048.md"), "/bin/Help");
}));
help_menu->add_action(GUI::CommonActions::make_about_action("2048", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("2048"_string, app_icon, window));
window->show();

View file

@ -26,7 +26,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto app = TRY(GUI::Application::create(arguments));
auto const app_name = "BrickGame"sv;
auto const title = "Brick Game"sv;
auto const title = "Brick Game"_string;
auto const man_file = "/usr/share/man/man6/BrickGame.md"sv;
Config::pledge_domain(app_name);
@ -45,7 +45,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto window = TRY(GUI::Window::try_create());
window->set_double_buffering_enabled(false);
window->set_title(title);
window->set_title(title.bytes_as_string_view());
window->resize(360, 462);
window->set_resizable(false);

View file

@ -198,7 +198,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/Chess.md"), "/bin/Help");
}));
help_menu->add_action(GUI::CommonActions::make_about_action("Chess", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Chess"_string, app_icon, window));
window->show();
widget->reset();

View file

@ -25,7 +25,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto app = TRY(GUI::Application::create(arguments));
auto const app_name = "ColorLines"sv;
auto const title = "Color Lines"sv;
auto const title = "Color Lines"_string;
auto const man_file = "/usr/share/man/man6/ColorLines.md"sv;
Config::pledge_domain(app_name);
@ -44,7 +44,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto window = TRY(GUI::Window::try_create());
window->set_double_buffering_enabled(false);
window->set_title(title);
window->set_title(title.bytes_as_string_view());
window->resize(436, 481);
window->set_resizable(false);

View file

@ -65,7 +65,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/FlappyBug.md"), "/bin/Help");
}));
help_menu->add_action(GUI::CommonActions::make_about_action("Flappy Bug", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Flappy Bug"_string, app_icon, window));
window->show();

View file

@ -192,7 +192,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/Flood.md"), "/bin/Help");
}));
help_menu->add_action(GUI::CommonActions::make_about_action("Flood", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Flood"_string, app_icon, window));
window->show();

View file

@ -150,7 +150,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/GameOfLife.md"), "/bin/Help");
}));
help_menu->add_action(GUI::CommonActions::make_about_action("Game of Life", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Game of Life"_string, app_icon, window));
board_widget->on_running_state_change = [&]() {
if (board_widget->is_running()) {

View file

@ -103,7 +103,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/Hearts.md"), "/bin/Help");
}));
help_menu->add_action(GUI::CommonActions::make_about_action("Hearts", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Hearts"_string, app_icon, window));
window->set_resizable(false);
window->resize(Hearts::Game::width, Hearts::Game::height + statusbar.max_height().as_int());

View file

@ -132,7 +132,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/MasterWord.md"), "/bin/Help");
}));
help_menu->add_action(GUI::CommonActions::make_about_action("MasterWord", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("MasterWord"_string, app_icon, window));
game.on_message = [&](auto message) {
if (!message.has_value())

View file

@ -123,7 +123,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/Minesweeper.md"), "/bin/Help");
}));
help_menu->add_action(GUI::CommonActions::make_about_action("Minesweeper", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Minesweeper"_string, app_icon, window));
window->show();

View file

@ -156,7 +156,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/Snake.md"), "/bin/Help");
}));
help_menu->add_action(GUI::CommonActions::make_about_action("Snake", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Snake"_string, app_icon, window));
window->show();

View file

@ -222,7 +222,7 @@ ErrorOr<int> 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_about_action("Solitaire", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Solitaire"_string, app_icon, 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");

View file

@ -279,7 +279,7 @@ ErrorOr<int> 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_about_action("Spider", app_icon, window));
help_menu->add_action(GUI::CommonActions::make_about_action("Spider"_string, app_icon, window));
window->set_resizable(false);
window->resize(Spider::Game::width, Spider::Game::height + statusbar.max_height().as_int());

View file

@ -19,7 +19,7 @@
namespace GUI {
NonnullRefPtr<AboutDialog> AboutDialog::create(String name, String version, RefPtr<Gfx::Bitmap const> icon, Window* parent_window)
NonnullRefPtr<AboutDialog> AboutDialog::create(String const& name, String version, RefPtr<Gfx::Bitmap const> icon, Window* parent_window)
{
auto dialog = adopt_ref(*new AboutDialog(name, version, icon, parent_window));
dialog->set_title(DeprecatedString::formatted("About {}", name));
@ -49,9 +49,9 @@ NonnullRefPtr<AboutDialog> AboutDialog::create(String name, String version, RefP
return dialog;
}
AboutDialog::AboutDialog(String name, String version, RefPtr<Gfx::Bitmap const> icon, Window* parent_window)
AboutDialog::AboutDialog(String const& name, String version, RefPtr<Gfx::Bitmap const> icon, Window* parent_window)
: Dialog(parent_window)
, m_name(move(name))
, m_name(name)
, m_version_string(move(version))
, m_icon(move(icon))
{

View file

@ -16,13 +16,13 @@ namespace GUI {
class AboutDialog final : public Dialog {
C_OBJECT_ABSTRACT(AboutDialog)
public:
[[nodiscard]] static NonnullRefPtr<AboutDialog> create(String name, String version, RefPtr<Gfx::Bitmap const> icon = nullptr, Window* parent_window = nullptr);
[[nodiscard]] static NonnullRefPtr<AboutDialog> create(String const& name, String version, RefPtr<Gfx::Bitmap const> icon = nullptr, Window* parent_window = nullptr);
virtual ~AboutDialog() override = default;
static void show(String name, String version, RefPtr<Gfx::Bitmap const> icon = nullptr, Window* parent_window = nullptr, RefPtr<Gfx::Bitmap const> window_icon = nullptr);
private:
AboutDialog(String name, String version, RefPtr<Gfx::Bitmap const> icon = nullptr, Window* parent_window = nullptr);
AboutDialog(String const& name, String version, RefPtr<Gfx::Bitmap const> icon = nullptr, Window* parent_window = nullptr);
String m_name;
String m_version_string;

View file

@ -24,7 +24,7 @@
namespace GUI {
namespace CommonActions {
NonnullRefPtr<Action> make_about_action(DeprecatedString const& app_name, Icon const& app_icon, Window* parent = nullptr);
NonnullRefPtr<Action> make_about_action(String const& app_name, Icon const& app_icon, Window* parent = nullptr);
NonnullRefPtr<Action> make_open_action(Function<void(Action&)>, Core::EventReceiver* parent = nullptr);
NonnullRefPtr<Action> make_save_action(Function<void(Action&)>, Core::EventReceiver* parent = nullptr);
NonnullRefPtr<Action> make_save_as_action(Function<void(Action&)>, Core::EventReceiver* parent = nullptr);

View file

@ -17,12 +17,12 @@ namespace GUI {
namespace CommonActions {
NonnullRefPtr<Action> make_about_action(DeprecatedString const& app_name, Icon const& app_icon, Window* parent)
NonnullRefPtr<Action> make_about_action(String const& app_name, Icon const& app_icon, Window* parent)
{
auto weak_parent = AK::make_weak_ptr_if_nonnull<Window>(parent);
auto action = Action::create(DeprecatedString::formatted("&About {}", app_name), app_icon.bitmap_for_size(16), [=](auto&) {
AboutDialog::show(
String::from_deprecated_string(app_name).release_value_but_fixme_should_propagate_errors(),
app_name,
Core::Version::read_long_version_string().release_value_but_fixme_should_propagate_errors(),
app_icon.bitmap_for_size(32),
weak_parent);