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

Userland: Replace all uses of load_from_gml with try_load_from_gml

MOAR FIXMES! ;^)
This commit is contained in:
Sam Atkins 2023-01-07 12:33:53 +00:00 committed by Linus Groh
parent 703da34947
commit 54b1326165
78 changed files with 94 additions and 111 deletions

View file

@ -48,8 +48,7 @@ private:
: Dialog(parent_window)
{
auto widget = set_main_widget<GUI::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);

View file

@ -74,7 +74,7 @@ BrowserWindow::BrowserWindow(CookieJar& cookie_jar, URL url)
set_title("Browser");
auto widget = set_main_widget<GUI::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<GUI::HorizontalSeparator>("top_line");

View file

@ -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<GUI::TableView>("history_tableview");
m_textbox = find_descendant_of_type_named<GUI::TextBox>("history_filter_textbox");

View file

@ -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<GUI::TabWidget>("tab_widget");
m_cookies_table_view = tab_widget.find_descendant_of_type_named<GUI::TableView>("cookies_tableview");

View file

@ -114,7 +114,7 @@ void Tab::update_status(Optional<DeprecatedString> 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<GUI::ToolbarContainer>("toolbar_container");
auto& toolbar = *find_descendant_of_type_named<GUI::Toolbar>("toolbar");

View file

@ -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<GUI::TextBox>("homepage_url_textbox");
m_homepage_url_textbox->set_text(Config::read_string("Browser"sv, "Preferences"sv, "Home"sv, default_homepage_url), GUI::AllowCallback::No);

View file

@ -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<GUI::CheckBox>("enable_content_filtering_checkbox");
m_domain_list_view = find_descendant_of_type_named<GUI::ListView>("domain_list_view");
m_add_new_domain_button = find_descendant_of_type_named<GUI::Button>("add_new_domain_button");

View file

@ -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<GUI::TextBox>("entry_textbox");
m_entry->set_relative_rect(5, 5, 244, 26);

View file

@ -43,7 +43,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->set_icon(app_icon.bitmap_for_size(16));
auto main_widget = TRY(window->set_main_widget<GUI::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<GUI::Toolbar>("toolbar");
auto calendar = main_widget->find_descendant_of_type_named<GUI::Calendar>("calendar");

View file

@ -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<GUI::ComboBox>("first_day_of_week");
m_first_day_of_week_combobox->set_text(Config::read_string("Calendar"sv, "View"sv, "FirstDayOfWeek"sv, "Sunday"sv));

View file

@ -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<GUI::Toolbar>("toolbar");
m_font_name_label = find_descendant_of_type_named<GUI::Label>("font_name");

View file

@ -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<GUI::TextBox>("search_input");
m_search_button = find_descendant_of_type_named<GUI::Button>("search_button");

View file

@ -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<GUI::RadioButton>("24hour_radio");
auto& twelve_hour_radio = *find_descendant_of_type_named<GUI::RadioButton>("12hour_radio");

View file

@ -61,7 +61,7 @@ ErrorOr<NonnullRefPtr<TimeZoneSettingsWidget>> 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();

View file

@ -182,7 +182,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
};
auto widget = TRY(window->set_main_widget<GUI::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<GUI::ImageWidget>("icon");
icon_image_widget.set_bitmap(GUI::FileIconProvider::icon_for_executable(executable_path).bitmap_for_size(32));

View file

@ -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<DisplaySettings::MonitorWidget>("monitor_widget");

View file

@ -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<GUI::SpinBox>("workspace_rows_spinbox");
m_workspace_rows_spinbox->on_change = [&](auto) {

View file

@ -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<ComboBox>("geometry_combobox");
m_geometry_combobox->set_only_allow_values_from_model(true);

View file

@ -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<GUI::Label>("default_font_label");

View file

@ -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<DisplaySettings::MonitorWidget>("monitor_widget");

View file

@ -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;

View file

@ -32,7 +32,7 @@ EscalatorWindow::EscalatorWindow(StringView executable, Vector<StringView> argum
set_minimizable(false);
auto main_widget = set_main_widget<GUI::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<GUI::Label> app_label = *main_widget->find_descendant_of_type_named<GUI::Label>("description");

View file

@ -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<GUI::Button>("button");

View file

@ -45,7 +45,7 @@ PropertiesWindow::PropertiesWindow(DeprecatedString const& path, bool disable_re
auto& tab_widget = main_widget->add<GUI::TabWidget>();
auto& general_tab = tab_widget.add_tab<GUI::Widget>("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();

View file

@ -580,8 +580,7 @@ ErrorOr<int> 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<GUI::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<GUI::ToolbarContainer>("toolbar_container");
auto& main_toolbar = *widget->find_descendant_of_type_named<GUI::Toolbar>("main_toolbar");

View file

@ -66,7 +66,7 @@ ErrorOr<RefPtr<GUI::Window>> MainWidget::create_preview_window()
window->center_within(*this->window());
auto main_widget = TRY(window->set_main_widget<GUI::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<GUI::Label>("preview_label");
m_preview_label->set_font(edited_font());
@ -420,7 +420,7 @@ ErrorOr<void> 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<GUI::GroupBox>("font_metadata_groupbox");
m_unicode_block_container = find_descendant_of_type_named<GUI::Widget>("unicode_block_container");

View file

@ -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<GUI::TextBox>("name_textbox");
m_family_textbox = m_font_properties_page->body_widget().find_descendant_of_type_named<GUI::TextBox>("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<GUI::SpinBox>("height_spinbox");

View file

@ -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));

View file

@ -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<GUI::Toolbar>("toolbar");
m_tab_widget = find_descendant_of_type_named<GUI::TabWidget>("tab_widget");
m_search_container = find_descendant_of_type_named<GUI::Widget>("search_container");

View file

@ -100,8 +100,7 @@ FindDialog::FindDialog()
set_title("Find");
auto main_widget = set_main_widget<GUI::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<GUI::TextBox>("text_editor");
m_find_button = *main_widget->find_descendant_of_type_named<GUI::Button>("find_button");

View file

@ -97,8 +97,7 @@ GoToOffsetDialog::GoToOffsetDialog()
set_title("Go to Offset");
auto main_widget = set_main_widget<GUI::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<GUI::TextBox>("text_editor");
m_go_button = *main_widget->find_descendant_of_type_named<GUI::Button>("go_button");

View file

@ -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<GUI::Toolbar>("toolbar");
m_toolbar_container = *find_descendant_of_type_named<GUI::ToolbarContainer>("toolbar_container");

View file

@ -52,8 +52,7 @@ private:
: Dialog(parent_window)
{
auto widget = set_main_widget<GUI::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))

View file

@ -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<GUI::TreeView>("mailbox_list");
m_individual_mailbox_view = *find_descendant_of_type_named<GUI::TableView>("individual_mailbox_view");

View file

@ -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<GUI::TextBox>("server_input");
m_server_inputbox->set_text(Config::read_string("Mail"sv, "Connection"sv, "Server"sv, ""sv));

View file

@ -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<GUI::Frame>("preview_frame")->add<MouseSettings::HighlightPreviewWidget>(palette());

View file

@ -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<GUI::Label>("speed_label");
m_speed_slider = *find_descendant_of_type_named<GUI::HorizontalSlider>("speed_slider");

View file

@ -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<GUI::TableView>("cursors_tableview");
m_cursors_tableview->set_highlight_selected_rows(true);
m_cursors_tableview->set_alternating_row_colors(false);

View file

@ -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<GUI::ComboBox>("adapters_combobox");
m_enabled_checkbox = *find_descendant_of_type_named<GUI::CheckBox>("enabled_checkbox");

View file

@ -53,7 +53,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
}
auto widget = TRY(window->set_main_widget<GUI::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();

View file

@ -24,8 +24,7 @@ EditGuideDialog::EditGuideDialog(GUI::Window* parent_window, DeprecatedString co
set_resizable(false);
auto main_widget = set_main_widget<GUI::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<GUI::RadioButton>("orientation_horizontal_radio");
auto vertical_radio = main_widget->find_descendant_of_type_named<GUI::RadioButton>("orientation_vertical_radio");

View file

@ -22,8 +22,7 @@ FilterGallery::FilterGallery(GUI::Window* parent_window, ImageEditor* editor)
set_resizable(true);
auto main_widget = set_main_widget<GUI::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<GUI::TreeView>("tree_view");
auto apply_button = main_widget->find_descendant_of_type_named<GUI::Button>("apply_button");

View file

@ -46,7 +46,7 @@ RefPtr<GUI::Widget> 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<GUI::SpinBox>("filter_radius")->on_change = [this](auto value) {
m_filter_radius = value;
update_preview();

View file

@ -19,8 +19,7 @@ LevelsDialog::LevelsDialog(GUI::Window* parent_window, ImageEditor* editor)
set_icon(parent_window->icon());
auto main_widget = set_main_widget<GUI::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);

View file

@ -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<PixelPaint::ToolboxWidget>("toolbox");
m_statusbar = *find_descendant_of_type_named<GUI::Statusbar>("statusbar");

View file

@ -28,8 +28,7 @@ ResizeImageDialog::ResizeImageDialog(Gfx::IntSize suggested_size, GUI::Window* p
set_icon(parent_window->icon());
auto main_widget = set_main_widget<GUI::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<GUI::SpinBox>("width_spinbox");
auto height_spinbox = main_widget->find_descendant_of_type_named<GUI::SpinBox>("height_spinbox");

View file

@ -42,7 +42,7 @@ RunWindow::RunWindow()
set_minimizable(false);
auto main_widget = set_main_widget<GUI::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<GUI::ImageWidget>("icon");
m_icon_image_widget->set_bitmap(app_icon.bitmap_for_size(32));

View file

@ -322,7 +322,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
// Load widgets.
auto mainwidget = TRY(window->set_main_widget<GUI::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<GUI::Breadcrumbbar>("breadcrumbbar");
auto& treemapwidget = *mainwidget->find_descendant_of_type_named<SpaceAnalyzer::TreeMapWidget>("tree_map");
auto& statusbar = *mainwidget->find_descendant_of_type_named<GUI::Statusbar>("statusbar");

View file

@ -318,7 +318,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector<Position> const& po
}
auto& conditional_fmt_tab = tabs.add_tab<GUI::Widget>("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<Spreadsheet::ConditionsView>("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<GUI::ColorInput>("foreground_input");
auto& bg_input = *find_descendant_of_type_named<GUI::ColorInput>("background_input");

View file

@ -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<GUI::RadioButton>("delimiter_comma_radio");
@ -209,7 +209,7 @@ ErrorOr<void> ExportDialog::make_and_run_for(StringView mime, NonnullOwnPtr<Core
page->on_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<GUI::ComboBox>("select_format_page_format_combo_box");
Vector<DeprecatedString> supported_formats {

View file

@ -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<GUI::RadioButton>("delimiter_comma_radio");
@ -254,7 +254,7 @@ Result<NonnullRefPtrVector<Sheet>, 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<GUI::ComboBox>("select_format_page_format_combo_box");
Vector<DeprecatedString> supported_formats {

View file

@ -279,7 +279,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->resize(560, 430);
auto main_widget = TRY(window->set_main_widget<GUI::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<GUI::TabWidget>("main_tabs");
statusbar = main_widget->find_descendant_of_type_named<GUI::Statusbar>("statusbar");
@ -513,7 +513,7 @@ ErrorOr<NonnullRefPtr<GUI::Window>> build_process_window(pid_t pid)
window->set_icon(app_icon.bitmap_for_size(16));
auto main_widget = TRY(window->set_main_widget<GUI::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) {

View file

@ -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<GUI::RadioButton>("beep_bell_radio");
auto& visual_bell_radio = *find_descendant_of_type_named<GUI::RadioButton>("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<GUI::HorizontalOpacitySlider>("background_opacity_slider");
m_opacity = Config::read_i32("Terminal"sv, "Window"sv, "Opacity"sv);

View file

@ -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<GUI::Toolbar>("toolbar");
m_toolbar_container = *find_descendant_of_type_named<GUI::ToolbarContainer>("toolbar_container");

View file

@ -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<WebView::OutOfProcessWebView>("web_view");
m_web_view->load(URL::create_with_file_scheme(DeprecatedString::formatted("{}/README.md", Core::StandardPaths::home_directory())));