1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:27:45 +00:00

LibGUI+Userland: Port Action status tips to String

This commit is contained in:
Karol Kosek 2023-06-04 11:22:04 +02:00 committed by Sam Atkins
parent 4b169cf25f
commit 5234a30731
16 changed files with 86 additions and 85 deletions

View file

@ -214,9 +214,9 @@ void BrowserWindow::build_menus()
m_go_back_action = GUI::CommonActions::make_go_back_action([this](auto&) { active_tab().go_back(); }, this);
m_go_forward_action = GUI::CommonActions::make_go_forward_action([this](auto&) { active_tab().go_forward(); }, this);
m_go_home_action = GUI::CommonActions::make_go_home_action([this](auto&) { active_tab().load(Browser::url_from_user_input(g_home_url)); }, this);
m_go_home_action->set_status_tip("Go to home page");
m_go_home_action->set_status_tip("Go to home page"_string.release_value_but_fixme_should_propagate_errors());
m_reload_action = GUI::CommonActions::make_reload_action([this](auto&) { active_tab().reload(); }, this);
m_reload_action->set_status_tip("Reload current page");
m_reload_action->set_status_tip("Reload current page"_string.release_value_but_fixme_should_propagate_errors());
auto& go_menu = add_menu("&Go"_short_string);
go_menu.add_action(*m_go_back_action);
@ -241,21 +241,21 @@ void BrowserWindow::build_menus()
active_tab().view().get_source();
},
this);
m_view_source_action->set_status_tip("View source code of the current page");
m_view_source_action->set_status_tip("View source code of the current page"_string.release_value_but_fixme_should_propagate_errors());
m_inspect_dom_tree_action = GUI::Action::create(
"Inspect &DOM Tree", { Mod_None, Key_F12 }, g_icon_bag.dom_tree, [this](auto&) {
active_tab().show_inspector_window(Tab::InspectorTarget::Document);
},
this);
m_inspect_dom_tree_action->set_status_tip("Open inspector window for this page");
m_inspect_dom_tree_action->set_status_tip("Open inspector window for this page"_string.release_value_but_fixme_should_propagate_errors());
m_inspect_dom_node_action = GUI::Action::create(
"&Inspect Element", g_icon_bag.inspect, [this](auto&) {
active_tab().show_inspector_window(Tab::InspectorTarget::HoveredElement);
},
this);
m_inspect_dom_node_action->set_status_tip("Open inspector for this element");
m_inspect_dom_node_action->set_status_tip("Open inspector for this element"_string.release_value_but_fixme_should_propagate_errors());
auto& inspect_menu = add_menu("&Inspect"_string.release_value_but_fixme_should_propagate_errors());
inspect_menu.add_action(*m_view_source_action);
@ -266,7 +266,7 @@ void BrowserWindow::build_menus()
active_tab().show_console_window();
},
this);
js_console_action->set_status_tip("Open JavaScript console for this page");
js_console_action->set_status_tip("Open JavaScript console for this page"_string.release_value_but_fixme_should_propagate_errors());
inspect_menu.add_action(js_console_action);
auto storage_window_action = GUI::Action::create(
@ -274,7 +274,7 @@ void BrowserWindow::build_menus()
active_tab().show_storage_inspector();
},
this);
storage_window_action->set_status_tip("Show Storage inspector for this page");
storage_window_action->set_status_tip("Show Storage inspector for this page"_string.release_value_but_fixme_should_propagate_errors());
inspect_menu.add_action(storage_window_action);
auto history_window_action = GUI::Action::create(
@ -282,7 +282,7 @@ void BrowserWindow::build_menus()
active_tab().show_history_inspector();
},
this);
storage_window_action->set_status_tip("Show History inspector for this tab");
storage_window_action->set_status_tip("Show History inspector for this tab"_string.release_value_but_fixme_should_propagate_errors());
inspect_menu.add_action(history_window_action);
auto& settings_menu = add_menu("&Settings"_string.release_value_but_fixme_should_propagate_errors());
@ -403,26 +403,26 @@ void BrowserWindow::build_menus()
m_disable_user_agent_spoofing = GUI::Action::create_checkable("Disabled", [this](auto&) {
active_tab().view().debug_request("spoof-user-agent", Web::default_user_agent);
});
m_disable_user_agent_spoofing->set_status_tip(Web::default_user_agent);
m_disable_user_agent_spoofing->set_status_tip(String::from_utf8(Web::default_user_agent).release_value_but_fixme_should_propagate_errors());
spoof_user_agent_menu.add_action(*m_disable_user_agent_spoofing);
spoof_user_agent_menu.set_icon(g_icon_bag.spoof);
m_user_agent_spoof_actions.add_action(*m_disable_user_agent_spoofing);
m_disable_user_agent_spoofing->set_checked(true);
auto add_user_agent = [this, &spoof_user_agent_menu](auto& name, auto& user_agent) {
auto add_user_agent = [this, &spoof_user_agent_menu](auto& name, auto user_agent) {
auto action = GUI::Action::create_checkable(name, [this, user_agent](auto&) {
active_tab().view().debug_request("spoof-user-agent", user_agent);
});
action->set_status_tip(user_agent);
action->set_status_tip(String::from_utf8(user_agent).release_value_but_fixme_should_propagate_errors());
spoof_user_agent_menu.add_action(action);
m_user_agent_spoof_actions.add_action(action);
};
add_user_agent("Chrome Linux Desktop", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36");
add_user_agent("Firefox Linux Desktop", "Mozilla/5.0 (X11; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0");
add_user_agent("Safari macOS Desktop", "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15");
add_user_agent("Chrome Android Mobile", "Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.66 Mobile Safari/537.36");
add_user_agent("Firefox Android Mobile", "Mozilla/5.0 (Android 11; Mobile; rv:68.0) Gecko/68.0 Firefox/86.0");
add_user_agent("Safari iOS Mobile", "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1");
add_user_agent("Chrome Linux Desktop", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36"sv);
add_user_agent("Firefox Linux Desktop", "Mozilla/5.0 (X11; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0"sv);
add_user_agent("Safari macOS Desktop", "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15"sv);
add_user_agent("Chrome Android Mobile", "Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.66 Mobile Safari/537.36"sv);
add_user_agent("Firefox Android Mobile", "Mozilla/5.0 (Android 11; Mobile; rv:68.0) Gecko/68.0 Firefox/86.0"sv);
add_user_agent("Safari iOS Mobile", "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1"sv);
auto custom_user_agent = GUI::Action::create_checkable("Custom...", [this](auto& action) {
String user_agent;
@ -431,7 +431,7 @@ void BrowserWindow::build_menus()
return;
}
active_tab().view().debug_request("spoof-user-agent", user_agent.to_deprecated_string());
action.set_status_tip(user_agent.to_deprecated_string());
action.set_status_tip(user_agent);
});
spoof_user_agent_menu.add_action(custom_user_agent);
m_user_agent_spoof_actions.add_action(custom_user_agent);
@ -510,7 +510,7 @@ ErrorOr<void> BrowserWindow::load_search_engines(GUI::Menu& settings_menu)
action->set_checked(true);
search_engine_set = true;
}
action->set_status_tip(url_format);
action->set_status_tip(TRY(String::from_deprecated_string(url_format)));
}
}
}
@ -531,14 +531,14 @@ ErrorOr<void> BrowserWindow::load_search_engines(GUI::Menu& settings_menu)
g_search_engine = search_engine.to_deprecated_string();
Config::write_string("Browser"sv, "Preferences"sv, "SearchEngine"sv, g_search_engine);
action.set_status_tip(search_engine.to_deprecated_string());
action.set_status_tip(search_engine);
});
search_engine_menu.add_action(custom_search_engine_action);
m_search_engine_actions.add_action(custom_search_engine_action);
if (!search_engine_set && !g_search_engine.is_empty()) {
custom_search_engine_action->set_checked(true);
custom_search_engine_action->set_status_tip(g_search_engine);
custom_search_engine_action->set_status_tip(TRY(String::from_deprecated_string(g_search_engine)));
}
return {};

