diff --git a/Base/res/devel/templates/serenity-application/main.cpp b/Base/res/devel/templates/serenity-application/main.cpp index 4059623e6e..6e25794213 100644 --- a/Base/res/devel/templates/serenity-application/main.cpp +++ b/Base/res/devel/templates/serenity-application/main.cpp @@ -19,7 +19,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->resize(200, 200); window->set_resizable(false); - auto main_widget = TRY(window->set_main_widget()); + auto main_widget = window->set_main_widget(); main_widget->set_fill_with_background_color(true); main_widget->set_layout(16); diff --git a/Userland/Applets/Audio/main.cpp b/Userland/Applets/Audio/main.cpp index bc47b3c610..41ba00aa8d 100644 --- a/Userland/Applets/Audio/main.cpp +++ b/Userland/Applets/Audio/main.cpp @@ -81,7 +81,7 @@ private: m_slider_window = add(window()); m_slider_window->set_window_type(GUI::WindowType::Popup); - m_root_container = TRY(m_slider_window->set_main_widget()); + m_root_container = m_slider_window->set_main_widget(); m_root_container->set_fill_with_background_color(true); m_root_container->set_layout(4, 0); m_root_container->set_frame_style(Gfx::FrameStyle::Window); @@ -245,7 +245,8 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_title("Audio"); window->set_window_type(GUI::WindowType::Applet); - auto audio_widget = TRY(window->set_main_widget()); + auto audio_widget = TRY(AudioWidget::try_create()); + window->set_main_widget(audio_widget); window->show(); // This affects the positioning, which depends on the window actually existing. diff --git a/Userland/Applets/ClipboardHistory/main.cpp b/Userland/Applets/ClipboardHistory/main.cpp index ed0163ea37..3aa0c9de0d 100644 --- a/Userland/Applets/ClipboardHistory/main.cpp +++ b/Userland/Applets/ClipboardHistory/main.cpp @@ -43,7 +43,7 @@ ErrorOr serenity_main(Main::Arguments arguments) main_window->set_rect(670, 65, 325, 500); main_window->set_icon(app_icon.bitmap_for_size(16)); - auto table_view = TRY(main_window->set_main_widget()); + auto table_view = main_window->set_main_widget(); auto model = ClipboardHistoryModel::create(); TRY(model->read_from_file(clipboard_file_path)); @@ -100,7 +100,7 @@ ErrorOr serenity_main(Main::Arguments arguments) applet_window->set_title("ClipboardHistory"); applet_window->set_window_type(GUI::WindowType::Applet); applet_window->set_has_alpha_channel(true); - auto icon_widget = TRY(applet_window->set_main_widget()); + auto icon_widget = applet_window->set_main_widget(); icon_widget->set_tooltip_deprecated("Clipboard History"); icon_widget->load_from_file("/res/icons/16x16/edit-copy.png"sv); icon_widget->on_click = [&main_window = *main_window] { diff --git a/Userland/Applets/Keymap/KeymapStatusWindow.cpp b/Userland/Applets/Keymap/KeymapStatusWindow.cpp index 651534c663..a5ad58f0e2 100644 --- a/Userland/Applets/Keymap/KeymapStatusWindow.cpp +++ b/Userland/Applets/Keymap/KeymapStatusWindow.cpp @@ -12,7 +12,7 @@ KeymapStatusWindow::KeymapStatusWindow() { set_window_type(GUI::WindowType::Applet); set_has_alpha_channel(true); - m_status_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + m_status_widget = set_main_widget(); auto current_keymap = MUST(Keyboard::CharacterMap::fetch_system_map()); m_status_widget->set_current_keymap(current_keymap.character_map_name()); diff --git a/Userland/Applets/Network/main.cpp b/Userland/Applets/Network/main.cpp index 41bead4945..fee24bbaae 100644 --- a/Userland/Applets/Network/main.cpp +++ b/Userland/Applets/Network/main.cpp @@ -187,7 +187,8 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_window_type(GUI::WindowType::Applet); window->set_has_alpha_channel(true); window->resize(16, 16); - auto icon = TRY(window->set_main_widget(display_notifications)); + auto icon = TRY(NetworkWidget::try_create(display_notifications)); + window->set_main_widget(icon); icon->load_from_file("/res/icons/16x16/network.png"sv); window->resize(16, 16); window->show(); diff --git a/Userland/Applets/ResourceGraph/main.cpp b/Userland/Applets/ResourceGraph/main.cpp index 20fa846a34..c964edc6be 100644 --- a/Userland/Applets/ResourceGraph/main.cpp +++ b/Userland/Applets/ResourceGraph/main.cpp @@ -275,7 +275,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_window_type(GUI::WindowType::Applet); window->resize(GraphWidget::history_size + 2, 15); - auto graph_widget = TRY(window->set_main_widget(graph_type, graph_color, Optional {})); + auto graph_widget = window->set_main_widget(graph_type, graph_color, Optional {}); window->show(); applet_windows.append(move(window)); diff --git a/Userland/Applets/WorkspacePicker/DesktopStatusWindow.cpp b/Userland/Applets/WorkspacePicker/DesktopStatusWindow.cpp index c2094b9d71..5e1b7ebf47 100644 --- a/Userland/Applets/WorkspacePicker/DesktopStatusWindow.cpp +++ b/Userland/Applets/WorkspacePicker/DesktopStatusWindow.cpp @@ -148,7 +148,7 @@ DesktopStatusWindow::DesktopStatusWindow() { set_window_type(GUI::WindowType::Applet); set_has_alpha_channel(true); - m_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + m_widget = set_main_widget(); } void DesktopStatusWindow::wm_event(GUI::WMEvent& event) diff --git a/Userland/Applications/3DFileViewer/main.cpp b/Userland/Applications/3DFileViewer/main.cpp index a8a0c5875f..d7ab5ead86 100644 --- a/Userland/Applications/3DFileViewer/main.cpp +++ b/Userland/Applications/3DFileViewer/main.cpp @@ -362,7 +362,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->resize(640 + 4, 480 + 4); window->set_resizable(false); window->set_double_buffering_enabled(true); - auto widget = TRY(window->set_main_widget()); + auto widget = window->set_main_widget(); auto& time = widget->add(); time.set_visible(false); diff --git a/Userland/Applications/AnalogClock/main.cpp b/Userland/Applications/AnalogClock/main.cpp index 90483fc549..ecb3b87d32 100644 --- a/Userland/Applications/AnalogClock/main.cpp +++ b/Userland/Applications/AnalogClock/main.cpp @@ -30,7 +30,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_icon(app_icon.bitmap_for_size(16)); window->resize(170, 170); window->set_resizable(false); - auto clock = TRY(window->set_main_widget()); + auto clock = window->set_main_widget(); auto show_window_frame_action = GUI::Action::create_checkable( "Show Window &Frame", { Mod_Alt, KeyCode::Key_F }, [&](auto& action) { diff --git a/Userland/Applications/Assistant/main.cpp b/Userland/Applications/Assistant/main.cpp index d0d3be1776..84cad5d8a6 100644 --- a/Userland/Applications/Assistant/main.cpp +++ b/Userland/Applications/Assistant/main.cpp @@ -174,7 +174,7 @@ ErrorOr serenity_main(Main::Arguments arguments) }; Assistant::Database db { app_state, providers }; - auto container = TRY(window->set_main_widget()); + auto container = window->set_main_widget(); container->set_fill_with_background_color(true); container->set_frame_style(Gfx::FrameStyle::Window); container->set_layout(8); diff --git a/Userland/Applications/Browser/BookmarksBarWidget.cpp b/Userland/Applications/Browser/BookmarksBarWidget.cpp index cd12e7bd5c..64da8ca8e5 100644 --- a/Userland/Applications/Browser/BookmarksBarWidget.cpp +++ b/Userland/Applications/Browser/BookmarksBarWidget.cpp @@ -53,7 +53,7 @@ private: BookmarkEditor(Window* parent_window, StringView title, StringView url) : Dialog(parent_window) { - auto widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto widget = set_main_widget(); widget->load_from_gml(edit_bookmark_gml).release_value_but_fixme_should_propagate_errors(); set_resizable(false); diff --git a/Userland/Applications/Browser/BrowserWindow.cpp b/Userland/Applications/Browser/BrowserWindow.cpp index 04ea86b9b6..e42e862440 100644 --- a/Userland/Applications/Browser/BrowserWindow.cpp +++ b/Userland/Applications/Browser/BrowserWindow.cpp @@ -68,7 +68,7 @@ BrowserWindow::BrowserWindow(WebView::CookieJar& cookie_jar, URL url) set_icon(app_icon.bitmap_for_size(16)); set_title("Ladybird"); - auto widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto widget = set_main_widget(); widget->load_from_gml(browser_window_gml).release_value_but_fixme_should_propagate_errors(); auto& top_line = *widget->find_descendant_of_type_named("top_line"); diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp index c5d048ad14..8767cb879f 100644 --- a/Userland/Applications/Browser/Tab.cpp +++ b/Userland/Applications/Browser/Tab.cpp @@ -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(url).release_value_but_fixme_should_propagate_errors(); + (void)window->set_main_widget(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().release_value_but_fixme_should_propagate_errors(); + auto editor = window->set_main_widget(); editor->set_text(source); editor->set_mode(GUI::TextEditor::ReadOnly); editor->set_syntax_highlighter(make()); @@ -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().release_value_but_fixme_should_propagate_errors(); + m_dom_inspector_widget = window->set_main_widget(); 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(view())); + m_console_widget = console_window->set_main_widget(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().release_value_but_fixme_should_propagate_errors(); + m_storage_widget = storage_window->set_main_widget(); 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().release_value_but_fixme_should_propagate_errors(); + m_history_widget = history_window->set_main_widget(); } m_history_widget->clear_history_entries(); diff --git a/Userland/Applications/Calculator/main.cpp b/Userland/Applications/Calculator/main.cpp index 18770cb8fb..f14bce7c4b 100644 --- a/Userland/Applications/Calculator/main.cpp +++ b/Userland/Applications/Calculator/main.cpp @@ -35,7 +35,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_resizable(false); window->resize(250, 215); - auto widget = TRY(window->set_main_widget()); + auto widget = window->set_main_widget(); window->set_icon(app_icon.bitmap_for_size(16)); diff --git a/Userland/Applications/Calendar/AddEventDialog.cpp b/Userland/Applications/Calendar/AddEventDialog.cpp index 6e575e3ed3..aa8d8bdfac 100644 --- a/Userland/Applications/Calendar/AddEventDialog.cpp +++ b/Userland/Applications/Calendar/AddEventDialog.cpp @@ -33,7 +33,7 @@ AddEventDialog::AddEventDialog(Core::DateTime date_time, EventManager& event_man m_date_time = Core::DateTime::create(m_date_time.year(), m_date_time.month(), m_date_time.day(), 12, 0); - auto widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto widget = set_main_widget(); widget->set_fill_with_background_color(true); widget->set_layout(); diff --git a/Userland/Applications/CharacterMap/CharacterMapWidget.cpp b/Userland/Applications/CharacterMap/CharacterMapWidget.cpp index 0d62f0905c..2deb1dfb33 100644 --- a/Userland/Applications/CharacterMap/CharacterMapWidget.cpp +++ b/Userland/Applications/CharacterMap/CharacterMapWidget.cpp @@ -86,7 +86,7 @@ CharacterMapWidget::CharacterMapWidget() 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()) { m_find_window = GUI::Window::construct(window()); - auto search_widget = m_find_window->set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto search_widget = m_find_window->set_main_widget(); search_widget->on_character_selected = [&](auto code_point) { m_glyph_map->set_active_glyph(code_point); m_glyph_map->scroll_to_glyph(code_point); diff --git a/Userland/Applications/CharacterMap/main.cpp b/Userland/Applications/CharacterMap/main.cpp index 9fe4e826c3..e64b00947d 100644 --- a/Userland/Applications/CharacterMap/main.cpp +++ b/Userland/Applications/CharacterMap/main.cpp @@ -69,7 +69,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_icon(app_icon.bitmap_for_size(16)); window->resize(600, 400); - auto character_map_widget = TRY(window->set_main_widget()); + auto character_map_widget = window->set_main_widget(); TRY(character_map_widget->initialize_menubar(*window)); auto font_query = Config::read_string("CharacterMap"sv, "History"sv, "Font"sv, Gfx::FontDatabase::the().default_font_query()); diff --git a/Userland/Applications/CrashReporter/main.cpp b/Userland/Applications/CrashReporter/main.cpp index 96715f8be6..8083ffc62f 100644 --- a/Userland/Applications/CrashReporter/main.cpp +++ b/Userland/Applications/CrashReporter/main.cpp @@ -202,7 +202,7 @@ ErrorOr serenity_main(Main::Arguments arguments) unlink_coredump(coredump_path); }; - auto widget = TRY(window->set_main_widget()); + auto widget = window->set_main_widget(); TRY(widget->load_from_gml(crash_reporter_window_gml)); auto& icon_image_widget = *widget->find_descendant_of_type_named("icon"); diff --git a/Userland/Applications/Escalator/EscalatorWindow.cpp b/Userland/Applications/Escalator/EscalatorWindow.cpp index 56d19d5993..78732fb13f 100644 --- a/Userland/Applications/Escalator/EscalatorWindow.cpp +++ b/Userland/Applications/Escalator/EscalatorWindow.cpp @@ -36,7 +36,7 @@ EscalatorWindow::EscalatorWindow(StringView executable, Vector argum set_resizable(false); set_minimizable(false); - auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto main_widget = set_main_widget(); main_widget->load_from_gml(escalator_gml).release_value_but_fixme_should_propagate_errors(); RefPtr app_label = *main_widget->find_descendant_of_type_named("description"); diff --git a/Userland/Applications/FileManager/FileUtils.cpp b/Userland/Applications/FileManager/FileUtils.cpp index 511754039b..3132d54c8a 100644 --- a/Userland/Applications/FileManager/FileUtils.cpp +++ b/Userland/Applications/FileManager/FileUtils.cpp @@ -101,7 +101,7 @@ ErrorOr run_file_operation(FileOperation operation, Vectorset_main_widget(operation, move(buffered_pipe), pipe_fds[0])); + (void)window->set_main_widget(operation, move(buffered_pipe), pipe_fds[0]); window->resize(320, 190); if (parent_window) window->center_within(*parent_window); diff --git a/Userland/Applications/FileManager/PropertiesWindow.cpp b/Userland/Applications/FileManager/PropertiesWindow.cpp index b0e235ba98..66be43956e 100644 --- a/Userland/Applications/FileManager/PropertiesWindow.cpp +++ b/Userland/Applications/FileManager/PropertiesWindow.cpp @@ -70,7 +70,7 @@ PropertiesWindow::PropertiesWindow(DeprecatedString const& path, Window* parent_ ErrorOr PropertiesWindow::create_widgets(bool disable_rename) { - auto main_widget = TRY(set_main_widget()); + auto main_widget = set_main_widget(); main_widget->set_layout(4, 6); main_widget->set_fill_with_background_color(true); diff --git a/Userland/Applications/FileManager/main.cpp b/Userland/Applications/FileManager/main.cpp index 0d799a499b..c4757ab1c3 100644 --- a/Userland/Applications/FileManager/main.cpp +++ b/Userland/Applications/FileManager/main.cpp @@ -387,7 +387,7 @@ ErrorOr run_in_desktop_mode() auto desktop_icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/desktop.png"sv)); window->set_icon(desktop_icon); - auto desktop_widget = TRY(window->set_main_widget()); + auto desktop_widget = window->set_main_widget(); desktop_widget->set_layout(); auto directory_view = TRY(desktop_widget->try_add(DirectoryView::Mode::Desktop)); @@ -609,7 +609,7 @@ ErrorOr run_in_windowed_mode(DeprecatedString const& initial_location, Depr auto window = GUI::Window::construct(); window->set_title("File Manager"); - auto widget = TRY(window->set_main_widget()); + auto widget = window->set_main_widget(); TRY(widget->load_from_gml(file_manager_window_gml)); auto& toolbar_container = *widget->find_descendant_of_type_named("toolbar_container"); diff --git a/Userland/Applications/FontEditor/MainWidget.cpp b/Userland/Applications/FontEditor/MainWidget.cpp index a9895c52f9..ba2a801a2c 100644 --- a/Userland/Applications/FontEditor/MainWidget.cpp +++ b/Userland/Applications/FontEditor/MainWidget.cpp @@ -82,7 +82,7 @@ ErrorOr> MainWidget::create_preview_window() window->resize(400, 150); window->center_within(*this->window()); - auto main_widget = TRY(window->set_main_widget()); + auto main_widget = window->set_main_widget(); TRY(main_widget->load_from_gml(font_preview_window_gml)); m_preview_label = find_descendant_of_type_named("preview_label"); diff --git a/Userland/Applications/FontEditor/main.cpp b/Userland/Applications/FontEditor/main.cpp index 3cf50fd067..d7ad45c931 100644 --- a/Userland/Applications/FontEditor/main.cpp +++ b/Userland/Applications/FontEditor/main.cpp @@ -45,7 +45,8 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_icon(app_icon.bitmap_for_size(16)); window->resize(640, 470); - auto font_editor = TRY(window->set_main_widget()); + auto font_editor = TRY(FontEditor::MainWidget::try_create()); + window->set_main_widget(font_editor); TRY(font_editor->initialize_menubar(*window)); font_editor->reset(); diff --git a/Userland/Applications/Help/main.cpp b/Userland/Applications/Help/main.cpp index df2dd6d8aa..c39baaa609 100644 --- a/Userland/Applications/Help/main.cpp +++ b/Userland/Applications/Help/main.cpp @@ -60,7 +60,9 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_title("Help"); window->resize(570, 500); - auto main_widget = TRY(window->set_main_widget()); + auto main_widget = TRY(MainWidget::try_create()); + window->set_main_widget(main_widget); + TRY(main_widget->initialize_fallibles(window)); TRY(main_widget->set_start_page(query_parameters)); diff --git a/Userland/Applications/HexEditor/FindDialog.cpp b/Userland/Applications/HexEditor/FindDialog.cpp index be4426955a..4d20ddfc1b 100644 --- a/Userland/Applications/HexEditor/FindDialog.cpp +++ b/Userland/Applications/HexEditor/FindDialog.cpp @@ -99,7 +99,7 @@ FindDialog::FindDialog() set_resizable(false); set_title("Find"); - auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto main_widget = set_main_widget(); main_widget->load_from_gml(find_dialog_gml).release_value_but_fixme_should_propagate_errors(); m_text_editor = *main_widget->find_descendant_of_type_named("text_editor"); diff --git a/Userland/Applications/HexEditor/GoToOffsetDialog.cpp b/Userland/Applications/HexEditor/GoToOffsetDialog.cpp index cc2cfc31fd..a0d4d067c9 100644 --- a/Userland/Applications/HexEditor/GoToOffsetDialog.cpp +++ b/Userland/Applications/HexEditor/GoToOffsetDialog.cpp @@ -96,7 +96,7 @@ GoToOffsetDialog::GoToOffsetDialog() set_resizable(false); set_title("Go to Offset"); - auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto main_widget = set_main_widget(); main_widget->load_from_gml(go_to_offset_dialog_gml).release_value_but_fixme_should_propagate_errors(); m_text_editor = *main_widget->find_descendant_of_type_named("text_editor"); diff --git a/Userland/Applications/HexEditor/main.cpp b/Userland/Applications/HexEditor/main.cpp index abfdb43b42..9a1cd7e10e 100644 --- a/Userland/Applications/HexEditor/main.cpp +++ b/Userland/Applications/HexEditor/main.cpp @@ -36,7 +36,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_title("Hex Editor"); window->resize(640, 400); - auto hex_editor_widget = TRY(window->set_main_widget()); + auto hex_editor_widget = window->set_main_widget(); window->on_close_request = [&]() -> GUI::Window::CloseRequestDecision { if (hex_editor_widget->request_close()) diff --git a/Userland/Applications/ImageViewer/main.cpp b/Userland/Applications/ImageViewer/main.cpp index f289539299..c141fc7faf 100644 --- a/Userland/Applications/ImageViewer/main.cpp +++ b/Userland/Applications/ImageViewer/main.cpp @@ -70,7 +70,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_icon(app_icon.bitmap_for_size(16)); window->set_title("Image Viewer"); - auto root_widget = TRY(window->set_main_widget()); + auto root_widget = window->set_main_widget(); auto toolbar_container = TRY(root_widget->try_add()); auto main_toolbar = TRY(toolbar_container->try_add()); diff --git a/Userland/Applications/KeyboardMapper/main.cpp b/Userland/Applications/KeyboardMapper/main.cpp index 374ed7398c..042edf1c2e 100644 --- a/Userland/Applications/KeyboardMapper/main.cpp +++ b/Userland/Applications/KeyboardMapper/main.cpp @@ -31,7 +31,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto window = GUI::Window::construct(); window->set_title("Keyboard Mapper"); window->set_icon(app_icon.bitmap_for_size(16)); - auto keyboard_mapper_widget = TRY(window->set_main_widget()); + auto keyboard_mapper_widget = window->set_main_widget(); window->resize(775, 315); window->set_resizable(false); diff --git a/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp b/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp index e5c1701e7a..2f3fe76d93 100644 --- a/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp +++ b/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp @@ -52,7 +52,7 @@ private: KeymapSelectionDialog(Window* parent_window, Vector const& selected_keymaps) : Dialog(parent_window) { - auto widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto widget = set_main_widget(); widget->load_from_gml(keymap_dialog_gml).release_value_but_fixme_should_propagate_errors(); set_resizable(false); diff --git a/Userland/Applications/Magnifier/main.cpp b/Userland/Applications/Magnifier/main.cpp index 39eb03a82b..7829b5dd11 100644 --- a/Userland/Applications/Magnifier/main.cpp +++ b/Userland/Applications/Magnifier/main.cpp @@ -59,7 +59,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->resize(window_dimensions, window_dimensions); window->set_minimizable(false); window->set_icon(app_icon.bitmap_for_size(16)); - auto magnifier = TRY(window->set_main_widget()); + auto magnifier = window->set_main_widget(); auto file_menu = window->add_menu("&File"_string); file_menu->add_action(GUI::CommonActions::make_save_as_action([&](auto&) { diff --git a/Userland/Applications/Mail/main.cpp b/Userland/Applications/Mail/main.cpp index d332449538..a7755df8c5 100644 --- a/Userland/Applications/Mail/main.cpp +++ b/Userland/Applications/Mail/main.cpp @@ -40,7 +40,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto app_icon = GUI::Icon::default_icon("app-mail"sv); window->set_icon(app_icon.bitmap_for_size(16)); - auto mail_widget = TRY(window->set_main_widget()); + auto mail_widget = window->set_main_widget(); window->set_title("Mail"); window->resize(640, 400); diff --git a/Userland/Applications/Maps/main.cpp b/Userland/Applications/Maps/main.cpp index 318523daf1..04be7b5ef6 100644 --- a/Userland/Applications/Maps/main.cpp +++ b/Userland/Applications/Maps/main.cpp @@ -41,7 +41,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->save_size_and_position_on_close("Maps"sv, "Window"sv); // Root widget - auto root_widget = TRY(window->set_main_widget()); + auto root_widget = window->set_main_widget(); root_widget->set_fill_with_background_color(true); root_widget->set_layout(GUI::Margins {}, 2); diff --git a/Userland/Applications/PDFViewer/main.cpp b/Userland/Applications/PDFViewer/main.cpp index 02a4fb0209..69aeec809d 100644 --- a/Userland/Applications/PDFViewer/main.cpp +++ b/Userland/Applications/PDFViewer/main.cpp @@ -39,7 +39,7 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil(nullptr, nullptr)); - auto pdf_viewer_widget = TRY(window->set_main_widget()); + auto pdf_viewer_widget = window->set_main_widget(); TRY(pdf_viewer_widget->initialize_menubar(*window)); diff --git a/Userland/Applications/PartitionEditor/main.cpp b/Userland/Applications/PartitionEditor/main.cpp index ec7e1c6dc6..16fa493d85 100644 --- a/Userland/Applications/PartitionEditor/main.cpp +++ b/Userland/Applications/PartitionEditor/main.cpp @@ -58,7 +58,7 @@ ErrorOr serenity_main(Main::Arguments arguments) return Error::from_string_view(error_message); } - auto widget = TRY(window->set_main_widget()); + auto widget = window->set_main_widget(); TRY(widget->load_from_gml(partition_editor_window_gml)); auto device_paths = get_device_paths(); diff --git a/Userland/Applications/Piano/ExportProgressWindow.cpp b/Userland/Applications/Piano/ExportProgressWindow.cpp index 70945d1329..9664af7fcb 100644 --- a/Userland/Applications/Piano/ExportProgressWindow.cpp +++ b/Userland/Applications/Piano/ExportProgressWindow.cpp @@ -20,7 +20,7 @@ ExportProgressWindow::ExportProgressWindow(GUI::Window& parent_window, Atomic ExportProgressWindow::initialize_fallibles() { - auto main_widget = TRY(set_main_widget()); + auto main_widget = set_main_widget(); TRY(main_widget->load_from_gml(export_progress_widget)); set_resizable(false); diff --git a/Userland/Applications/Piano/main.cpp b/Userland/Applications/Piano/main.cpp index 8d410951c0..9180e608ac 100644 --- a/Userland/Applications/Piano/main.cpp +++ b/Userland/Applications/Piano/main.cpp @@ -44,7 +44,8 @@ ErrorOr serenity_main(Main::Arguments arguments) auto app_icon = GUI::Icon::default_icon("app-piano"sv); auto window = GUI::Window::construct(); - auto main_widget = TRY(window->set_main_widget(track_manager, audio_loop)); + auto main_widget = TRY(MainWidget::try_create(track_manager, audio_loop)); + window->set_main_widget(main_widget); window->set_title("Piano"); window->resize(840, 600); window->set_icon(app_icon.bitmap_for_size(16)); diff --git a/Userland/Applications/PixelPaint/CreateNewImageDialog.cpp b/Userland/Applications/PixelPaint/CreateNewImageDialog.cpp index f6aa98506a..090fe6ae5d 100644 --- a/Userland/Applications/PixelPaint/CreateNewImageDialog.cpp +++ b/Userland/Applications/PixelPaint/CreateNewImageDialog.cpp @@ -27,7 +27,7 @@ CreateNewImageDialog::CreateNewImageDialog(GUI::Window* parent_window) set_icon(parent_window->icon()); resize(200, 220); - auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto main_widget = set_main_widget(); main_widget->set_fill_with_background_color(true); main_widget->set_layout(4); diff --git a/Userland/Applications/PixelPaint/CreateNewLayerDialog.cpp b/Userland/Applications/PixelPaint/CreateNewLayerDialog.cpp index c6adf81d97..37a47a308c 100644 --- a/Userland/Applications/PixelPaint/CreateNewLayerDialog.cpp +++ b/Userland/Applications/PixelPaint/CreateNewLayerDialog.cpp @@ -20,7 +20,7 @@ CreateNewLayerDialog::CreateNewLayerDialog(Gfx::IntSize suggested_size, GUI::Win set_icon(parent_window->icon()); resize(200, 200); - auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto main_widget = set_main_widget(); main_widget->set_fill_with_background_color(true); main_widget->set_layout(4); diff --git a/Userland/Applications/PixelPaint/EditGuideDialog.cpp b/Userland/Applications/PixelPaint/EditGuideDialog.cpp index 6998c170ce..8fb8d5f368 100644 --- a/Userland/Applications/PixelPaint/EditGuideDialog.cpp +++ b/Userland/Applications/PixelPaint/EditGuideDialog.cpp @@ -23,7 +23,7 @@ EditGuideDialog::EditGuideDialog(GUI::Window* parent_window, DeprecatedString co resize(200, 130); set_resizable(false); - auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto main_widget = set_main_widget(); main_widget->load_from_gml(edit_guide_dialog_gml).release_value_but_fixme_should_propagate_errors(); auto horizontal_radio = main_widget->find_descendant_of_type_named("orientation_horizontal_radio"); diff --git a/Userland/Applications/PixelPaint/FilterGallery.cpp b/Userland/Applications/PixelPaint/FilterGallery.cpp index cc2cad9cd2..cad7ff890b 100644 --- a/Userland/Applications/PixelPaint/FilterGallery.cpp +++ b/Userland/Applications/PixelPaint/FilterGallery.cpp @@ -21,7 +21,7 @@ FilterGallery::FilterGallery(GUI::Window* parent_window, ImageEditor* editor) resize(400, 250); set_resizable(true); - auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto main_widget = set_main_widget(); main_widget->load_from_gml(filter_gallery_gml).release_value_but_fixme_should_propagate_errors(); m_filter_tree = main_widget->find_descendant_of_type_named("tree_view"); diff --git a/Userland/Applications/PixelPaint/FilterParams.h b/Userland/Applications/PixelPaint/FilterParams.h index e4af8ff374..c0c15eae80 100644 --- a/Userland/Applications/PixelPaint/FilterParams.h +++ b/Userland/Applications/PixelPaint/FilterParams.h @@ -48,7 +48,7 @@ private: set_title(builder.string_view()); resize(200, 250); - auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto main_widget = set_main_widget(); main_widget->set_frame_style(Gfx::FrameStyle::RaisedContainer); main_widget->set_fill_with_background_color(true); main_widget->template set_layout(4); diff --git a/Userland/Applications/PixelPaint/ImageMasking.cpp b/Userland/Applications/PixelPaint/ImageMasking.cpp index dd835e28af..ffc3264d26 100644 --- a/Userland/Applications/PixelPaint/ImageMasking.cpp +++ b/Userland/Applications/PixelPaint/ImageMasking.cpp @@ -26,7 +26,7 @@ ImageMasking::ImageMasking(GUI::Window* parent_window, ImageEditor* editor, Mask { set_icon(parent_window->icon()); - auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto main_widget = set_main_widget(); set_resizable(false); m_previous_edit_mode = m_editor->active_layer()->edit_mode(); diff --git a/Userland/Applications/PixelPaint/LevelsDialog.cpp b/Userland/Applications/PixelPaint/LevelsDialog.cpp index 004860614f..f502de0d1c 100644 --- a/Userland/Applications/PixelPaint/LevelsDialog.cpp +++ b/Userland/Applications/PixelPaint/LevelsDialog.cpp @@ -18,7 +18,7 @@ LevelsDialog::LevelsDialog(GUI::Window* parent_window, ImageEditor* editor) set_title("Levels"); set_icon(parent_window->icon()); - auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto main_widget = set_main_widget(); main_widget->load_from_gml(levels_dialog_gml).release_value_but_fixme_should_propagate_errors(); resize(305, 202); diff --git a/Userland/Applications/PixelPaint/ResizeImageDialog.cpp b/Userland/Applications/PixelPaint/ResizeImageDialog.cpp index dc6b9d9504..9220add775 100644 --- a/Userland/Applications/PixelPaint/ResizeImageDialog.cpp +++ b/Userland/Applications/PixelPaint/ResizeImageDialog.cpp @@ -27,7 +27,7 @@ ResizeImageDialog::ResizeImageDialog(Gfx::IntSize suggested_size, GUI::Window* p resize(260, 228); set_icon(parent_window->icon()); - auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto main_widget = set_main_widget(); main_widget->load_from_gml(resize_image_dialog_gml).release_value_but_fixme_should_propagate_errors(); auto width_spinbox = main_widget->find_descendant_of_type_named("width_spinbox"); diff --git a/Userland/Applications/PixelPaint/main.cpp b/Userland/Applications/PixelPaint/main.cpp index 3c4c901ba7..e0c5d677f6 100644 --- a/Userland/Applications/PixelPaint/main.cpp +++ b/Userland/Applications/PixelPaint/main.cpp @@ -47,7 +47,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->resize(800, 520); window->set_icon(app_icon.bitmap_for_size(16)); - auto main_widget = TRY(window->set_main_widget()); + auto main_widget = window->set_main_widget(); TRY(main_widget->initialize_menubar(*window)); diff --git a/Userland/Applications/Presenter/main.cpp b/Userland/Applications/Presenter/main.cpp index abef59a534..7da1bb3918 100644 --- a/Userland/Applications/Presenter/main.cpp +++ b/Userland/Applications/Presenter/main.cpp @@ -27,7 +27,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto window = GUI::Window::construct(); window->set_title("Presenter"); window->set_icon(GUI::Icon::default_icon("app-presenter"sv).bitmap_for_size(16)); - auto main_widget = TRY(window->set_main_widget()); + auto main_widget = window->set_main_widget(); TRY(main_widget->initialize_menubar()); window->show(); diff --git a/Userland/Applications/Run/RunWindow.cpp b/Userland/Applications/Run/RunWindow.cpp index 511f9af729..de3ab1c3a2 100644 --- a/Userland/Applications/Run/RunWindow.cpp +++ b/Userland/Applications/Run/RunWindow.cpp @@ -41,7 +41,7 @@ RunWindow::RunWindow() set_resizable(false); set_minimizable(false); - auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto main_widget = set_main_widget(); main_widget->load_from_gml(run_gml).release_value_but_fixme_should_propagate_errors(); m_icon_image_widget = *main_widget->find_descendant_of_type_named("icon"); diff --git a/Userland/Applications/Settings/main.cpp b/Userland/Applications/Settings/main.cpp index 959fdaa50c..45eaa99a0f 100644 --- a/Userland/Applications/Settings/main.cpp +++ b/Userland/Applications/Settings/main.cpp @@ -101,7 +101,7 @@ ErrorOr serenity_main(Main::Arguments arguments) help_menu->add_action(GUI::CommonActions::make_command_palette_action(window)); help_menu->add_action(GUI::CommonActions::make_about_action("Settings"_string, app_icon, window)); - auto main_widget = TRY(window->set_main_widget()); + auto main_widget = window->set_main_widget(); main_widget->set_fill_with_background_color(true); main_widget->set_layout(); diff --git a/Userland/Applications/SoundPlayer/main.cpp b/Userland/Applications/SoundPlayer/main.cpp index 848fc3eded..35d394302e 100644 --- a/Userland/Applications/SoundPlayer/main.cpp +++ b/Userland/Applications/SoundPlayer/main.cpp @@ -52,7 +52,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_icon(app_icon.bitmap_for_size(16)); // start in advanced view by default - Player* player = TRY(window->set_main_widget(window, audio_client, decoder_client)); + Player* player = window->set_main_widget(window, audio_client, decoder_client); if (!file_path.is_empty()) { player->play_file_path(file_path); diff --git a/Userland/Applications/SpaceAnalyzer/ProgressWindow.cpp b/Userland/Applications/SpaceAnalyzer/ProgressWindow.cpp index 75ba3071a4..c36ddd8e4a 100644 --- a/Userland/Applications/SpaceAnalyzer/ProgressWindow.cpp +++ b/Userland/Applications/SpaceAnalyzer/ProgressWindow.cpp @@ -14,7 +14,7 @@ ErrorOr> ProgressWindow::try_create(StringView tit { auto window = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) ProgressWindow(title, parent))); - auto main_widget = TRY(window->set_main_widget()); + auto main_widget = window->set_main_widget(); main_widget->set_fill_with_background_color(true); main_widget->set_layout(); diff --git a/Userland/Applications/SpaceAnalyzer/main.cpp b/Userland/Applications/SpaceAnalyzer/main.cpp index ad068ca17d..ce4c09ab58 100644 --- a/Userland/Applications/SpaceAnalyzer/main.cpp +++ b/Userland/Applications/SpaceAnalyzer/main.cpp @@ -53,7 +53,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_icon(app_icon.bitmap_for_size(16)); // Load widgets. - auto main_widget = TRY(window->set_main_widget()); + auto main_widget = window->set_main_widget(); TRY(main_widget->load_from_gml(space_analyzer_gml)); auto& breadcrumbbar = *main_widget->find_descendant_of_type_named("breadcrumbbar"); auto& tree_map_widget = *main_widget->find_descendant_of_type_named("tree_map"); diff --git a/Userland/Applications/Spreadsheet/CellTypeDialog.cpp b/Userland/Applications/Spreadsheet/CellTypeDialog.cpp index 677c965be4..5f225d92c2 100644 --- a/Userland/Applications/Spreadsheet/CellTypeDialog.cpp +++ b/Userland/Applications/Spreadsheet/CellTypeDialog.cpp @@ -45,7 +45,7 @@ CellTypeDialog::CellTypeDialog(Vector const& positions, Sheet& sheet, set_icon(parent->icon()); resize(285, 360); - auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto main_widget = set_main_widget(); main_widget->set_layout(4); main_widget->set_fill_with_background_color(true); diff --git a/Userland/Applications/Spreadsheet/HelpWindow.cpp b/Userland/Applications/Spreadsheet/HelpWindow.cpp index 97a06a4ee6..04d5519d99 100644 --- a/Userland/Applications/Spreadsheet/HelpWindow.cpp +++ b/Userland/Applications/Spreadsheet/HelpWindow.cpp @@ -68,7 +68,7 @@ HelpWindow::HelpWindow(GUI::Window* parent) set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-help.png"sv).release_value_but_fixme_should_propagate_errors()); set_window_mode(GUI::WindowMode::Modeless); - auto widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto widget = set_main_widget(); widget->set_layout(); widget->set_fill_with_background_color(true); @@ -115,7 +115,7 @@ HelpWindow::HelpWindow(GUI::Window* parent) window->set_title(DeprecatedString::formatted("Spreadsheet Help - Example {} for {}", name, entry)); window->on_close = [window = window.ptr()] { window->remove_from_parent(); }; - auto widget = window->set_main_widget(window, Vector> {}, false).release_value_but_fixme_should_propagate_errors(); + auto widget = window->set_main_widget(window, Vector> {}, false); auto sheet = Sheet::from_json(value, widget->workbook()); if (!sheet) { GUI::MessageBox::show_error(this, DeprecatedString::formatted("Corrupted example '{}' in '{}'", name, example_path)); diff --git a/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp b/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp index 66844376e3..e5309afc31 100644 --- a/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp +++ b/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp @@ -80,7 +80,7 @@ SpreadsheetWidget::SpreadsheetWidget(GUI::Window& parent_window, Vectorset_rect(m_cell_value_editor->rect().translated(0, m_cell_value_editor->height() + 7).inflated(6, 6)); m_inline_documentation_window->set_window_type(GUI::WindowType::Tooltip); m_inline_documentation_window->set_resizable(false); - auto inline_widget = m_inline_documentation_window->set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto inline_widget = m_inline_documentation_window->set_main_widget(); inline_widget->set_fill_with_background_color(true); inline_widget->set_layout(4); inline_widget->set_frame_style(Gfx::FrameStyle::Plain); diff --git a/Userland/Applications/Spreadsheet/main.cpp b/Userland/Applications/Spreadsheet/main.cpp index 1de6ab18bd..c1c0812011 100644 --- a/Userland/Applications/Spreadsheet/main.cpp +++ b/Userland/Applications/Spreadsheet/main.cpp @@ -55,7 +55,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->resize(640, 480); window->set_icon(app_icon.bitmap_for_size(16)); - auto spreadsheet_widget = TRY(window->set_main_widget(*window, Vector> {}, filename.is_empty())); + auto spreadsheet_widget = window->set_main_widget(*window, Vector> {}, filename.is_empty()); TRY(spreadsheet_widget->initialize_menubar(*window)); spreadsheet_widget->update_window_title(); diff --git a/Userland/Applications/SystemMonitor/main.cpp b/Userland/Applications/SystemMonitor/main.cpp index 35519b3a0e..46ad216b58 100644 --- a/Userland/Applications/SystemMonitor/main.cpp +++ b/Userland/Applications/SystemMonitor/main.cpp @@ -282,7 +282,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_title("System Monitor"); window->resize(560, 430); - auto main_widget = TRY(window->set_main_widget()); + auto main_widget = window->set_main_widget(); TRY(main_widget->load_from_gml(system_monitor_gml)); auto& tabwidget = *main_widget->find_descendant_of_type_named("main_tabs"); statusbar = main_widget->find_descendant_of_type_named("statusbar"); @@ -530,7 +530,7 @@ ErrorOr> build_process_window(pid_t pid) auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-system-monitor"sv)); window->set_icon(app_icon.bitmap_for_size(16)); - auto main_widget = TRY(window->set_main_widget()); + auto main_widget = window->set_main_widget(); TRY(main_widget->load_from_gml(process_window_gml)); GUI::ModelIndex process_index; diff --git a/Userland/Applications/Terminal/main.cpp b/Userland/Applications/Terminal/main.cpp index 68157507b9..155e6d8569 100644 --- a/Userland/Applications/Terminal/main.cpp +++ b/Userland/Applications/Terminal/main.cpp @@ -164,7 +164,7 @@ static ErrorOr> create_find_window(VT::TerminalWidget window->set_resizable(false); window->resize(300, 90); - auto main_widget = TRY(window->set_main_widget()); + auto main_widget = window->set_main_widget(); main_widget->set_fill_with_background_color(true); main_widget->set_background_role(ColorRole::Button); main_widget->set_layout(4); @@ -283,7 +283,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_title("Terminal"); window->set_obey_widget_min_size(false); - auto terminal = TRY(window->set_main_widget(ptm_fd, true)); + auto terminal = window->set_main_widget(ptm_fd, true); terminal->on_command_exit = [&] { app->quit(0); }; diff --git a/Userland/Applications/TextEditor/main.cpp b/Userland/Applications/TextEditor/main.cpp index 23d8d7163b..b99a45f07f 100644 --- a/Userland/Applications/TextEditor/main.cpp +++ b/Userland/Applications/TextEditor/main.cpp @@ -44,7 +44,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto window = GUI::Window::construct(); window->resize(640, 400); - auto text_widget = TRY(window->set_main_widget()); + auto text_widget = window->set_main_widget(); text_widget->editor().set_focus(true); diff --git a/Userland/Applications/ThemeEditor/main.cpp b/Userland/Applications/ThemeEditor/main.cpp index 9340e5768e..669dbaba59 100644 --- a/Userland/Applications/ThemeEditor/main.cpp +++ b/Userland/Applications/ThemeEditor/main.cpp @@ -50,7 +50,8 @@ ErrorOr serenity_main(Main::Arguments arguments) auto app_icon = GUI::Icon::default_icon("app-theme-editor"sv); auto window = GUI::Window::construct(); - auto main_widget = TRY(window->set_main_widget()); + auto main_widget = TRY(ThemeEditor::MainWidget::try_create()); + window->set_main_widget(main_widget); if (path.has_value()) { // Note: This is deferred to ensure that the window has already popped and any error dialog boxes would show up correctly. diff --git a/Userland/Applications/VideoPlayer/main.cpp b/Userland/Applications/VideoPlayer/main.cpp index 088fadac5d..97d485548d 100644 --- a/Userland/Applications/VideoPlayer/main.cpp +++ b/Userland/Applications/VideoPlayer/main.cpp @@ -34,7 +34,8 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil(nullptr, nullptr)); - auto main_widget = TRY(window->set_main_widget()); + auto main_widget = TRY(VideoPlayer::VideoPlayerWidget::try_create()); + window->set_main_widget(main_widget); main_widget->update_title(); TRY(main_widget->initialize_menubar(window)); diff --git a/Userland/Applications/Welcome/main.cpp b/Userland/Applications/Welcome/main.cpp index c3ca26de28..da1241ea49 100644 --- a/Userland/Applications/Welcome/main.cpp +++ b/Userland/Applications/Welcome/main.cpp @@ -32,7 +32,8 @@ ErrorOr serenity_main(Main::Arguments arguments) window->center_on_screen(); window->set_title("Welcome"); window->set_icon(app_icon.bitmap_for_size(16)); - auto welcome_widget = TRY(window->set_main_widget()); + auto welcome_widget = TRY(WelcomeWidget::try_create()); + window->set_main_widget(welcome_widget); window->show(); diff --git a/Userland/Demos/CatDog/main.cpp b/Userland/Demos/CatDog/main.cpp index 1871de47d2..1124bd5db9 100644 --- a/Userland/Demos/CatDog/main.cpp +++ b/Userland/Demos/CatDog/main.cpp @@ -61,7 +61,7 @@ ErrorOr serenity_main(Main::Arguments arguments) advice_window->set_has_alpha_channel(true); advice_window->set_alpha_hit_threshold(1.0f); - auto advice_widget = TRY(advice_window->set_main_widget(catdog_widget)); + auto advice_widget = advice_window->set_main_widget(catdog_widget); advice_widget->set_layout(GUI::Margins {}, 0); auto advice_timer = TRY(Core::Timer::create_single_shot(15'000, [&] { diff --git a/Userland/Demos/Eyes/main.cpp b/Userland/Demos/Eyes/main.cpp index cad2a8335e..bf4892ff81 100644 --- a/Userland/Demos/Eyes/main.cpp +++ b/Userland/Demos/Eyes/main.cpp @@ -96,7 +96,7 @@ ErrorOr serenity_main(Main::Arguments arguments) })); help_menu->add_action(GUI::CommonActions::make_about_action("Eyes Demo"_string, app_icon, window)); - auto eyes_widget = TRY(window->set_main_widget(num_eyes, full_rows, extra_columns)); + auto eyes_widget = window->set_main_widget(num_eyes, full_rows, extra_columns); eyes_widget->on_context_menu_request = [&](auto& event) { file_menu->popup(event.screen_position()); }; diff --git a/Userland/Demos/Gradient/Gradient.cpp b/Userland/Demos/Gradient/Gradient.cpp index 04e7374687..c4082b191b 100644 --- a/Userland/Demos/Gradient/Gradient.cpp +++ b/Userland/Demos/Gradient/Gradient.cpp @@ -97,7 +97,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto window = TRY(Desktop::Screensaver::create_window("Gradient"sv, "app-gradient"sv)); - auto gradient_widget = TRY(window->set_main_widget(64, 48, 10000)); + auto gradient_widget = window->set_main_widget(64, 48, 10000); gradient_widget->set_fill_with_background_color(false); gradient_widget->set_override_cursor(Gfx::StandardCursor::Hidden); gradient_widget->update(); diff --git a/Userland/Demos/LibGfxDemo/main.cpp b/Userland/Demos/LibGfxDemo/main.cpp index 115a284e5f..d61995bd83 100644 --- a/Userland/Demos/LibGfxDemo/main.cpp +++ b/Userland/Demos/LibGfxDemo/main.cpp @@ -202,7 +202,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-libgfx-demo"sv)); window->set_icon(app_icon.bitmap_for_size(16)); - (void)TRY(window->set_main_widget()); + (void)window->set_main_widget(); window->show(); return app->exec(); diff --git a/Userland/Demos/LibGfxScaleDemo/main.cpp b/Userland/Demos/LibGfxScaleDemo/main.cpp index f7eae7afac..2ef8920a35 100644 --- a/Userland/Demos/LibGfxScaleDemo/main.cpp +++ b/Userland/Demos/LibGfxScaleDemo/main.cpp @@ -121,7 +121,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-libgfx-demo"sv)); window->set_icon(app_icon.bitmap_for_size(16)); - (void)TRY(window->set_main_widget()); + (void)window->set_main_widget(); window->show(); return app->exec(); diff --git a/Userland/Demos/Mandelbrot/Mandelbrot.cpp b/Userland/Demos/Mandelbrot/Mandelbrot.cpp index f0c7131a57..7b1f88473e 100644 --- a/Userland/Demos/Mandelbrot/Mandelbrot.cpp +++ b/Userland/Demos/Mandelbrot/Mandelbrot.cpp @@ -411,7 +411,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_obey_widget_min_size(false); window->set_minimum_size(320, 240); window->resize(window->minimum_size() * 2); - auto mandelbrot = TRY(window->set_main_widget()); + auto mandelbrot = window->set_main_widget(); auto file_menu = window->add_menu("&File"_string); diff --git a/Userland/Demos/ModelGallery/main.cpp b/Userland/Demos/ModelGallery/main.cpp index ad6afd9bb5..f15f2788cf 100644 --- a/Userland/Demos/ModelGallery/main.cpp +++ b/Userland/Demos/ModelGallery/main.cpp @@ -28,7 +28,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_title("Model Gallery"); window->set_icon(app_icon.bitmap_for_size(16)); window->resize(430, 480); - (void)TRY(window->set_main_widget()); + (void)window->set_main_widget(); window->show(); return app->exec(); diff --git a/Userland/Demos/Screensaver/main.cpp b/Userland/Demos/Screensaver/main.cpp index 637da2cf15..da653165c2 100644 --- a/Userland/Demos/Screensaver/main.cpp +++ b/Userland/Demos/Screensaver/main.cpp @@ -85,7 +85,7 @@ ErrorOr serenity_main(Main::Arguments arguments) help_menu->add_action(GUI::CommonActions::make_command_palette_action(window)); help_menu->add_action(GUI::CommonActions::make_about_action("Screensaver"_string, app_icon, window)); - auto main_widget = TRY(window->set_main_widget()); + auto main_widget = window->set_main_widget(); main_widget->set_fill_with_background_color(true); main_widget->set_layout(); diff --git a/Userland/Demos/Starfield/Starfield.cpp b/Userland/Demos/Starfield/Starfield.cpp index 8cddd78a46..d1286ad82e 100644 --- a/Userland/Demos/Starfield/Starfield.cpp +++ b/Userland/Demos/Starfield/Starfield.cpp @@ -167,7 +167,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto window = TRY(Desktop::Screensaver::create_window("Starfield"sv, "app-starfield"sv)); - auto starfield_widget = TRY(window->set_main_widget(refresh_rate)); + auto starfield_widget = window->set_main_widget(refresh_rate); starfield_widget->set_fill_with_background_color(false); starfield_widget->set_override_cursor(Gfx::StandardCursor::Hidden); starfield_widget->update(); diff --git a/Userland/Demos/Tubes/main.cpp b/Userland/Demos/Tubes/main.cpp index 9f585e205a..19ca3b897a 100644 --- a/Userland/Demos/Tubes/main.cpp +++ b/Userland/Demos/Tubes/main.cpp @@ -29,7 +29,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto window = TRY(Desktop::Screensaver::create_window("Tubes"sv, "app-tubes"sv)); window->update(); - auto tubes_widget = TRY(window->set_main_widget(refresh_rate)); + auto tubes_widget = window->set_main_widget(refresh_rate); tubes_widget->set_fill_with_background_color(false); tubes_widget->set_override_cursor(Gfx::StandardCursor::Hidden); window->show(); diff --git a/Userland/Demos/WidgetGallery/main.cpp b/Userland/Demos/WidgetGallery/main.cpp index 88e31fd203..cae9c422dd 100644 --- a/Userland/Demos/WidgetGallery/main.cpp +++ b/Userland/Demos/WidgetGallery/main.cpp @@ -27,7 +27,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->resize(430, 480); window->set_title("Widget Gallery"); window->set_icon(app_icon.bitmap_for_size(16)); - (void)TRY(window->set_main_widget()); + (void)window->set_main_widget(); window->show(); return app->exec(); diff --git a/Userland/DevTools/GMLPlayground/MainWidget.cpp b/Userland/DevTools/GMLPlayground/MainWidget.cpp index 2b7c0df121..5b64a7bd48 100644 --- a/Userland/DevTools/GMLPlayground/MainWidget.cpp +++ b/Userland/DevTools/GMLPlayground/MainWidget.cpp @@ -76,7 +76,7 @@ ErrorOr> MainWidget::try_create(GUI::Icon const& icon) main_widget->m_preview_window = GUI::Window::construct(main_widget); main_widget->m_preview_window->set_title("Preview - GML Playground"); main_widget->m_preview_window->set_icon(icon.bitmap_for_size(16)); - main_widget->m_preview_window_widget = TRY(main_widget->m_preview_window->set_main_widget()); + main_widget->m_preview_window_widget = main_widget->m_preview_window->set_main_widget(); main_widget->m_preview_window_widget->set_fill_with_background_color(true); main_widget->m_preview = main_widget->m_preview_frame_widget; diff --git a/Userland/DevTools/GMLPlayground/main.cpp b/Userland/DevTools/GMLPlayground/main.cpp index 746a540fa4..6f1cb0caa6 100644 --- a/Userland/DevTools/GMLPlayground/main.cpp +++ b/Userland/DevTools/GMLPlayground/main.cpp @@ -45,7 +45,8 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_icon(app_icon.bitmap_for_size(16)); window->resize(800, 600); - auto main_widget = TRY(window->set_main_widget(app_icon)); + auto main_widget = TRY(MainWidget::try_create(app_icon)); + window->set_main_widget(main_widget); TRY(main_widget->initialize_menubar(window)); diff --git a/Userland/DevTools/HackStudio/Dialogs/Git/GitCommitDialog.cpp b/Userland/DevTools/HackStudio/Dialogs/Git/GitCommitDialog.cpp index b6addeecd3..ed2fe937a6 100644 --- a/Userland/DevTools/HackStudio/Dialogs/Git/GitCommitDialog.cpp +++ b/Userland/DevTools/HackStudio/Dialogs/Git/GitCommitDialog.cpp @@ -17,7 +17,7 @@ GitCommitDialog::GitCommitDialog(GUI::Window* parent) set_title("Commit"); set_icon(parent->icon()); - auto widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto widget = set_main_widget(); widget->load_from_gml(git_commit_dialog_gml).release_value_but_fixme_should_propagate_errors(); m_message_editor = widget->find_descendant_of_type_named("message_editor"); diff --git a/Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp b/Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp index 441874a42a..e55d35e22e 100644 --- a/Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp +++ b/Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp @@ -49,7 +49,7 @@ NewProjectDialog::NewProjectDialog(GUI::Window* parent) set_resizable(false); set_title("New Project"); - auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto main_widget = set_main_widget(); main_widget->load_from_gml(new_project_dialog_gml).release_value_but_fixme_should_propagate_errors(); m_icon_view_container = *main_widget->find_descendant_of_type_named("icon_view_container"); diff --git a/Userland/DevTools/HackStudio/Editor.cpp b/Userland/DevTools/HackStudio/Editor.cpp index f2b44d795c..4e6c939270 100644 --- a/Userland/DevTools/HackStudio/Editor.cpp +++ b/Userland/DevTools/HackStudio/Editor.cpp @@ -132,7 +132,7 @@ ErrorOr Editor::initialize_tooltip_window() s_tooltip_window->set_window_type(GUI::WindowType::Tooltip); } if (s_tooltip_page_view.is_null()) { - s_tooltip_page_view = TRY(s_tooltip_window->set_main_widget()); + s_tooltip_page_view = s_tooltip_window->set_main_widget(); } return {}; } diff --git a/Userland/DevTools/HackStudio/Locator.cpp b/Userland/DevTools/HackStudio/Locator.cpp index f270dff633..ef602d6804 100644 --- a/Userland/DevTools/HackStudio/Locator.cpp +++ b/Userland/DevTools/HackStudio/Locator.cpp @@ -149,7 +149,7 @@ Locator::Locator(Core::EventReceiver* parent) m_popup_window->set_window_type(GUI::WindowType::Popup); m_popup_window->set_rect(0, 0, 500, 200); - m_suggestion_view = m_popup_window->set_main_widget().release_value_but_fixme_should_propagate_errors(); + m_suggestion_view = m_popup_window->set_main_widget(); m_suggestion_view->set_column_headers_visible(false); m_suggestion_view->on_activation = [this](auto& index) { diff --git a/Userland/DevTools/Profiler/main.cpp b/Userland/DevTools/Profiler/main.cpp index c775748ac2..31b5b94175 100644 --- a/Userland/DevTools/Profiler/main.cpp +++ b/Userland/DevTools/Profiler/main.cpp @@ -88,7 +88,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_icon(app_icon.bitmap_for_size(16)); window->resize(800, 600); - auto main_widget = TRY(window->set_main_widget()); + auto main_widget = window->set_main_widget(); main_widget->set_fill_with_background_color(true); main_widget->set_layout(); @@ -319,7 +319,7 @@ static bool prompt_to_stop_profiling(pid_t pid, DeprecatedString const& process_ window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-profiler.png"sv).release_value_but_fixme_should_propagate_errors()); window->center_on_screen(); - auto widget = window->set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto widget = window->set_main_widget(); widget->set_fill_with_background_color(true); widget->set_layout(GUI::Margins { 0, 0, 16 }); diff --git a/Userland/Games/2048/GameSizeDialog.cpp b/Userland/Games/2048/GameSizeDialog.cpp index 6c629207af..d77b43d855 100644 --- a/Userland/Games/2048/GameSizeDialog.cpp +++ b/Userland/Games/2048/GameSizeDialog.cpp @@ -25,7 +25,7 @@ GameSizeDialog::GameSizeDialog(GUI::Window* parent, size_t board_size, size_t ta set_icon(parent->icon()); set_resizable(false); - auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto main_widget = set_main_widget(); main_widget->load_from_gml(game_size_dialog_gml).release_value_but_fixme_should_propagate_errors(); auto board_size_spinbox = main_widget->find_descendant_of_type_named("board_size_spinbox"); diff --git a/Userland/Games/2048/main.cpp b/Userland/Games/2048/main.cpp index 922f5f3536..33928a3ffe 100644 --- a/Userland/Games/2048/main.cpp +++ b/Userland/Games/2048/main.cpp @@ -65,7 +65,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_title("2048"); window->resize(315, 336); - auto main_widget = TRY(window->set_main_widget()); + auto main_widget = window->set_main_widget(); TRY(main_widget->load_from_gml(game_window_gml)); Game game { board_size, target_tile, evil_ai }; diff --git a/Userland/Games/BrickGame/main.cpp b/Userland/Games/BrickGame/main.cpp index 8a4ae9e49e..584381aa62 100644 --- a/Userland/Games/BrickGame/main.cpp +++ b/Userland/Games/BrickGame/main.cpp @@ -49,7 +49,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->resize(360, 462); window->set_resizable(false); - auto game = TRY(window->set_main_widget(app_name)); + auto game = window->set_main_widget(app_name); auto game_menu = window->add_menu("&Game"_string); diff --git a/Userland/Games/Chess/PromotionDialog.cpp b/Userland/Games/Chess/PromotionDialog.cpp index fdb77100ea..c0b015f327 100644 --- a/Userland/Games/Chess/PromotionDialog.cpp +++ b/Userland/Games/Chess/PromotionDialog.cpp @@ -17,7 +17,7 @@ PromotionDialog::PromotionDialog(ChessWidget& chess_widget) set_icon(chess_widget.window()->icon()); resize(70 * 4, 70); - auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto main_widget = set_main_widget(); main_widget->set_frame_style(Gfx::FrameStyle::SunkenContainer); main_widget->set_fill_with_background_color(true); main_widget->set_layout(); diff --git a/Userland/Games/Chess/main.cpp b/Userland/Games/Chess/main.cpp index 46fa895149..10812507b7 100644 --- a/Userland/Games/Chess/main.cpp +++ b/Userland/Games/Chess/main.cpp @@ -63,7 +63,8 @@ ErrorOr serenity_main(Main::Arguments arguments) auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-chess"sv)); auto window = GUI::Window::construct(); - auto widget = TRY(window->set_main_widget()); + auto widget = TRY(ChessWidget::try_create()); + window->set_main_widget(widget); auto engines = TRY(available_engines()); for (auto const& engine : engines) diff --git a/Userland/Games/ColorLines/main.cpp b/Userland/Games/ColorLines/main.cpp index 65013160fb..a717f7dc03 100644 --- a/Userland/Games/ColorLines/main.cpp +++ b/Userland/Games/ColorLines/main.cpp @@ -48,7 +48,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->resize(436, 481); window->set_resizable(false); - auto game = TRY(window->set_main_widget(app_name)); + auto game = window->set_main_widget(app_name); auto game_menu = window->add_menu("&Game"_string); diff --git a/Userland/Games/FlappyBug/main.cpp b/Userland/Games/FlappyBug/main.cpp index 3633572a1e..cf524d7b5f 100644 --- a/Userland/Games/FlappyBug/main.cpp +++ b/Userland/Games/FlappyBug/main.cpp @@ -43,7 +43,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_title("Flappy Bug"); window->set_double_buffering_enabled(false); window->set_resizable(false); - auto widget = TRY(window->set_main_widget(TRY(FlappyBug::Game::Bug::construct()), TRY(FlappyBug::Game::Cloud::construct()))); + auto widget = window->set_main_widget(TRY(FlappyBug::Game::Bug::construct()), TRY(FlappyBug::Game::Cloud::construct())); widget->on_game_end = [&](u32 score) { if (score <= high_score) diff --git a/Userland/Games/GameOfLife/main.cpp b/Userland/Games/GameOfLife/main.cpp index b4895a06d5..801a91e9f0 100644 --- a/Userland/Games/GameOfLife/main.cpp +++ b/Userland/Games/GameOfLife/main.cpp @@ -52,7 +52,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_double_buffering_enabled(false); window->set_title("Game of Life"); - auto main_widget = TRY(window->set_main_widget()); + auto main_widget = window->set_main_widget(); TRY(main_widget->load_from_gml(game_of_life_gml)); main_widget->set_fill_with_background_color(true); diff --git a/Userland/Games/Hearts/Game.cpp b/Userland/Games/Hearts/Game.cpp index f9e803973d..0086470709 100644 --- a/Userland/Games/Hearts/Game.cpp +++ b/Userland/Games/Hearts/Game.cpp @@ -122,7 +122,7 @@ void Game::show_score_card(bool game_over) score_dialog->set_resizable(false); score_dialog->set_icon(window()->icon()); - auto score_widget = score_dialog->set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto score_widget = score_dialog->set_main_widget(); score_widget->set_fill_with_background_color(true); score_widget->set_layout(10, 15); diff --git a/Userland/Games/Hearts/SettingsDialog.cpp b/Userland/Games/Hearts/SettingsDialog.cpp index abbb51d825..cbf85c8903 100644 --- a/Userland/Games/Hearts/SettingsDialog.cpp +++ b/Userland/Games/Hearts/SettingsDialog.cpp @@ -19,7 +19,7 @@ SettingsDialog::SettingsDialog(GUI::Window* parent, DeprecatedString player_name set_icon(parent->icon()); set_resizable(false); - auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto main_widget = set_main_widget(); main_widget->set_fill_with_background_color(true); main_widget->set_layout(4); diff --git a/Userland/Games/Hearts/main.cpp b/Userland/Games/Hearts/main.cpp index 9c3ebce2eb..076d869b46 100644 --- a/Userland/Games/Hearts/main.cpp +++ b/Userland/Games/Hearts/main.cpp @@ -50,7 +50,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto window = GUI::Window::construct(); window->set_title("Hearts"); - auto widget = TRY(window->set_main_widget()); + auto widget = window->set_main_widget(); TRY(widget->load_from_gml(hearts_gml)); auto& game = *widget->find_descendant_of_type_named("game"); diff --git a/Userland/Games/MasterWord/main.cpp b/Userland/Games/MasterWord/main.cpp index 77389e410c..88f3466841 100644 --- a/Userland/Games/MasterWord/main.cpp +++ b/Userland/Games/MasterWord/main.cpp @@ -47,7 +47,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_resizable(false); window->set_auto_shrink(true); - auto main_widget = TRY(window->set_main_widget()); + auto main_widget = window->set_main_widget(); TRY(main_widget->load_from_gml(master_word_gml)); auto& game = *main_widget->find_descendant_of_type_named("word_game"); auto& statusbar = *main_widget->find_descendant_of_type_named("statusbar"); diff --git a/Userland/Games/Minesweeper/CustomGameDialog.cpp b/Userland/Games/Minesweeper/CustomGameDialog.cpp index fb71b34b02..c262ebfc03 100644 --- a/Userland/Games/Minesweeper/CustomGameDialog.cpp +++ b/Userland/Games/Minesweeper/CustomGameDialog.cpp @@ -45,7 +45,7 @@ CustomGameDialog::CustomGameDialog(Window* parent_window) set_resizable(false); set_title("Custom Game"); - auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); + auto main_widget = set_main_widget(); main_widget->load_from_gml(minesweeper_custom_game_window_gml).release_value_but_fixme_should_propagate_errors(); m_columns_spinbox = *main_widget->find_descendant_of_type_named("columns_spinbox"); diff --git a/Userland/Games/Minesweeper/main.cpp b/Userland/Games/Minesweeper/main.cpp index fa3195b8f7..38eeeb32ac 100644 --- a/Userland/Games/Minesweeper/main.cpp +++ b/Userland/Games/Minesweeper/main.cpp @@ -49,7 +49,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_title("Minesweeper"); window->set_auto_shrink(true); - auto widget = TRY(window->set_main_widget()); + auto widget = window->set_main_widget(); TRY(widget->load_from_gml(minesweeper_window_gml)); auto& flag_label = *widget->find_descendant_of_type_named("flag_label"); diff --git a/Userland/Games/Snake/main.cpp b/Userland/Games/Snake/main.cpp index f54c0dbae7..530b5b07e2 100644 --- a/Userland/Games/Snake/main.cpp +++ b/Userland/Games/Snake/main.cpp @@ -52,7 +52,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_title("Snake"); window->resize(324, 345); - auto widget = TRY(window->set_main_widget()); + auto widget = window->set_main_widget(); TRY(widget->load_from_gml(snake_gml)); auto& game = *widget->find_descendant_of_type_named("game"); diff --git a/Userland/Games/Solitaire/main.cpp b/Userland/Games/Solitaire/main.cpp index e699a0baed..318f5a397f 100644 --- a/Userland/Games/Solitaire/main.cpp +++ b/Userland/Games/Solitaire/main.cpp @@ -84,7 +84,7 @@ ErrorOr serenity_main(Main::Arguments arguments) if (mode >= Solitaire::Mode::__Count) update_mode(Solitaire::Mode::SingleCardDraw); - auto widget = TRY(window->set_main_widget()); + auto widget = window->set_main_widget(); TRY(widget->load_from_gml(solitaire_gml)); auto& game = *widget->find_descendant_of_type_named("game"); diff --git a/Userland/Games/Spider/main.cpp b/Userland/Games/Spider/main.cpp index 17afae278a..9d3274c7f9 100644 --- a/Userland/Games/Spider/main.cpp +++ b/Userland/Games/Spider/main.cpp @@ -109,7 +109,7 @@ ErrorOr serenity_main(Main::Arguments arguments) if (statistic_display >= StatisticDisplay::__Count) update_statistic_display(StatisticDisplay::HighScore); - auto widget = TRY(window->set_main_widget()); + auto widget = window->set_main_widget(); TRY(widget->load_from_gml(spider_gml)); auto& game = *widget->find_descendant_of_type_named("game"); diff --git a/Userland/Libraries/LibGUI/AboutDialog.cpp b/Userland/Libraries/LibGUI/AboutDialog.cpp index 4525d62f72..de64deca1d 100644 --- a/Userland/Libraries/LibGUI/AboutDialog.cpp +++ b/Userland/Libraries/LibGUI/AboutDialog.cpp @@ -24,7 +24,7 @@ NonnullRefPtr AboutDialog::create(String const& name, String versio auto dialog = adopt_ref(*new AboutDialog(name, version, icon, parent_window)); dialog->set_title(DeprecatedString::formatted("About {}", name)); - auto widget = MUST(dialog->set_main_widget()); + auto widget = dialog->set_main_widget(); MUST(widget->load_from_gml(about_dialog_gml)); auto icon_wrapper = widget->find_descendant_of_type_named("icon_wrapper"); diff --git a/Userland/Libraries/LibGUI/Application.cpp b/Userland/Libraries/LibGUI/Application.cpp index 8a19a13e21..ada928fa6c 100644 --- a/Userland/Libraries/LibGUI/Application.cpp +++ b/Userland/Libraries/LibGUI/Application.cpp @@ -45,7 +45,7 @@ private: { set_window_type(WindowType::Tooltip); set_obey_widget_min_size(false); - m_label = set_main_widget