diff --git a/Userland/Applications/Browser/BookmarksBarWidget.cpp b/Userland/Applications/Browser/BookmarksBarWidget.cpp index f2dc64baeb..1220791ff3 100644 --- a/Userland/Applications/Browser/BookmarksBarWidget.cpp +++ b/Userland/Applications/Browser/BookmarksBarWidget.cpp @@ -48,8 +48,7 @@ private: : Dialog(parent_window) { auto widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); - if (!widget->load_from_gml(edit_bookmark_gml)) - VERIFY_NOT_REACHED(); + widget->try_load_from_gml(edit_bookmark_gml).release_value_but_fixme_should_propagate_errors(); set_resizable(false); resize(260, 85); diff --git a/Userland/Applications/Browser/BrowserWindow.cpp b/Userland/Applications/Browser/BrowserWindow.cpp index f11b259814..a854492892 100644 --- a/Userland/Applications/Browser/BrowserWindow.cpp +++ b/Userland/Applications/Browser/BrowserWindow.cpp @@ -74,7 +74,7 @@ BrowserWindow::BrowserWindow(CookieJar& cookie_jar, URL url) set_title("Browser"); auto widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); - widget->load_from_gml(browser_window_gml); + widget->try_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/History/HistoryWidget.cpp b/Userland/Applications/Browser/History/HistoryWidget.cpp index 6519e2a9ff..a901bf5a15 100644 --- a/Userland/Applications/Browser/History/HistoryWidget.cpp +++ b/Userland/Applications/Browser/History/HistoryWidget.cpp @@ -11,7 +11,7 @@ namespace Browser { HistoryWidget::HistoryWidget() { - load_from_gml(history_widget_gml); + try_load_from_gml(history_widget_gml).release_value_but_fixme_should_propagate_errors(); m_table_view = find_descendant_of_type_named("history_tableview"); m_textbox = find_descendant_of_type_named("history_filter_textbox"); diff --git a/Userland/Applications/Browser/StorageWidget.cpp b/Userland/Applications/Browser/StorageWidget.cpp index 2b0418fb41..2e8641373d 100644 --- a/Userland/Applications/Browser/StorageWidget.cpp +++ b/Userland/Applications/Browser/StorageWidget.cpp @@ -18,7 +18,7 @@ namespace Browser { StorageWidget::StorageWidget() { - load_from_gml(storage_widget_gml); + try_load_from_gml(storage_widget_gml).release_value_but_fixme_should_propagate_errors(); auto& tab_widget = *find_descendant_of_type_named("tab_widget"); m_cookies_table_view = tab_widget.find_descendant_of_type_named("cookies_tableview"); diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp index e9ba11f7a0..6eca41972b 100644 --- a/Userland/Applications/Browser/Tab.cpp +++ b/Userland/Applications/Browser/Tab.cpp @@ -114,7 +114,7 @@ void Tab::update_status(Optional text_override, i32 count_wait Tab::Tab(BrowserWindow& window) { - load_from_gml(tab_gml); + try_load_from_gml(tab_gml).release_value_but_fixme_should_propagate_errors(); m_toolbar_container = *find_descendant_of_type_named("toolbar_container"); auto& toolbar = *find_descendant_of_type_named("toolbar"); diff --git a/Userland/Applications/BrowserSettings/BrowserSettingsWidget.cpp b/Userland/Applications/BrowserSettings/BrowserSettingsWidget.cpp index ae5709c63e..02a601734b 100644 --- a/Userland/Applications/BrowserSettings/BrowserSettingsWidget.cpp +++ b/Userland/Applications/BrowserSettings/BrowserSettingsWidget.cpp @@ -59,7 +59,7 @@ private: BrowserSettingsWidget::BrowserSettingsWidget() { - load_from_gml(browser_settings_widget_gml); + try_load_from_gml(browser_settings_widget_gml).release_value_but_fixme_should_propagate_errors(); m_homepage_url_textbox = find_descendant_of_type_named("homepage_url_textbox"); m_homepage_url_textbox->set_text(Config::read_string("Browser"sv, "Preferences"sv, "Home"sv, default_homepage_url), GUI::AllowCallback::No); diff --git a/Userland/Applications/BrowserSettings/ContentFilterSettingsWidget.cpp b/Userland/Applications/BrowserSettings/ContentFilterSettingsWidget.cpp index 66091823db..e99e26ebdd 100644 --- a/Userland/Applications/BrowserSettings/ContentFilterSettingsWidget.cpp +++ b/Userland/Applications/BrowserSettings/ContentFilterSettingsWidget.cpp @@ -108,7 +108,7 @@ void DomainListModel::reset_default_values() ContentFilterSettingsWidget::ContentFilterSettingsWidget() { - load_from_gml(content_filter_settings_widget_gml); + try_load_from_gml(content_filter_settings_widget_gml).release_value_but_fixme_should_propagate_errors(); m_enable_content_filtering_checkbox = find_descendant_of_type_named("enable_content_filtering_checkbox"); m_domain_list_view = find_descendant_of_type_named("domain_list_view"); m_add_new_domain_button = find_descendant_of_type_named("add_new_domain_button"); diff --git a/Userland/Applications/Calculator/CalculatorWidget.cpp b/Userland/Applications/Calculator/CalculatorWidget.cpp index a6615211a4..e82306cddb 100644 --- a/Userland/Applications/Calculator/CalculatorWidget.cpp +++ b/Userland/Applications/Calculator/CalculatorWidget.cpp @@ -18,7 +18,7 @@ CalculatorWidget::CalculatorWidget() { - load_from_gml(calculator_gml); + try_load_from_gml(calculator_gml).release_value_but_fixme_should_propagate_errors(); m_entry = *find_descendant_of_type_named("entry_textbox"); m_entry->set_relative_rect(5, 5, 244, 26); diff --git a/Userland/Applications/Calendar/main.cpp b/Userland/Applications/Calendar/main.cpp index 56940b1633..2a031ac834 100644 --- a/Userland/Applications/Calendar/main.cpp +++ b/Userland/Applications/Calendar/main.cpp @@ -43,7 +43,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_icon(app_icon.bitmap_for_size(16)); auto main_widget = TRY(window->set_main_widget()); - main_widget->load_from_gml(calendar_window_gml); + TRY(main_widget->try_load_from_gml(calendar_window_gml)); auto toolbar = main_widget->find_descendant_of_type_named("toolbar"); auto calendar = main_widget->find_descendant_of_type_named("calendar"); diff --git a/Userland/Applications/CalendarSettings/CalendarSettingsWidget.cpp b/Userland/Applications/CalendarSettings/CalendarSettingsWidget.cpp index 631f74e166..0da16236d2 100644 --- a/Userland/Applications/CalendarSettings/CalendarSettingsWidget.cpp +++ b/Userland/Applications/CalendarSettings/CalendarSettingsWidget.cpp @@ -31,7 +31,7 @@ void CalendarSettingsWidget::reset_default_values() CalendarSettingsWidget::CalendarSettingsWidget() { - load_from_gml(calendar_settings_widget_gml); + try_load_from_gml(calendar_settings_widget_gml).release_value_but_fixme_should_propagate_errors(); m_first_day_of_week_combobox = *find_descendant_of_type_named("first_day_of_week"); m_first_day_of_week_combobox->set_text(Config::read_string("Calendar"sv, "View"sv, "FirstDayOfWeek"sv, "Sunday"sv)); diff --git a/Userland/Applications/CharacterMap/CharacterMapWidget.cpp b/Userland/Applications/CharacterMap/CharacterMapWidget.cpp index 62aa121de1..997d22e9c8 100644 --- a/Userland/Applications/CharacterMap/CharacterMapWidget.cpp +++ b/Userland/Applications/CharacterMap/CharacterMapWidget.cpp @@ -27,7 +27,7 @@ CharacterMapWidget::CharacterMapWidget() { - load_from_gml(character_map_window_gml); + try_load_from_gml(character_map_window_gml).release_value_but_fixme_should_propagate_errors(); m_toolbar = find_descendant_of_type_named("toolbar"); m_font_name_label = find_descendant_of_type_named("font_name"); diff --git a/Userland/Applications/CharacterMap/CharacterSearchWidget.cpp b/Userland/Applications/CharacterMap/CharacterSearchWidget.cpp index 382d5b7ad0..ef13b51a5d 100644 --- a/Userland/Applications/CharacterMap/CharacterSearchWidget.cpp +++ b/Userland/Applications/CharacterMap/CharacterSearchWidget.cpp @@ -53,7 +53,7 @@ private: CharacterSearchWidget::CharacterSearchWidget() { - load_from_gml(character_search_window_gml); + try_load_from_gml(character_search_window_gml).release_value_but_fixme_should_propagate_errors(); m_search_input = find_descendant_of_type_named("search_input"); m_search_button = find_descendant_of_type_named("search_button"); diff --git a/Userland/Applications/ClockSettings/ClockSettingsWidget.cpp b/Userland/Applications/ClockSettings/ClockSettingsWidget.cpp index b5869c8940..e047528eae 100644 --- a/Userland/Applications/ClockSettings/ClockSettingsWidget.cpp +++ b/Userland/Applications/ClockSettings/ClockSettingsWidget.cpp @@ -21,7 +21,7 @@ constexpr auto time_format_24h_seconds = "%T"sv; ClockSettingsWidget::ClockSettingsWidget() { - load_from_gml(clock_settings_widget_gml); + try_load_from_gml(clock_settings_widget_gml).release_value_but_fixme_should_propagate_errors(); m_24_hour_radio = *find_descendant_of_type_named("24hour_radio"); auto& twelve_hour_radio = *find_descendant_of_type_named("12hour_radio"); diff --git a/Userland/Applications/ClockSettings/TimeZoneSettingsWidget.cpp b/Userland/Applications/ClockSettings/TimeZoneSettingsWidget.cpp index 3b62cf51f2..f9947aa4b1 100644 --- a/Userland/Applications/ClockSettings/TimeZoneSettingsWidget.cpp +++ b/Userland/Applications/ClockSettings/TimeZoneSettingsWidget.cpp @@ -61,7 +61,7 @@ ErrorOr> TimeZoneSettingsWidget::create() TimeZoneSettingsWidget::TimeZoneSettingsWidget() { - load_from_gml(time_zone_settings_widget_gml); + try_load_from_gml(time_zone_settings_widget_gml).release_value_but_fixme_should_propagate_errors(); static auto time_zones = TimeZone::all_time_zones(); m_time_zone = TimeZone::system_time_zone(); diff --git a/Userland/Applications/CrashReporter/main.cpp b/Userland/Applications/CrashReporter/main.cpp index 3f5ce66f19..590f23e2b0 100644 --- a/Userland/Applications/CrashReporter/main.cpp +++ b/Userland/Applications/CrashReporter/main.cpp @@ -182,7 +182,7 @@ ErrorOr serenity_main(Main::Arguments arguments) }; auto widget = TRY(window->set_main_widget()); - widget->load_from_gml(crash_reporter_window_gml); + TRY(widget->try_load_from_gml(crash_reporter_window_gml)); auto& icon_image_widget = *widget->find_descendant_of_type_named("icon"); icon_image_widget.set_bitmap(GUI::FileIconProvider::icon_for_executable(executable_path).bitmap_for_size(32)); diff --git a/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp b/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp index 0c87be98f2..eaef88f825 100644 --- a/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp +++ b/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp @@ -42,7 +42,7 @@ BackgroundSettingsWidget::BackgroundSettingsWidget(bool& background_settings_cha void BackgroundSettingsWidget::create_frame() { - load_from_gml(background_settings_gml); + try_load_from_gml(background_settings_gml).release_value_but_fixme_should_propagate_errors(); m_monitor_widget = *find_descendant_of_type_named("monitor_widget"); diff --git a/Userland/Applications/DisplaySettings/DesktopSettingsWidget.cpp b/Userland/Applications/DisplaySettings/DesktopSettingsWidget.cpp index 3fe62e439d..1a9bd32f91 100644 --- a/Userland/Applications/DisplaySettings/DesktopSettingsWidget.cpp +++ b/Userland/Applications/DisplaySettings/DesktopSettingsWidget.cpp @@ -23,7 +23,7 @@ DesktopSettingsWidget::DesktopSettingsWidget() void DesktopSettingsWidget::create_frame() { - load_from_gml(desktop_settings_gml); + try_load_from_gml(desktop_settings_gml).release_value_but_fixme_should_propagate_errors(); m_workspace_rows_spinbox = *find_descendant_of_type_named("workspace_rows_spinbox"); m_workspace_rows_spinbox->on_change = [&](auto) { diff --git a/Userland/Applications/DisplaySettings/EffectsSettingsWidget.cpp b/Userland/Applications/DisplaySettings/EffectsSettingsWidget.cpp index f62ce4bbbe..8c35223d0d 100644 --- a/Userland/Applications/DisplaySettings/EffectsSettingsWidget.cpp +++ b/Userland/Applications/DisplaySettings/EffectsSettingsWidget.cpp @@ -18,7 +18,7 @@ namespace DisplaySettings { EffectsSettingsWidget::EffectsSettingsWidget() { - load_from_gml(effects_settings_gml); + try_load_from_gml(effects_settings_gml).release_value_but_fixme_should_propagate_errors(); m_geometry_combobox = find_descendant_of_type_named("geometry_combobox"); m_geometry_combobox->set_only_allow_values_from_model(true); diff --git a/Userland/Applications/DisplaySettings/FontSettingsWidget.cpp b/Userland/Applications/DisplaySettings/FontSettingsWidget.cpp index 5a55f48c65..7aed9319b6 100644 --- a/Userland/Applications/DisplaySettings/FontSettingsWidget.cpp +++ b/Userland/Applications/DisplaySettings/FontSettingsWidget.cpp @@ -19,7 +19,7 @@ static void update_label_with_font(GUI::Label&, Gfx::Font const&); FontSettingsWidget::FontSettingsWidget() { - load_from_gml(font_settings_gml); + try_load_from_gml(font_settings_gml).release_value_but_fixme_should_propagate_errors(); auto& default_font = Gfx::FontDatabase::default_font(); m_default_font_label = *find_descendant_of_type_named("default_font_label"); diff --git a/Userland/Applications/DisplaySettings/MonitorSettingsWidget.cpp b/Userland/Applications/DisplaySettings/MonitorSettingsWidget.cpp index c1639b9bbd..0c1553fa10 100644 --- a/Userland/Applications/DisplaySettings/MonitorSettingsWidget.cpp +++ b/Userland/Applications/DisplaySettings/MonitorSettingsWidget.cpp @@ -71,7 +71,7 @@ void MonitorSettingsWidget::create_resolution_list() void MonitorSettingsWidget::create_frame() { - load_from_gml(monitor_settings_window_gml); + try_load_from_gml(monitor_settings_window_gml).release_value_but_fixme_should_propagate_errors(); m_monitor_widget = *find_descendant_of_type_named("monitor_widget"); diff --git a/Userland/Applications/DisplaySettings/ThemesSettingsWidget.cpp b/Userland/Applications/DisplaySettings/ThemesSettingsWidget.cpp index 20fb6f2df1..1df8a13c37 100644 --- a/Userland/Applications/DisplaySettings/ThemesSettingsWidget.cpp +++ b/Userland/Applications/DisplaySettings/ThemesSettingsWidget.cpp @@ -21,7 +21,7 @@ namespace DisplaySettings { ThemesSettingsWidget::ThemesSettingsWidget(bool& background_settings_changed) : m_background_settings_changed { background_settings_changed } { - load_from_gml(themes_settings_gml); + try_load_from_gml(themes_settings_gml).release_value_but_fixme_should_propagate_errors(); m_themes = MUST(Gfx::list_installed_system_themes()); size_t current_theme_index; diff --git a/Userland/Applications/Escalator/EscalatorWindow.cpp b/Userland/Applications/Escalator/EscalatorWindow.cpp index 08f60d76b7..63e8d048e2 100644 --- a/Userland/Applications/Escalator/EscalatorWindow.cpp +++ b/Userland/Applications/Escalator/EscalatorWindow.cpp @@ -32,7 +32,7 @@ EscalatorWindow::EscalatorWindow(StringView executable, Vector argum set_minimizable(false); auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); - main_widget->load_from_gml(escalator_gml); + main_widget->try_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/FileOperationProgressWidget.cpp b/Userland/Applications/FileManager/FileOperationProgressWidget.cpp index e708c7a5cb..ba6c2f65b1 100644 --- a/Userland/Applications/FileManager/FileOperationProgressWidget.cpp +++ b/Userland/Applications/FileManager/FileOperationProgressWidget.cpp @@ -23,7 +23,7 @@ FileOperationProgressWidget::FileOperationProgressWidget(FileOperation operation : m_operation(operation) , m_helper_pipe(move(helper_pipe)) { - load_from_gml(file_operation_progress_gml); + try_load_from_gml(file_operation_progress_gml).release_value_but_fixme_should_propagate_errors(); auto& button = *find_descendant_of_type_named("button"); diff --git a/Userland/Applications/FileManager/PropertiesWindow.cpp b/Userland/Applications/FileManager/PropertiesWindow.cpp index 146cf99356..40e98673d5 100644 --- a/Userland/Applications/FileManager/PropertiesWindow.cpp +++ b/Userland/Applications/FileManager/PropertiesWindow.cpp @@ -45,7 +45,7 @@ PropertiesWindow::PropertiesWindow(DeprecatedString const& path, bool disable_re auto& tab_widget = main_widget->add(); auto& general_tab = tab_widget.add_tab("General"); - general_tab.load_from_gml(properties_window_general_tab_gml); + general_tab.try_load_from_gml(properties_window_general_tab_gml).release_value_but_fixme_should_propagate_errors(); m_name = lexical_path.basename(); m_path = lexical_path.string(); diff --git a/Userland/Applications/FileManager/main.cpp b/Userland/Applications/FileManager/main.cpp index 37c5658eaf..0bf32a9bdf 100644 --- a/Userland/Applications/FileManager/main.cpp +++ b/Userland/Applications/FileManager/main.cpp @@ -580,8 +580,7 @@ ErrorOr run_in_windowed_mode(DeprecatedString const& initial_location, Depr auto was_maximized = Config::read_bool("FileManager"sv, "Window"sv, "Maximized"sv, false); auto widget = TRY(window->set_main_widget()); - - widget->load_from_gml(file_manager_window_gml); + TRY(widget->try_load_from_gml(file_manager_window_gml)); auto& toolbar_container = *widget->find_descendant_of_type_named("toolbar_container"); auto& main_toolbar = *widget->find_descendant_of_type_named("main_toolbar"); diff --git a/Userland/Applications/FontEditor/MainWidget.cpp b/Userland/Applications/FontEditor/MainWidget.cpp index 52be7f840f..fe71c3ca51 100644 --- a/Userland/Applications/FontEditor/MainWidget.cpp +++ b/Userland/Applications/FontEditor/MainWidget.cpp @@ -66,7 +66,7 @@ ErrorOr> MainWidget::create_preview_window() window->center_within(*this->window()); auto main_widget = TRY(window->set_main_widget()); - main_widget->load_from_gml(font_preview_window_gml); + TRY(main_widget->try_load_from_gml(font_preview_window_gml)); m_preview_label = find_descendant_of_type_named("preview_label"); m_preview_label->set_font(edited_font()); @@ -420,7 +420,7 @@ ErrorOr MainWidget::create_undo_stack() MainWidget::MainWidget() { - load_from_gml(font_editor_window_gml); + try_load_from_gml(font_editor_window_gml).release_value_but_fixme_should_propagate_errors(); m_font_metadata_groupbox = find_descendant_of_type_named("font_metadata_groupbox"); m_unicode_block_container = find_descendant_of_type_named("unicode_block_container"); diff --git a/Userland/Applications/FontEditor/NewFontDialog.cpp b/Userland/Applications/FontEditor/NewFontDialog.cpp index 36c92e3df4..f5133ecc63 100644 --- a/Userland/Applications/FontEditor/NewFontDialog.cpp +++ b/Userland/Applications/FontEditor/NewFontDialog.cpp @@ -128,7 +128,7 @@ NewFontDialog::NewFontDialog(GUI::Window* parent_window) set_title("New Font"); m_font_properties_page = GUI::WizardPage::construct("Typeface properties", "Edit details about this font."); - m_font_properties_page->body_widget().load_from_gml(new_font_dialog_page_1_gml); + m_font_properties_page->body_widget().try_load_from_gml(new_font_dialog_page_1_gml).release_value_but_fixme_should_propagate_errors(); m_name_textbox = m_font_properties_page->body_widget().find_descendant_of_type_named("name_textbox"); m_family_textbox = m_font_properties_page->body_widget().find_descendant_of_type_named("family_textbox"); @@ -156,7 +156,7 @@ NewFontDialog::NewFontDialog(GUI::Window* parent_window) }; m_glyph_properties_page = GUI::WizardPage::construct("Glyph properties", "Edit details about this font."); - m_glyph_properties_page->body_widget().load_from_gml(new_font_dialog_page_2_gml); + m_glyph_properties_page->body_widget().try_load_from_gml(new_font_dialog_page_2_gml).release_value_but_fixme_should_propagate_errors(); m_glyph_properties_page->set_is_final_page(true); m_glyph_height_spinbox = m_glyph_properties_page->body_widget().find_descendant_of_type_named("height_spinbox"); diff --git a/Userland/Applications/GamesSettings/CardSettingsWidget.cpp b/Userland/Applications/GamesSettings/CardSettingsWidget.cpp index 5a2788f787..fc225a8b97 100644 --- a/Userland/Applications/GamesSettings/CardSettingsWidget.cpp +++ b/Userland/Applications/GamesSettings/CardSettingsWidget.cpp @@ -15,7 +15,7 @@ static constexpr StringView default_card_back_image_path = "/res/icons/cards/bug CardSettingsWidget::CardSettingsWidget() { - load_from_gml(card_settings_widget_gml); + try_load_from_gml(card_settings_widget_gml).release_value_but_fixme_should_propagate_errors(); auto background_color = Gfx::Color::from_string(Config::read_string("Games"sv, "Cards"sv, "BackgroundColor"sv)).value_or(Gfx::Color::from_rgb(0x008000)); diff --git a/Userland/Applications/Help/MainWidget.cpp b/Userland/Applications/Help/MainWidget.cpp index 8a6fa5433a..e55458094a 100644 --- a/Userland/Applications/Help/MainWidget.cpp +++ b/Userland/Applications/Help/MainWidget.cpp @@ -42,7 +42,7 @@ namespace Help { MainWidget::MainWidget() { - load_from_gml(help_window_gml); + try_load_from_gml(help_window_gml).release_value_but_fixme_should_propagate_errors(); m_toolbar = find_descendant_of_type_named("toolbar"); m_tab_widget = find_descendant_of_type_named("tab_widget"); m_search_container = find_descendant_of_type_named("search_container"); diff --git a/Userland/Applications/HexEditor/FindDialog.cpp b/Userland/Applications/HexEditor/FindDialog.cpp index 40c7669e76..a0e4dea59d 100644 --- a/Userland/Applications/HexEditor/FindDialog.cpp +++ b/Userland/Applications/HexEditor/FindDialog.cpp @@ -100,8 +100,7 @@ FindDialog::FindDialog() set_title("Find"); auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); - if (!main_widget->load_from_gml(find_dialog_gml)) - VERIFY_NOT_REACHED(); + main_widget->try_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"); m_find_button = *main_widget->find_descendant_of_type_named("find_button"); diff --git a/Userland/Applications/HexEditor/GoToOffsetDialog.cpp b/Userland/Applications/HexEditor/GoToOffsetDialog.cpp index c89d0a06d4..272f4d4682 100644 --- a/Userland/Applications/HexEditor/GoToOffsetDialog.cpp +++ b/Userland/Applications/HexEditor/GoToOffsetDialog.cpp @@ -97,8 +97,7 @@ GoToOffsetDialog::GoToOffsetDialog() set_title("Go to Offset"); auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); - if (!main_widget->load_from_gml(go_to_offset_dialog_gml)) - VERIFY_NOT_REACHED(); + main_widget->try_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"); m_go_button = *main_widget->find_descendant_of_type_named("go_button"); diff --git a/Userland/Applications/HexEditor/HexEditorWidget.cpp b/Userland/Applications/HexEditor/HexEditorWidget.cpp index 1c5fc9025b..0fefa859ed 100644 --- a/Userland/Applications/HexEditor/HexEditorWidget.cpp +++ b/Userland/Applications/HexEditor/HexEditorWidget.cpp @@ -40,7 +40,7 @@ REGISTER_WIDGET(HexEditor, HexEditor); HexEditorWidget::HexEditorWidget() { - load_from_gml(hex_editor_window_gml); + try_load_from_gml(hex_editor_window_gml).release_value_but_fixme_should_propagate_errors(); m_toolbar = *find_descendant_of_type_named("toolbar"); m_toolbar_container = *find_descendant_of_type_named("toolbar_container"); diff --git a/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp b/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp index 890dbee993..f704fa3aa9 100644 --- a/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp +++ b/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp @@ -52,8 +52,7 @@ private: : Dialog(parent_window) { auto widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); - if (!widget->load_from_gml(keymap_dialog_gml)) - VERIFY_NOT_REACHED(); + widget->try_load_from_gml(keymap_dialog_gml).release_value_but_fixme_should_propagate_errors(); set_resizable(false); resize(190, 54); @@ -152,7 +151,7 @@ private: KeyboardSettingsWidget::KeyboardSettingsWidget() { - load_from_gml(keyboard_widget_gml); + try_load_from_gml(keyboard_widget_gml).release_value_but_fixme_should_propagate_errors(); auto proc_keymap = Core::File::construct("/sys/kernel/keymap"); if (!proc_keymap->open(Core::OpenMode::ReadOnly)) diff --git a/Userland/Applications/Mail/MailWidget.cpp b/Userland/Applications/Mail/MailWidget.cpp index 16a3eb85a0..40ddd6e901 100644 --- a/Userland/Applications/Mail/MailWidget.cpp +++ b/Userland/Applications/Mail/MailWidget.cpp @@ -24,7 +24,7 @@ MailWidget::MailWidget() { - load_from_gml(mail_window_gml); + try_load_from_gml(mail_window_gml).release_value_but_fixme_should_propagate_errors(); m_mailbox_list = *find_descendant_of_type_named("mailbox_list"); m_individual_mailbox_view = *find_descendant_of_type_named("individual_mailbox_view"); diff --git a/Userland/Applications/MailSettings/MailSettingsWidget.cpp b/Userland/Applications/MailSettings/MailSettingsWidget.cpp index 0a3d75dd20..a48db9495c 100644 --- a/Userland/Applications/MailSettings/MailSettingsWidget.cpp +++ b/Userland/Applications/MailSettings/MailSettingsWidget.cpp @@ -42,7 +42,7 @@ MailSettingsWidget::MailSettingsWidget() m_common_ports.append("143"); m_common_ports.append("993"); - load_from_gml(mail_settings_widget_gml); + try_load_from_gml(mail_settings_widget_gml).release_value_but_fixme_should_propagate_errors(); m_server_inputbox = *find_descendant_of_type_named("server_input"); m_server_inputbox->set_text(Config::read_string("Mail"sv, "Connection"sv, "Server"sv, ""sv)); diff --git a/Userland/Applications/MouseSettings/HighlightWidget.cpp b/Userland/Applications/MouseSettings/HighlightWidget.cpp index eaa16f88e1..7f8918f860 100644 --- a/Userland/Applications/MouseSettings/HighlightWidget.cpp +++ b/Userland/Applications/MouseSettings/HighlightWidget.cpp @@ -11,7 +11,7 @@ HighlightWidget::HighlightWidget() { - load_from_gml(highlight_widget_gml); + try_load_from_gml(highlight_widget_gml).release_value_but_fixme_should_propagate_errors(); m_highlight_preview = find_descendant_of_type_named("preview_frame")->add(palette()); diff --git a/Userland/Applications/MouseSettings/MouseWidget.cpp b/Userland/Applications/MouseSettings/MouseWidget.cpp index 8841a7cf3a..7f00ef06b5 100644 --- a/Userland/Applications/MouseSettings/MouseWidget.cpp +++ b/Userland/Applications/MouseSettings/MouseWidget.cpp @@ -20,7 +20,7 @@ constexpr int double_click_speed_default = 250; MouseWidget::MouseWidget() { - load_from_gml(mouse_widget_gml); + try_load_from_gml(mouse_widget_gml).release_value_but_fixme_should_propagate_errors(); m_speed_label = *find_descendant_of_type_named("speed_label"); m_speed_slider = *find_descendant_of_type_named("speed_slider"); diff --git a/Userland/Applications/MouseSettings/ThemeWidget.cpp b/Userland/Applications/MouseSettings/ThemeWidget.cpp index 56ab89be70..588e27485b 100644 --- a/Userland/Applications/MouseSettings/ThemeWidget.cpp +++ b/Userland/Applications/MouseSettings/ThemeWidget.cpp @@ -98,7 +98,7 @@ void ThemeModel::invalidate() ThemeWidget::ThemeWidget() { - load_from_gml(theme_widget_gml); + try_load_from_gml(theme_widget_gml).release_value_but_fixme_should_propagate_errors(); m_cursors_tableview = find_descendant_of_type_named("cursors_tableview"); m_cursors_tableview->set_highlight_selected_rows(true); m_cursors_tableview->set_alternating_row_colors(false); diff --git a/Userland/Applications/NetworkSettings/NetworkSettingsWidget.cpp b/Userland/Applications/NetworkSettings/NetworkSettingsWidget.cpp index d9809de9ae..feddf375c8 100644 --- a/Userland/Applications/NetworkSettings/NetworkSettingsWidget.cpp +++ b/Userland/Applications/NetworkSettings/NetworkSettingsWidget.cpp @@ -30,7 +30,7 @@ static int netmask_to_cidr(IPv4Address const& address) NetworkSettingsWidget::NetworkSettingsWidget() { - load_from_gml(network_settings_gml); + try_load_from_gml(network_settings_gml).release_value_but_fixme_should_propagate_errors(); m_adapters_combobox = *find_descendant_of_type_named("adapters_combobox"); m_enabled_checkbox = *find_descendant_of_type_named("enabled_checkbox"); diff --git a/Userland/Applications/PartitionEditor/main.cpp b/Userland/Applications/PartitionEditor/main.cpp index e9d5278a7d..d1bd3902ea 100644 --- a/Userland/Applications/PartitionEditor/main.cpp +++ b/Userland/Applications/PartitionEditor/main.cpp @@ -53,7 +53,7 @@ ErrorOr serenity_main(Main::Arguments arguments) } auto widget = TRY(window->set_main_widget()); - widget->load_from_gml(partition_editor_window_gml); + TRY(widget->try_load_from_gml(partition_editor_window_gml)); auto device_paths = get_device_paths(); diff --git a/Userland/Applications/PixelPaint/EditGuideDialog.cpp b/Userland/Applications/PixelPaint/EditGuideDialog.cpp index e5b82a2a3b..f9fee2d1d7 100644 --- a/Userland/Applications/PixelPaint/EditGuideDialog.cpp +++ b/Userland/Applications/PixelPaint/EditGuideDialog.cpp @@ -24,8 +24,7 @@ EditGuideDialog::EditGuideDialog(GUI::Window* parent_window, DeprecatedString co set_resizable(false); auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); - if (!main_widget->load_from_gml(edit_guide_dialog_gml)) - VERIFY_NOT_REACHED(); + main_widget->try_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"); auto vertical_radio = main_widget->find_descendant_of_type_named("orientation_vertical_radio"); diff --git a/Userland/Applications/PixelPaint/FilterGallery.cpp b/Userland/Applications/PixelPaint/FilterGallery.cpp index 59aa45154f..8d66c3262b 100644 --- a/Userland/Applications/PixelPaint/FilterGallery.cpp +++ b/Userland/Applications/PixelPaint/FilterGallery.cpp @@ -22,8 +22,7 @@ FilterGallery::FilterGallery(GUI::Window* parent_window, ImageEditor* editor) set_resizable(true); auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); - if (!main_widget->load_from_gml(filter_gallery_gml)) - VERIFY_NOT_REACHED(); + main_widget->try_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"); auto apply_button = main_widget->find_descendant_of_type_named("apply_button"); diff --git a/Userland/Applications/PixelPaint/Filters/Median.cpp b/Userland/Applications/PixelPaint/Filters/Median.cpp index f051e00469..ecd9bd58f4 100644 --- a/Userland/Applications/PixelPaint/Filters/Median.cpp +++ b/Userland/Applications/PixelPaint/Filters/Median.cpp @@ -46,7 +46,7 @@ RefPtr Median::get_settings_widget() { if (!m_settings_widget) { m_settings_widget = GUI::Widget::construct(); - m_settings_widget->load_from_gml(median_settings_gml); + m_settings_widget->try_load_from_gml(median_settings_gml).release_value_but_fixme_should_propagate_errors(); m_settings_widget->find_descendant_of_type_named("filter_radius")->on_change = [this](auto value) { m_filter_radius = value; update_preview(); diff --git a/Userland/Applications/PixelPaint/LevelsDialog.cpp b/Userland/Applications/PixelPaint/LevelsDialog.cpp index 833cca39b1..e8af129aea 100644 --- a/Userland/Applications/PixelPaint/LevelsDialog.cpp +++ b/Userland/Applications/PixelPaint/LevelsDialog.cpp @@ -19,8 +19,7 @@ LevelsDialog::LevelsDialog(GUI::Window* parent_window, ImageEditor* editor) set_icon(parent_window->icon()); auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); - if (!main_widget->load_from_gml(levels_dialog_gml)) - VERIFY_NOT_REACHED(); + main_widget->try_load_from_gml(levels_dialog_gml).release_value_but_fixme_should_propagate_errors(); resize(305, 202); set_resizable(false); diff --git a/Userland/Applications/PixelPaint/MainWidget.cpp b/Userland/Applications/PixelPaint/MainWidget.cpp index 5aa7f3bde7..f159ff1cc9 100644 --- a/Userland/Applications/PixelPaint/MainWidget.cpp +++ b/Userland/Applications/PixelPaint/MainWidget.cpp @@ -37,7 +37,7 @@ IconBag g_icon_bag; MainWidget::MainWidget() : Widget() { - load_from_gml(pixel_paint_window_gml); + try_load_from_gml(pixel_paint_window_gml).release_value_but_fixme_should_propagate_errors(); m_toolbox = find_descendant_of_type_named("toolbox"); m_statusbar = *find_descendant_of_type_named("statusbar"); diff --git a/Userland/Applications/PixelPaint/ResizeImageDialog.cpp b/Userland/Applications/PixelPaint/ResizeImageDialog.cpp index 0dddc0789f..bc6f4321c1 100644 --- a/Userland/Applications/PixelPaint/ResizeImageDialog.cpp +++ b/Userland/Applications/PixelPaint/ResizeImageDialog.cpp @@ -28,8 +28,7 @@ ResizeImageDialog::ResizeImageDialog(Gfx::IntSize suggested_size, GUI::Window* p set_icon(parent_window->icon()); auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); - if (!main_widget->load_from_gml(resize_image_dialog_gml)) - VERIFY_NOT_REACHED(); + main_widget->try_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"); auto height_spinbox = main_widget->find_descendant_of_type_named("height_spinbox"); diff --git a/Userland/Applications/Run/RunWindow.cpp b/Userland/Applications/Run/RunWindow.cpp index b29f736630..01ee83f0a8 100644 --- a/Userland/Applications/Run/RunWindow.cpp +++ b/Userland/Applications/Run/RunWindow.cpp @@ -42,7 +42,7 @@ RunWindow::RunWindow() set_minimizable(false); auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); - main_widget->load_from_gml(run_gml); + main_widget->try_load_from_gml(run_gml).release_value_but_fixme_should_propagate_errors(); m_icon_image_widget = *main_widget->find_descendant_of_type_named("icon"); m_icon_image_widget->set_bitmap(app_icon.bitmap_for_size(32)); diff --git a/Userland/Applications/SpaceAnalyzer/main.cpp b/Userland/Applications/SpaceAnalyzer/main.cpp index 05a83da401..bb582aca75 100644 --- a/Userland/Applications/SpaceAnalyzer/main.cpp +++ b/Userland/Applications/SpaceAnalyzer/main.cpp @@ -322,7 +322,7 @@ ErrorOr serenity_main(Main::Arguments arguments) // Load widgets. auto mainwidget = TRY(window->set_main_widget()); - mainwidget->load_from_gml(space_analyzer_gml); + TRY(mainwidget->try_load_from_gml(space_analyzer_gml)); auto& breadcrumbbar = *mainwidget->find_descendant_of_type_named("breadcrumbbar"); auto& treemapwidget = *mainwidget->find_descendant_of_type_named("tree_map"); auto& statusbar = *mainwidget->find_descendant_of_type_named("statusbar"); diff --git a/Userland/Applications/Spreadsheet/CellTypeDialog.cpp b/Userland/Applications/Spreadsheet/CellTypeDialog.cpp index e9b6a8b3d4..6e14d3bec9 100644 --- a/Userland/Applications/Spreadsheet/CellTypeDialog.cpp +++ b/Userland/Applications/Spreadsheet/CellTypeDialog.cpp @@ -318,7 +318,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector const& po } auto& conditional_fmt_tab = tabs.add_tab("Conditional format"); - conditional_fmt_tab.load_from_gml(cond_fmt_gml); + conditional_fmt_tab.try_load_from_gml(cond_fmt_gml).release_value_but_fixme_should_propagate_errors(); { auto& view = *conditional_fmt_tab.find_descendant_of_type_named("conditions_view"); view.set_formats(&m_conditional_formats); @@ -391,7 +391,7 @@ CellTypeMetadata CellTypeDialog::metadata() const ConditionView::ConditionView(ConditionalFormat& fmt) : m_format(fmt) { - load_from_gml(cond_fmt_view_gml); + try_load_from_gml(cond_fmt_view_gml).release_value_but_fixme_should_propagate_errors(); auto& fg_input = *find_descendant_of_type_named("foreground_input"); auto& bg_input = *find_descendant_of_type_named("background_input"); diff --git a/Userland/Applications/Spreadsheet/ExportDialog.cpp b/Userland/Applications/Spreadsheet/ExportDialog.cpp index b56a295b4c..5fe5cbd3d2 100644 --- a/Userland/Applications/Spreadsheet/ExportDialog.cpp +++ b/Userland/Applications/Spreadsheet/ExportDialog.cpp @@ -38,7 +38,7 @@ CSVExportDialogPage::CSVExportDialogPage(Sheet const& sheet) "CSV Export Options", "Please select the options for the csv file you wish to export to"); - m_page->body_widget().load_from_gml(csv_export_gml); + m_page->body_widget().try_load_from_gml(csv_export_gml).release_value_but_fixme_should_propagate_errors(); m_page->set_is_final_page(true); m_delimiter_comma_radio = m_page->body_widget().find_descendant_of_type_named("delimiter_comma_radio"); @@ -209,7 +209,7 @@ ErrorOr ExportDialog::make_and_run_for(StringView mime, NonnullOwnPtron_next_page = [] { return nullptr; }; - page->body_widget().load_from_gml(select_format_page_gml); + TRY(page->body_widget().try_load_from_gml(select_format_page_gml)); auto format_combo_box = page->body_widget().find_descendant_of_type_named("select_format_page_format_combo_box"); Vector supported_formats { diff --git a/Userland/Applications/Spreadsheet/ImportDialog.cpp b/Userland/Applications/Spreadsheet/ImportDialog.cpp index 788c38ec0d..1163e703d1 100644 --- a/Userland/Applications/Spreadsheet/ImportDialog.cpp +++ b/Userland/Applications/Spreadsheet/ImportDialog.cpp @@ -32,7 +32,7 @@ CSVImportDialogPage::CSVImportDialogPage(StringView csv) "CSV Import Options", "Please select the options for the csv file you wish to import"); - m_page->body_widget().load_from_gml(csv_import_gml); + m_page->body_widget().try_load_from_gml(csv_import_gml).release_value_but_fixme_should_propagate_errors(); m_page->set_is_final_page(true); m_delimiter_comma_radio = m_page->body_widget().find_descendant_of_type_named("delimiter_comma_radio"); @@ -254,7 +254,7 @@ Result, DeprecatedString> ImportDialog::make_and_run_ page->on_next_page = [] { return nullptr; }; - page->body_widget().load_from_gml(select_format_page_gml); + page->body_widget().try_load_from_gml(select_format_page_gml).release_value_but_fixme_should_propagate_errors(); auto format_combo_box = page->body_widget().find_descendant_of_type_named("select_format_page_format_combo_box"); Vector supported_formats { diff --git a/Userland/Applications/SystemMonitor/main.cpp b/Userland/Applications/SystemMonitor/main.cpp index 2c31b2df6e..e2d9baf8c5 100644 --- a/Userland/Applications/SystemMonitor/main.cpp +++ b/Userland/Applications/SystemMonitor/main.cpp @@ -279,7 +279,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->resize(560, 430); auto main_widget = TRY(window->set_main_widget()); - main_widget->load_from_gml(system_monitor_gml); + TRY(main_widget->try_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"); @@ -513,7 +513,7 @@ ErrorOr> build_process_window(pid_t pid) window->set_icon(app_icon.bitmap_for_size(16)); auto main_widget = TRY(window->set_main_widget()); - main_widget->load_from_gml(process_window_gml); + TRY(main_widget->try_load_from_gml(process_window_gml)); GUI::ModelIndex process_index; for (int row = 0; row < ProcessModel::the().row_count({}); ++row) { diff --git a/Userland/Applications/TerminalSettings/TerminalSettingsWidget.cpp b/Userland/Applications/TerminalSettings/TerminalSettingsWidget.cpp index be38f8b819..244f183e5b 100644 --- a/Userland/Applications/TerminalSettings/TerminalSettingsWidget.cpp +++ b/Userland/Applications/TerminalSettings/TerminalSettingsWidget.cpp @@ -32,7 +32,7 @@ TerminalSettingsMainWidget::TerminalSettingsMainWidget() { - load_from_gml(terminal_settings_main_gml); + try_load_from_gml(terminal_settings_main_gml).release_value_but_fixme_should_propagate_errors(); auto& beep_bell_radio = *find_descendant_of_type_named("beep_bell_radio"); auto& visual_bell_radio = *find_descendant_of_type_named("visual_bell_radio"); @@ -102,7 +102,7 @@ TerminalSettingsMainWidget::TerminalSettingsMainWidget() TerminalSettingsViewWidget::TerminalSettingsViewWidget() { - load_from_gml(terminal_settings_view_gml); + try_load_from_gml(terminal_settings_view_gml).release_value_but_fixme_should_propagate_errors(); auto& slider = *find_descendant_of_type_named("background_opacity_slider"); m_opacity = Config::read_i32("Terminal"sv, "Window"sv, "Opacity"sv); diff --git a/Userland/Applications/TextEditor/MainWidget.cpp b/Userland/Applications/TextEditor/MainWidget.cpp index f690f3c149..8863c69fda 100644 --- a/Userland/Applications/TextEditor/MainWidget.cpp +++ b/Userland/Applications/TextEditor/MainWidget.cpp @@ -49,7 +49,7 @@ namespace TextEditor { MainWidget::MainWidget() { - load_from_gml(text_editor_window_gml); + try_load_from_gml(text_editor_window_gml).release_value_but_fixme_should_propagate_errors(); m_toolbar = *find_descendant_of_type_named("toolbar"); m_toolbar_container = *find_descendant_of_type_named("toolbar_container"); diff --git a/Userland/Applications/Welcome/WelcomeWidget.cpp b/Userland/Applications/Welcome/WelcomeWidget.cpp index 85cd69aba8..5e76e772e4 100644 --- a/Userland/Applications/Welcome/WelcomeWidget.cpp +++ b/Userland/Applications/Welcome/WelcomeWidget.cpp @@ -22,7 +22,7 @@ WelcomeWidget::WelcomeWidget() { - load_from_gml(welcome_window_gml); + try_load_from_gml(welcome_window_gml).release_value_but_fixme_should_propagate_errors(); m_web_view = find_descendant_of_type_named("web_view"); m_web_view->load(URL::create_with_file_scheme(DeprecatedString::formatted("{}/README.md", Core::StandardPaths::home_directory()))); diff --git a/Userland/Demos/ModelGallery/GalleryWidget.cpp b/Userland/Demos/ModelGallery/GalleryWidget.cpp index 1c4bace5d6..5808d82cd8 100644 --- a/Userland/Demos/ModelGallery/GalleryWidget.cpp +++ b/Userland/Demos/ModelGallery/GalleryWidget.cpp @@ -26,7 +26,7 @@ GalleryWidget::GalleryWidget() ErrorOr GalleryWidget::load_basic_model_tab() { auto tab = TRY(m_tab_widget->try_add_tab("Basic Model")); - tab->load_from_gml(basic_model_tab_gml); + TRY(tab->try_load_from_gml(basic_model_tab_gml)); m_basic_model = BasicModel::create(); m_basic_model_table = *tab->find_descendant_of_type_named("model_table"); diff --git a/Userland/Demos/WidgetGallery/DemoWizardDialog.cpp b/Userland/Demos/WidgetGallery/DemoWizardDialog.cpp index 1b118e8acd..2edea7f382 100644 --- a/Userland/Demos/WidgetGallery/DemoWizardDialog.cpp +++ b/Userland/Demos/WidgetGallery/DemoWizardDialog.cpp @@ -28,7 +28,7 @@ DemoWizardDialog::DemoWizardDialog(GUI::Window* parent_window) "Installation location", "Choose where Demo Application is installed on your computer.") .release_value_but_fixme_should_propagate_errors(); - m_page_1->body_widget().load_from_gml(demo_wizard_page_1_gml); + m_page_1->body_widget().try_load_from_gml(demo_wizard_page_1_gml).release_value_but_fixme_should_propagate_errors(); m_page_1_location_text_box = m_page_1->body_widget().find_descendant_of_type_named("page_1_location_text_box"); m_page_1->on_next_page = [&]() { return m_page_2; @@ -39,7 +39,7 @@ DemoWizardDialog::DemoWizardDialog(GUI::Window* parent_window) "Installation in progress...", "Please wait. Do not turn off your computer.") .release_value_but_fixme_should_propagate_errors(); - m_page_2->body_widget().load_from_gml(demo_wizard_page_2_gml); + m_page_2->body_widget().try_load_from_gml(demo_wizard_page_2_gml).release_value_but_fixme_should_propagate_errors(); m_page_2_progressbar = m_page_2->body_widget().find_descendant_of_type_named("page_2_progressbar"); m_page_2_timer = Core::Timer::try_create(this).release_value_but_fixme_should_propagate_errors(); m_page_2->on_page_enter = [&]() { diff --git a/Userland/Demos/WidgetGallery/GalleryWidget.cpp b/Userland/Demos/WidgetGallery/GalleryWidget.cpp index 45041e9340..02ce30f86b 100644 --- a/Userland/Demos/WidgetGallery/GalleryWidget.cpp +++ b/Userland/Demos/WidgetGallery/GalleryWidget.cpp @@ -32,12 +32,12 @@ GalleryWidget::GalleryWidget() { - load_from_gml(window_gml); + try_load_from_gml(window_gml).release_value_but_fixme_should_propagate_errors(); auto& tab_widget = *find_descendant_of_type_named("tab_widget"); auto basics_tab = tab_widget.try_add_tab("Basics").release_value_but_fixme_should_propagate_errors(); - basics_tab->load_from_gml(basics_tab_gml); + basics_tab->try_load_from_gml(basics_tab_gml).release_value_but_fixme_should_propagate_errors(); m_enabled_label = basics_tab->find_descendant_of_type_named("enabled_label"); m_label_frame = basics_tab->find_descendant_of_type_named("label_frame"); @@ -170,7 +170,7 @@ GalleryWidget::GalleryWidget() }; auto sliders_tab = tab_widget.try_add_tab("Sliders").release_value_but_fixme_should_propagate_errors(); - sliders_tab->load_from_gml(sliders_tab_gml); + sliders_tab->try_load_from_gml(sliders_tab_gml).release_value_but_fixme_should_propagate_errors(); m_vertical_progressbar_left = sliders_tab->find_descendant_of_type_named("vertical_progressbar_left"); m_vertical_progressbar_left->set_value(0); @@ -231,7 +231,7 @@ GalleryWidget::GalleryWidget() }; auto wizards_tab = tab_widget.try_add_tab("Wizards").release_value_but_fixme_should_propagate_errors(); - wizards_tab->load_from_gml(wizards_tab_gml); + wizards_tab->try_load_from_gml(wizards_tab_gml).release_value_but_fixme_should_propagate_errors(); m_wizard_button = wizards_tab->find_descendant_of_type_named("wizard_button"); m_wizard_output = wizards_tab->find_descendant_of_type_named("wizard_output"); @@ -287,7 +287,7 @@ GalleryWidget::GalleryWidget() }; auto cursors_tab = tab_widget.try_add_tab("Cursors").release_value_but_fixme_should_propagate_errors(); - cursors_tab->load_from_gml(cursors_tab_gml); + cursors_tab->try_load_from_gml(cursors_tab_gml).release_value_but_fixme_should_propagate_errors(); m_cursors_tableview = cursors_tab->find_descendant_of_type_named("cursors_tableview"); m_cursors_tableview->set_highlight_selected_rows(true); @@ -310,7 +310,7 @@ GalleryWidget::GalleryWidget() }; auto icons_tab = tab_widget.try_add_tab("Icons").release_value_but_fixme_should_propagate_errors(); - icons_tab->load_from_gml(icons_tab_gml); + icons_tab->try_load_from_gml(icons_tab_gml).release_value_but_fixme_should_propagate_errors(); m_icons_tableview = icons_tab->find_descendant_of_type_named("icons_tableview"); m_icons_tableview->set_highlight_selected_rows(true); diff --git a/Userland/DevTools/GMLPlayground/main.cpp b/Userland/DevTools/GMLPlayground/main.cpp index a5891c0dee..9efa37b4f0 100644 --- a/Userland/DevTools/GMLPlayground/main.cpp +++ b/Userland/DevTools/GMLPlayground/main.cpp @@ -119,7 +119,8 @@ ErrorOr serenity_main(Main::Arguments arguments) editor->on_change = [&] { preview->remove_all_children(); - preview->load_from_gml(editor->text(), [](DeprecatedString const& class_name) -> ErrorOr> { + // FIXME: Parsing errors happen while the user is typing. What should we do about them? + (void)preview->try_load_from_gml(editor->text(), [](DeprecatedString const& class_name) -> ErrorOr> { return UnregisteredWidget::try_create(class_name); }); }; diff --git a/Userland/DevTools/HackStudio/Dialogs/Git/GitCommitDialog.cpp b/Userland/DevTools/HackStudio/Dialogs/Git/GitCommitDialog.cpp index f997b53cd2..18e1cdc645 100644 --- a/Userland/DevTools/HackStudio/Dialogs/Git/GitCommitDialog.cpp +++ b/Userland/DevTools/HackStudio/Dialogs/Git/GitCommitDialog.cpp @@ -18,7 +18,7 @@ GitCommitDialog::GitCommitDialog(GUI::Window* parent) set_icon(parent->icon()); auto widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); - widget->load_from_gml(git_commit_dialog_gml); + widget->try_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"); m_cancel_button = widget->find_descendant_of_type_named("cancel_button"); diff --git a/Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp b/Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp index f80e80d71b..14228a6ec5 100644 --- a/Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp +++ b/Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp @@ -50,7 +50,7 @@ NewProjectDialog::NewProjectDialog(GUI::Window* parent) set_title("New project"); auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); - main_widget->load_from_gml(new_project_dialog_gml); + main_widget->try_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"); m_icon_view = m_icon_view_container->add(); diff --git a/Userland/DevTools/HackStudio/GMLPreviewWidget.cpp b/Userland/DevTools/HackStudio/GMLPreviewWidget.cpp index 30f8aa8921..5144690ab4 100644 --- a/Userland/DevTools/HackStudio/GMLPreviewWidget.cpp +++ b/Userland/DevTools/HackStudio/GMLPreviewWidget.cpp @@ -27,7 +27,8 @@ void GMLPreviewWidget::load_gml(DeprecatedString const& gml) return; } - load_from_gml(gml, [](DeprecatedString const& name) -> ErrorOr> { + // FIXME: Parsing errors happen while the user is typing. What should we do about them? + (void)try_load_from_gml(gml, [](DeprecatedString const& name) -> ErrorOr> { return GUI::Label::try_create(DeprecatedString::formatted("{} is not registered as a GML element!", name)); }); diff --git a/Userland/DevTools/SQLStudio/MainWidget.cpp b/Userland/DevTools/SQLStudio/MainWidget.cpp index 3eb924e0a1..678373f7b6 100644 --- a/Userland/DevTools/SQLStudio/MainWidget.cpp +++ b/Userland/DevTools/SQLStudio/MainWidget.cpp @@ -61,8 +61,7 @@ static Vector lookup_database_names() MainWidget::MainWidget() { - if (!load_from_gml(sql_studio_gml)) - VERIFY_NOT_REACHED(); + try_load_from_gml(sql_studio_gml).release_value_but_fixme_should_propagate_errors(); m_new_action = GUI::Action::create("&New", { Mod_Ctrl, Key_N }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/new.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) { open_new_script(); diff --git a/Userland/Games/2048/GameSizeDialog.cpp b/Userland/Games/2048/GameSizeDialog.cpp index a2ef18d80b..98d7304615 100644 --- a/Userland/Games/2048/GameSizeDialog.cpp +++ b/Userland/Games/2048/GameSizeDialog.cpp @@ -26,8 +26,7 @@ GameSizeDialog::GameSizeDialog(GUI::Window* parent, size_t board_size, size_t ta set_resizable(false); auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); - if (!main_widget->load_from_gml(game_size_dialog_gml)) - VERIFY_NOT_REACHED(); + main_widget->try_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"); board_size_spinbox->set_value(m_board_size); diff --git a/Userland/Games/2048/main.cpp b/Userland/Games/2048/main.cpp index 935190bb8c..fb65e60e16 100644 --- a/Userland/Games/2048/main.cpp +++ b/Userland/Games/2048/main.cpp @@ -67,8 +67,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->resize(315, 336); auto main_widget = TRY(window->set_main_widget()); - if (!main_widget->load_from_gml(game_window_gml)) - VERIFY_NOT_REACHED(); + TRY(main_widget->try_load_from_gml(game_window_gml)); Game game { board_size, target_tile, evil_ai }; diff --git a/Userland/Games/Flood/SettingsDialog.cpp b/Userland/Games/Flood/SettingsDialog.cpp index 873cab5ede..1cfd010fb5 100644 --- a/Userland/Games/Flood/SettingsDialog.cpp +++ b/Userland/Games/Flood/SettingsDialog.cpp @@ -28,8 +28,7 @@ SettingsDialog::SettingsDialog(GUI::Window* parent, size_t board_rows, size_t bo set_resizable(false); auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); - if (!main_widget->load_from_gml(settings_dialog_gml)) - VERIFY_NOT_REACHED(); + main_widget->try_load_from_gml(settings_dialog_gml).release_value_but_fixme_should_propagate_errors(); auto board_rows_spinbox = main_widget->find_descendant_of_type_named("board_rows_spinbox"); board_rows_spinbox->set_value(m_board_rows); diff --git a/Userland/Games/Flood/main.cpp b/Userland/Games/Flood/main.cpp index de902a1414..fc5ab37a44 100644 --- a/Userland/Games/Flood/main.cpp +++ b/Userland/Games/Flood/main.cpp @@ -83,8 +83,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->resize(304, 325); auto main_widget = TRY(window->set_main_widget()); - if (!main_widget->load_from_gml(flood_window_gml)) - VERIFY_NOT_REACHED(); + TRY(main_widget->try_load_from_gml(flood_window_gml)); auto board_widget = TRY(main_widget->find_descendant_of_type_named("board_widget_container")->try_add(board_rows, board_columns)); board_widget->board()->randomize(); diff --git a/Userland/Games/GameOfLife/main.cpp b/Userland/Games/GameOfLife/main.cpp index 2ab0f5c143..3e385e5791 100644 --- a/Userland/Games/GameOfLife/main.cpp +++ b/Userland/Games/GameOfLife/main.cpp @@ -53,7 +53,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_title("Game Of Life"); auto main_widget = TRY(window->set_main_widget()); - main_widget->load_from_gml(game_of_life_gml); + TRY(main_widget->try_load_from_gml(game_of_life_gml)); main_widget->set_fill_with_background_color(true); auto& main_toolbar = *main_widget->find_descendant_of_type_named("toolbar"); diff --git a/Userland/Games/Hearts/main.cpp b/Userland/Games/Hearts/main.cpp index 30617193fe..2707e03de9 100644 --- a/Userland/Games/Hearts/main.cpp +++ b/Userland/Games/Hearts/main.cpp @@ -51,7 +51,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_title("Hearts"); auto widget = TRY(window->set_main_widget()); - widget->load_from_gml(hearts_gml); + TRY(widget->try_load_from_gml(hearts_gml)); auto& game = *widget->find_descendant_of_type_named("game"); game.set_focus(true); diff --git a/Userland/Games/MasterWord/main.cpp b/Userland/Games/MasterWord/main.cpp index 4801e06ec6..f5ce72ff33 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); auto main_widget = TRY(window->set_main_widget()); - main_widget->load_from_gml(master_word_gml); + TRY(main_widget->try_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 081b7eb3ce..f8c99fff0d 100644 --- a/Userland/Games/Minesweeper/CustomGameDialog.cpp +++ b/Userland/Games/Minesweeper/CustomGameDialog.cpp @@ -46,8 +46,7 @@ CustomGameDialog::CustomGameDialog(Window* parent_window) set_title("Custom game"); auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); - if (!main_widget->load_from_gml(minesweeper_custom_game_window_gml)) - VERIFY_NOT_REACHED(); + main_widget->try_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"); m_rows_spinbox = *main_widget->find_descendant_of_type_named("rows_spinbox"); diff --git a/Userland/Games/Minesweeper/main.cpp b/Userland/Games/Minesweeper/main.cpp index 49e1062f77..360833a187 100644 --- a/Userland/Games/Minesweeper/main.cpp +++ b/Userland/Games/Minesweeper/main.cpp @@ -50,7 +50,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->resize(139, 177); auto widget = TRY(window->set_main_widget()); - widget->load_from_gml(minesweeper_window_gml); + TRY(widget->try_load_from_gml(minesweeper_window_gml)); auto& separator = *widget->find_descendant_of_type_named("separator"); auto& container = *widget->find_descendant_of_type_named("container"); diff --git a/Userland/Libraries/LibGUI/EmojiInputDialog.cpp b/Userland/Libraries/LibGUI/EmojiInputDialog.cpp index f4d99562d5..5c0752b3bb 100644 --- a/Userland/Libraries/LibGUI/EmojiInputDialog.cpp +++ b/Userland/Libraries/LibGUI/EmojiInputDialog.cpp @@ -93,8 +93,7 @@ EmojiInputDialog::EmojiInputDialog(Window* parent_window) , m_category_action_group(make()) { auto main_widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); - if (!main_widget->load_from_gml(emoji_input_dialog_gml)) - VERIFY_NOT_REACHED(); + main_widget->try_load_from_gml(emoji_input_dialog_gml).release_value_but_fixme_should_propagate_errors(); set_window_type(GUI::WindowType::Popup); set_window_mode(GUI::WindowMode::Modeless); diff --git a/Userland/Libraries/LibGUI/FilePicker.cpp b/Userland/Libraries/LibGUI/FilePicker.cpp index 93cbc3d2d8..8709adf6f6 100644 --- a/Userland/Libraries/LibGUI/FilePicker.cpp +++ b/Userland/Libraries/LibGUI/FilePicker.cpp @@ -85,8 +85,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St resize(560, 320); auto widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); - if (!widget->load_from_gml(file_picker_dialog_gml)) - VERIFY_NOT_REACHED(); + widget->try_load_from_gml(file_picker_dialog_gml).release_value_but_fixme_should_propagate_errors(); auto& toolbar = *widget->find_descendant_of_type_named("toolbar"); diff --git a/Userland/Libraries/LibGUI/FontPicker.cpp b/Userland/Libraries/LibGUI/FontPicker.cpp index 0ba0b36600..43b01487ff 100644 --- a/Userland/Libraries/LibGUI/FontPicker.cpp +++ b/Userland/Libraries/LibGUI/FontPicker.cpp @@ -27,8 +27,7 @@ FontPicker::FontPicker(Window* parent_window, Gfx::Font const* current_font, boo set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-font-editor.png"sv).release_value_but_fixme_should_propagate_errors()); auto widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); - if (!widget->load_from_gml(font_picker_dialog_gml)) - VERIFY_NOT_REACHED(); + widget->try_load_from_gml(font_picker_dialog_gml).release_value_but_fixme_should_propagate_errors(); m_family_list_view = *widget->find_descendant_of_type_named("family_list_view"); m_family_list_view->set_model(ItemListModel::create(m_families)); diff --git a/Userland/Libraries/LibGUI/IncrementalSearchBanner.cpp b/Userland/Libraries/LibGUI/IncrementalSearchBanner.cpp index fe244a36d2..f29643aba7 100644 --- a/Userland/Libraries/LibGUI/IncrementalSearchBanner.cpp +++ b/Userland/Libraries/LibGUI/IncrementalSearchBanner.cpp @@ -19,7 +19,7 @@ namespace GUI { IncrementalSearchBanner::IncrementalSearchBanner(TextEditor& editor) : m_editor(editor) { - load_from_gml(incremental_search_banner_gml); + try_load_from_gml(incremental_search_banner_gml).release_value_but_fixme_should_propagate_errors(); m_index_label = find_descendant_of_type_named