View file

@ -562,7 +562,7 @@ Tab::Tab(BrowserWindow& window)
}
},
this);
take_visible_screenshot_action->set_status_tip("Save a screenshot of the visible portion of the current tab to the Downloads directory"sv);
take_visible_screenshot_action->set_status_tip("Save a screenshot of the visible portion of the current tab to the Downloads directory"_string.release_value_but_fixme_should_propagate_errors());
auto take_full_screenshot_action = GUI::Action::create(
"Take &Full Screenshot"sv, g_icon_bag.filetype_image, [this](auto&) {
@ -572,7 +572,7 @@ Tab::Tab(BrowserWindow& window)
}
},
this);
take_full_screenshot_action->set_status_tip("Save a screenshot of the entirety of the current tab to the Downloads directory"sv);
take_full_screenshot_action->set_status_tip("Save a screenshot of the entirety of the current tab to the Downloads directory"_string.release_value_but_fixme_should_propagate_errors());
m_page_context_menu = GUI::Menu::construct();
m_page_context_menu->add_action(window.go_back_action());

View file

@ -31,7 +31,7 @@ WindowActions::WindowActions(GUI::Window& window)
on_create_new_tab();
},
&window);
m_create_new_tab_action->set_status_tip("Open a new tab");
m_create_new_tab_action->set_status_tip("Open a new tab"_string.release_value_but_fixme_should_propagate_errors());
m_create_new_window_action = GUI::Action::create(
"&New Window", { Mod_Ctrl, Key_N }, g_icon_bag.new_window, [this](auto&) {
@ -40,7 +40,7 @@ WindowActions::WindowActions(GUI::Window& window)
}
},
&window);
m_create_new_window_action->set_status_tip("Open a new browser window");
m_create_new_window_action->set_status_tip("Open a new browser window"_string.release_value_but_fixme_should_propagate_errors());
m_next_tab_action = GUI::Action::create(
"&Next Tab", { Mod_Ctrl, Key_PageDown }, [this](auto&) {
@ -48,7 +48,7 @@ WindowActions::WindowActions(GUI::Window& window)
on_next_tab();
},
&window);
m_next_tab_action->set_status_tip("Switch to the next tab");
m_next_tab_action->set_status_tip("Switch to the next tab"_string.release_value_but_fixme_should_propagate_errors());
m_previous_tab_action = GUI::Action::create(
"&Previous Tab", { Mod_Ctrl, Key_PageUp }, [this](auto&) {
@ -56,7 +56,7 @@ WindowActions::WindowActions(GUI::Window& window)
on_previous_tab();
},
&window);
m_previous_tab_action->set_status_tip("Switch to the previous tab");
m_previous_tab_action->set_status_tip("Switch to the previous tab"_string.release_value_but_fixme_should_propagate_errors());
for (auto i = 0; i <= 7; ++i) {
m_tab_actions.append(GUI::Action::create(
@ -65,7 +65,7 @@ WindowActions::WindowActions(GUI::Window& window)
on_tabs[i]();
},
&window));
m_tab_actions.last()->set_status_tip(DeprecatedString::formatted("Switch to tab {}", i + 1));
m_tab_actions.last()->set_status_tip(String::formatted("Switch to tab {}", i + 1).release_value_but_fixme_should_propagate_errors());
}
m_tab_actions.append(GUI::Action::create(
"Last tab", { Mod_Ctrl, Key_9 }, [this](auto&) {
@ -73,7 +73,7 @@ WindowActions::WindowActions(GUI::Window& window)
on_tabs[8]();
},
&window));
m_tab_actions.last()->set_status_tip("Switch to last tab");
m_tab_actions.last()->set_status_tip("Switch to last tab"_string.release_value_but_fixme_should_propagate_errors());
m_about_action = GUI::CommonActions::make_about_action("Ladybird", GUI::Icon::default_icon("app-browser"sv), &window);
@ -84,7 +84,7 @@ WindowActions::WindowActions(GUI::Window& window)
on_show_bookmarks_bar(action);
},
&window);
m_show_bookmarks_bar_action->set_status_tip("Show/hide the bookmarks bar");
m_show_bookmarks_bar_action->set_status_tip("Show/hide the bookmarks bar"_string.release_value_but_fixme_should_propagate_errors());
m_vertical_tabs_action = GUI::Action::create_checkable(
"&Vertical Tabs", { Mod_Ctrl, Key_Comma },
@ -93,7 +93,7 @@ WindowActions::WindowActions(GUI::Window& window)
on_vertical_tabs(action);
},
&window);
m_vertical_tabs_action->set_status_tip("Enable/Disable vertical tabs");
m_vertical_tabs_action->set_status_tip("Enable/Disable vertical tabs"_string.release_value_but_fixme_should_propagate_errors());
}
}

