diff --git a/Userland/Applications/CrashReporter/CMakeLists.txt b/Userland/Applications/CrashReporter/CMakeLists.txt index e23b758b20d..5430fc3a216 100644 --- a/Userland/Applications/CrashReporter/CMakeLists.txt +++ b/Userland/Applications/CrashReporter/CMakeLists.txt @@ -4,16 +4,13 @@ serenity_component( TARGETS CrashReporter ) -stringify_gml(CrashReporterWindow.gml CrashReporterWindowGML.h crash_reporter_window_gml) +compile_gml(CrashReporterWindow.gml CrashReporterWindowGML.cpp) set(SOURCES + CrashReporterWindowGML.cpp main.cpp ) -set(GENERATED_SOURCES - CrashReporterWindowGML.h -) - serenity_app(CrashReporter ICON app-crash-reporter) target_link_libraries(CrashReporter PRIVATE LibCore LibCoredump LibDebug LibDesktop LibFileSystem LibFileSystemAccessClient LibGfx LibGUI LibMain LibThreading) diff --git a/Userland/Applications/CrashReporter/CrashReporterWindow.gml b/Userland/Applications/CrashReporter/CrashReporterWindow.gml index 5bb05c39e11..70619e7e034 100644 --- a/Userland/Applications/CrashReporter/CrashReporterWindow.gml +++ b/Userland/Applications/CrashReporter/CrashReporterWindow.gml @@ -1,4 +1,4 @@ -@GUI::Widget { +@CrashReporter::MainWidget { fill_with_background_color: true layout: @GUI::VerticalBoxLayout { margins: [4] diff --git a/Userland/Applications/CrashReporter/MainWidget.h b/Userland/Applications/CrashReporter/MainWidget.h new file mode 100644 index 00000000000..3ee46e1b57d --- /dev/null +++ b/Userland/Applications/CrashReporter/MainWidget.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2023, the SerenityOS developers. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include + +namespace CrashReporter { + +class MainWidget final : public GUI::Widget { + C_OBJECT(MainWidget) + +public: + static ErrorOr> try_create(); + virtual ~MainWidget() override = default; + +private: + MainWidget() = default; +}; + +} diff --git a/Userland/Applications/CrashReporter/main.cpp b/Userland/Applications/CrashReporter/main.cpp index 78a3746e93a..d513d80afe5 100644 --- a/Userland/Applications/CrashReporter/main.cpp +++ b/Userland/Applications/CrashReporter/main.cpp @@ -6,11 +6,11 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include "MainWidget.h" #include #include #include #include -#include #include #include #include @@ -208,8 +208,8 @@ ErrorOr serenity_main(Main::Arguments arguments) unlink_coredump(coredump_path); }; - auto widget = window->set_main_widget(); - TRY(widget->load_from_gml(crash_reporter_window_gml)); + auto widget = TRY(CrashReporter::MainWidget::try_create()); + window->set_main_widget(widget); 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));