1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:24:57 +00:00

Userland: Make Window::set_main_widget() non-fallible

This commit is contained in:
Tim Ledbetter 2023-09-19 01:13:48 +01:00 committed by Andreas Kling
parent c9297126db
commit 3aa49f268c
120 changed files with 144 additions and 133 deletions

View file

@ -71,14 +71,14 @@ void Tab::start_download(const URL& url)
window->resize(300, 170);
window->set_title(DeprecatedString::formatted("0% of {}", url.basename()));
window->set_resizable(false);
(void)window->set_main_widget<DownloadWidget>(url).release_value_but_fixme_should_propagate_errors();
(void)window->set_main_widget<DownloadWidget>(url);
window->show();
}
void Tab::view_source(const URL& url, DeprecatedString const& source)
{
auto window = GUI::Window::construct(&this->window());
auto editor = window->set_main_widget<GUI::TextEditor>().release_value_but_fixme_should_propagate_errors();
auto editor = window->set_main_widget<GUI::TextEditor>();
editor->set_text(source);
editor->set_mode(GUI::TextEditor::ReadOnly);
editor->set_syntax_highlighter(make<Web::HTML::SyntaxHighlighter>());
@ -877,7 +877,7 @@ void Tab::show_inspector_window(Browser::Tab::InspectorTarget inspector_target)
window->on_close = [&]() {
m_web_content_view->clear_inspected_dom_node();
};
m_dom_inspector_widget = window->set_main_widget<InspectorWidget>().release_value_but_fixme_should_propagate_errors();
m_dom_inspector_widget = window->set_main_widget<InspectorWidget>();
m_dom_inspector_widget->set_web_view(*m_web_content_view);
m_web_content_view->inspect_dom_tree();
m_web_content_view->inspect_accessibility_tree();
@ -918,7 +918,7 @@ void Tab::show_console_window()
console_window->set_title("JS Console");
console_window->set_icon(g_icon_bag.filetype_javascript);
m_console_widget = MUST(console_window->set_main_widget<ConsoleWidget>(view()));
m_console_widget = console_window->set_main_widget<ConsoleWidget>(view());
}
auto* window = m_console_widget->window();
@ -933,7 +933,7 @@ void Tab::show_storage_inspector()
storage_window->resize(500, 300);
storage_window->set_title("Storage Inspector");
storage_window->set_icon(g_icon_bag.cookie);
m_storage_widget = storage_window->set_main_widget<StorageWidget>().release_value_but_fixme_should_propagate_errors();
m_storage_widget = storage_window->set_main_widget<StorageWidget>();
m_storage_widget->on_update_cookie = [this](Web::Cookie::Cookie cookie) {
if (on_update_cookie)
on_update_cookie(move(cookie));
@ -970,7 +970,7 @@ void Tab::show_history_inspector()
history_window->resize(500, 300);
history_window->set_title("History");
history_window->set_icon(g_icon_bag.history);
m_history_widget = history_window->set_main_widget<HistoryWidget>().release_value_but_fixme_should_propagate_errors();
m_history_widget = history_window->set_main_widget<HistoryWidget>();
}
m_history_widget->clear_history_entries();