View file

@ -56,17 +56,17 @@ CharacterMapWidget::CharacterMapWidget()
}
GUI::Clipboard::the().set_plain_text(builder.to_deprecated_string());
});
m_copy_selection_action->set_status_tip("Copy the highlighted characters to the clipboard");
m_copy_selection_action->set_status_tip("Copy the highlighted characters to the clipboard"_string.release_value_but_fixme_should_propagate_errors());
m_previous_glyph_action = GUI::Action::create("&Previous Glyph", { Mod_Alt, Key_Left }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-back.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
m_glyph_map->select_previous_existing_glyph();
});
m_previous_glyph_action->set_status_tip("Seek the previous visible glyph");
m_previous_glyph_action->set_status_tip("Seek the previous visible glyph"_string.release_value_but_fixme_should_propagate_errors());
m_next_glyph_action = GUI::Action::create("&Next Glyph", { Mod_Alt, Key_Right }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
m_glyph_map->select_next_existing_glyph();
});
m_next_glyph_action->set_status_tip("Seek the next visible glyph");
m_next_glyph_action->set_status_tip("Seek the next visible glyph"_string.release_value_but_fixme_should_propagate_errors());
m_go_to_glyph_action = GUI::Action::create("&Go to Glyph...", { Mod_Ctrl, Key_G }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-to.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
String input;
@ -81,7 +81,7 @@ CharacterMapWidget::CharacterMapWidget()
m_glyph_map->scroll_to_glyph(code_point);
}
});
m_go_to_glyph_action->set_status_tip("Go to the specified code point");
m_go_to_glyph_action->set_status_tip("Go to the specified code point"_string.release_value_but_fixme_should_propagate_errors());
m_find_glyphs_action = GUI::Action::create("&Find Glyphs...", { Mod_Ctrl, Key_F }, Gfx::Bitmap::load_from_file("/res/icons/16x16/find.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
if (m_find_window.is_null()) {

View file

@ -128,7 +128,7 @@ ErrorOr<void> MainWidget::create_actions()
if (auto result = initialize({}, move(maybe_font.value())); result.is_error())
show_error(result.release_error(), "Initializing new font failed"sv);
});
m_new_action->set_status_tip("Create a new font");
m_new_action->set_status_tip(TRY("Create a new font"_string));
m_open_action = GUI::CommonActions::make_open_action([this](auto&) {
if (!request_close())
@ -221,7 +221,7 @@ ErrorOr<void> MainWidget::create_actions()
if (m_font_preview_window)
m_font_preview_window->show();
});
m_open_preview_action->set_status_tip("Preview the current font");
m_open_preview_action->set_status_tip(TRY("Preview the current font"_string));
bool show_metadata = Config::read_bool("FontEditor"sv, "Layout"sv, "ShowMetadata"sv, true);
m_font_metadata_groupbox->set_visible(show_metadata);
@ -230,7 +230,7 @@ ErrorOr<void> MainWidget::create_actions()
Config::write_bool("FontEditor"sv, "Layout"sv, "ShowMetadata"sv, action.is_checked());
});
m_show_metadata_action->set_checked(show_metadata);
m_show_metadata_action->set_status_tip("Show or hide metadata about the current font");
m_show_metadata_action->set_status_tip(TRY("Show or hide metadata about the current font"_string));
bool show_unicode_blocks = Config::read_bool("FontEditor"sv, "Layout"sv, "ShowUnicodeBlocks"sv, true);
m_unicode_block_container->set_visible(show_unicode_blocks);
@ -243,7 +243,7 @@ ErrorOr<void> MainWidget::create_actions()
Config::write_bool("FontEditor"sv, "Layout"sv, "ShowUnicodeBlocks"sv, action.is_checked());
});
m_show_unicode_blocks_action->set_checked(show_unicode_blocks);
m_show_unicode_blocks_action->set_status_tip("Show or hide the Unicode block list");
m_show_unicode_blocks_action->set_status_tip(TRY("Show or hide the Unicode block list"_string));
bool show_toolbar = Config::read_bool("FontEditor"sv, "Layout"sv, "ShowToolbar"sv, true);
m_toolbar_container->set_visible(show_toolbar);
@ -252,7 +252,7 @@ ErrorOr<void> MainWidget::create_actions()
Config::write_bool("FontEditor"sv, "Layout"sv, "ShowToolbar"sv, action.is_checked());
});
m_show_toolbar_action->set_checked(show_toolbar);
m_show_toolbar_action->set_status_tip("Show or hide the toolbar");
m_show_toolbar_action->set_status_tip(TRY("Show or hide the toolbar"_string));
bool show_statusbar = Config::read_bool("FontEditor"sv, "Layout"sv, "ShowStatusbar"sv, true);
m_statusbar->set_visible(show_statusbar);
@ -262,7 +262,7 @@ ErrorOr<void> MainWidget::create_actions()
Config::write_bool("FontEditor"sv, "Layout"sv, "ShowStatusbar"sv, action.is_checked());
});
m_show_statusbar_action->set_checked(show_statusbar);
m_show_statusbar_action->set_status_tip("Show or hide the status bar");
m_show_statusbar_action->set_status_tip(TRY("Show or hide the status bar"_string));
bool highlight_modifications = Config::read_bool("FontEditor"sv, "GlyphMap"sv, "HighlightModifications"sv, true);
m_glyph_map_widget->set_highlight_modifications(highlight_modifications);
@ -271,7 +271,7 @@ ErrorOr<void> MainWidget::create_actions()
Config::write_bool("FontEditor"sv, "GlyphMap"sv, "HighlightModifications"sv, action.is_checked());
});
m_highlight_modifications_action->set_checked(highlight_modifications);
m_highlight_modifications_action->set_status_tip("Show or hide highlights on modified glyphs");
m_highlight_modifications_action->set_status_tip(TRY("Show or hide highlights on modified glyphs"_string));
bool show_system_emoji = Config::read_bool("FontEditor"sv, "GlyphMap"sv, "ShowSystemEmoji"sv, true);
m_glyph_map_widget->set_show_system_emoji(show_system_emoji);
@ -280,7 +280,7 @@ ErrorOr<void> MainWidget::create_actions()
Config::write_bool("FontEditor"sv, "GlyphMap"sv, "ShowSystemEmoji"sv, action.is_checked());
});
m_show_system_emoji_action->set_checked(show_system_emoji);
m_show_system_emoji_action->set_status_tip("Show or hide system emoji");
m_show_system_emoji_action->set_status_tip(TRY("Show or hide system emoji"_string));
m_go_to_glyph_action = GUI::Action::create("&Go to Glyph...", { Mod_Ctrl, Key_G }, g_resources.go_to_glyph, [this](auto&) {
String input;
@ -296,17 +296,17 @@ ErrorOr<void> MainWidget::create_actions()
m_glyph_map_widget->scroll_to_glyph(code_point);
}
});
m_go_to_glyph_action->set_status_tip("Go to the specified code point");
m_go_to_glyph_action->set_status_tip(TRY("Go to the specified code point"_string));
m_previous_glyph_action = GUI::Action::create("Pre&vious Glyph", { Mod_Alt, Key_Left }, g_resources.previous_glyph, [this](auto&) {
m_glyph_map_widget->select_previous_existing_glyph();
});
m_previous_glyph_action->set_status_tip("Seek the previous visible glyph");
m_previous_glyph_action->set_status_tip(TRY("Seek the previous visible glyph"_string));
m_next_glyph_action = GUI::Action::create("&Next Glyph", { Mod_Alt, Key_Right }, g_resources.next_glyph, [this](auto&) {
m_glyph_map_widget->select_next_existing_glyph();
});
m_next_glyph_action->set_status_tip("Seek the next visible glyph");
m_next_glyph_action->set_status_tip(TRY("Seek the next visible glyph"_string));
i32 scale = Config::read_i32("FontEditor"sv, "GlyphEditor"sv, "Scale"sv, 10);
m_glyph_editor_widget->set_scale(scale);
@ -314,17 +314,17 @@ ErrorOr<void> MainWidget::create_actions()
set_scale_and_save(5);
});
m_scale_five_action->set_checked(scale == 5);
m_scale_five_action->set_status_tip("Scale the editor in proportion to the current font");
m_scale_five_action->set_status_tip(TRY("Scale the editor in proportion to the current font"_string));
m_scale_ten_action = GUI::Action::create_checkable("1000%", { Mod_Ctrl, Key_2 }, [this](auto&) {
set_scale_and_save(10);
});
m_scale_ten_action->set_checked(scale == 10);
m_scale_ten_action->set_status_tip("Scale the editor in proportion to the current font");
m_scale_ten_action->set_status_tip(TRY("Scale the editor in proportion to the current font"_string));
m_scale_fifteen_action = GUI::Action::create_checkable("1500%", { Mod_Ctrl, Key_3 }, [this](auto&) {
set_scale_and_save(15);
});
m_scale_fifteen_action->set_checked(scale == 15);
m_scale_fifteen_action->set_status_tip("Scale the editor in proportion to the current font");
m_scale_fifteen_action->set_status_tip(TRY("Scale the editor in proportion to the current font"_string));
m_glyph_editor_scale_actions.add_action(*m_scale_five_action);
m_glyph_editor_scale_actions.add_action(*m_scale_ten_action);
@ -370,7 +370,7 @@ ErrorOr<void> MainWidget::create_actions()
}
GUI::Clipboard::the().set_plain_text(builder.to_deprecated_string());
});
m_copy_text_action->set_status_tip("Copy to clipboard as text");
m_copy_text_action->set_status_tip(TRY("Copy to clipboard as text"_string));
return {};
}

View file

@ -79,7 +79,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto auto_modifier_action = GUI::Action::create("Auto-Modifier", [&](auto& act) {
keyboard_mapper_widget->set_automatic_modifier(act.is_checked());
});
auto_modifier_action->set_status_tip("Toggle automatic modifier");
auto_modifier_action->set_status_tip(TRY("Toggle automatic modifier"_string));
auto_modifier_action->set_checkable(true);
auto_modifier_action->set_checked(false);

View file

@ -323,12 +323,12 @@ void PDFViewerWidget::initialize_toolbar(GUI::Toolbar& toolbar)
m_page_view_mode_single = GUI::Action::create_checkable("Single", [&](auto&) {
m_viewer->set_page_view_mode(PDFViewer::PageViewMode::Single);
});
m_page_view_mode_single->set_status_tip("Show single page at a time");
m_page_view_mode_single->set_status_tip("Show single page at a time"_string.release_value_but_fixme_should_propagate_errors());
m_page_view_mode_multiple = GUI::Action::create_checkable("Multiple", [&](auto&) {
m_viewer->set_page_view_mode(PDFViewer::PageViewMode::Multiple);
});
m_page_view_mode_multiple->set_status_tip("Show multiple pages at a time");
m_page_view_mode_multiple->set_status_tip("Show multiple pages at a time"_string.release_value_but_fixme_should_propagate_errors());
if (m_viewer->page_view_mode() == PDFViewer::PageViewMode::Single) {
m_page_view_mode_single->set_checked(true);

View file

@ -455,7 +455,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
Config::write_i32("SystemMonitor"sv, "Monitor"sv, "Frequency"sv, seconds);
refresh_timer->restart(seconds * 1000);
});
action->set_status_tip(DeprecatedString::formatted("Refresh every {} seconds", seconds));
action->set_status_tip(TRY(String::formatted("Refresh every {} seconds", seconds)));
action->set_checked(frequency == seconds);
frequency_action_group.add_action(*action);
TRY(frequency_menu->try_add_action(*action));

View file

@ -317,7 +317,7 @@ MainWidget::MainWidget()
Desktop::Launcher::open(URL::create_with_file_scheme(lexical_path.dirname(), lexical_path.basename()));
});
m_open_folder_action->set_enabled(!m_path.is_empty());
m_open_folder_action->set_status_tip("Open the current file location in File Manager");
m_open_folder_action->set_status_tip("Open the current file location in File Manager"_string.release_value_but_fixme_should_propagate_errors());
m_toolbar->add_action(*m_new_action);
m_toolbar->add_action(*m_open_action);
@ -557,8 +557,8 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
});
m_visualize_trailing_whitespace_action->set_checked(true);
m_visualize_trailing_whitespace_action->set_status_tip("Visualize trailing whitespace");
m_visualize_leading_whitespace_action->set_status_tip("Visualize leading whitespace");
m_visualize_trailing_whitespace_action->set_status_tip(TRY("Visualize trailing whitespace"_string));
m_visualize_leading_whitespace_action->set_status_tip(TRY("Visualize leading whitespace"_string));
TRY(view_menu->try_add_action(*m_visualize_trailing_whitespace_action));
TRY(view_menu->try_add_action(*m_visualize_leading_whitespace_action));
@ -568,7 +568,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
});
m_cursor_line_highlighting_action->set_checked(true);
m_cursor_line_highlighting_action->set_status_tip("Highlight the current line");
m_cursor_line_highlighting_action->set_status_tip(TRY("Highlight the current line"_string));
TRY(view_menu->try_add_action(*m_cursor_line_highlighting_action));
@ -581,7 +581,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
m_relative_line_number_action->set_checked(show_relative_line_number);
m_editor->set_relative_line_number(show_relative_line_number);
m_relative_line_number_action->set_status_tip("Set relative line number");
m_relative_line_number_action->set_status_tip(TRY("Set relative line number"_string));
TRY(view_menu->try_add_action(*m_relative_line_number_action));