mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:37:46 +00:00
LibGUI: Remove parent parameter to GUI::Widget constructor
This commit is contained in:
parent
4ce28c32d1
commit
c5d913970a
114 changed files with 207 additions and 313 deletions
|
@ -30,8 +30,7 @@
|
|||
#include <LibGUI/JsonArrayModel.h>
|
||||
#include <LibGUI/TableView.h>
|
||||
|
||||
NetworkStatisticsWidget::NetworkStatisticsWidget(GUI::Widget* parent)
|
||||
: GUI::LazyWidget(parent)
|
||||
NetworkStatisticsWidget::NetworkStatisticsWidget()
|
||||
{
|
||||
on_first_show = [this](auto&) {
|
||||
set_layout(make<GUI::VerticalBoxLayout>());
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
virtual ~NetworkStatisticsWidget() override;
|
||||
|
||||
private:
|
||||
explicit NetworkStatisticsWidget(GUI::Widget* parent = nullptr);
|
||||
NetworkStatisticsWidget();
|
||||
void update_models();
|
||||
|
||||
RefPtr<GUI::TableView> m_adapter_table_view;
|
||||
|
|
|
@ -29,12 +29,11 @@
|
|||
#include <LibGUI/JsonArrayModel.h>
|
||||
#include <LibGUI/TableView.h>
|
||||
|
||||
ProcessFileDescriptorMapWidget::ProcessFileDescriptorMapWidget(GUI::Widget* parent)
|
||||
: GUI::Widget(parent)
|
||||
ProcessFileDescriptorMapWidget::ProcessFileDescriptorMapWidget()
|
||||
{
|
||||
set_layout(make<GUI::VerticalBoxLayout>());
|
||||
layout()->set_margins({ 4, 4, 4, 4 });
|
||||
m_table_view = GUI::TableView::construct(this);
|
||||
m_table_view = add<GUI::TableView>();
|
||||
m_table_view->set_size_columns_to_fit_content(true);
|
||||
|
||||
Vector<GUI::JsonArrayModel::FieldSpec> pid_fds_fields;
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
void set_pid(pid_t);
|
||||
|
||||
private:
|
||||
explicit ProcessFileDescriptorMapWidget(GUI::Widget* parent);
|
||||
ProcessFileDescriptorMapWidget();
|
||||
|
||||
RefPtr<GUI::TableView> m_table_view;
|
||||
pid_t m_pid { -1 };
|
||||
|
|
|
@ -31,8 +31,7 @@
|
|||
#include <LibGUI/SortingProxyModel.h>
|
||||
#include <LibGUI/TableView.h>
|
||||
|
||||
ProcessMemoryMapWidget::ProcessMemoryMapWidget(GUI::Widget* parent)
|
||||
: GUI::Widget(parent)
|
||||
ProcessMemoryMapWidget::ProcessMemoryMapWidget()
|
||||
{
|
||||
set_layout(make<GUI::VerticalBoxLayout>());
|
||||
layout()->set_margins({ 4, 4, 4, 4 });
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
void refresh();
|
||||
|
||||
private:
|
||||
explicit ProcessMemoryMapWidget(GUI::Widget* parent);
|
||||
ProcessMemoryMapWidget();
|
||||
RefPtr<GUI::TableView> m_table_view;
|
||||
RefPtr<GUI::JsonArrayModel> m_json_model;
|
||||
pid_t m_pid { -1 };
|
||||
|
|
|
@ -30,8 +30,7 @@
|
|||
#include <LibCore/Timer.h>
|
||||
#include <LibGUI/BoxLayout.h>
|
||||
|
||||
ProcessStacksWidget::ProcessStacksWidget(GUI::Widget* parent)
|
||||
: GUI::Widget(parent)
|
||||
ProcessStacksWidget::ProcessStacksWidget()
|
||||
{
|
||||
set_layout(make<GUI::VerticalBoxLayout>());
|
||||
layout()->set_margins({ 4, 4, 4, 4 });
|
||||
|
|
|
@ -32,13 +32,14 @@
|
|||
class ProcessStacksWidget final : public GUI::Widget {
|
||||
C_OBJECT(ProcessStacksWidget)
|
||||
public:
|
||||
explicit ProcessStacksWidget(GUI::Widget* parent);
|
||||
virtual ~ProcessStacksWidget() override;
|
||||
|
||||
void set_pid(pid_t);
|
||||
void refresh();
|
||||
|
||||
private:
|
||||
ProcessStacksWidget();
|
||||
|
||||
pid_t m_pid { -1 };
|
||||
RefPtr<GUI::TextEditor> m_stacks_editor;
|
||||
RefPtr<Core::Timer> m_timer;
|
||||
|
|
|
@ -29,8 +29,7 @@
|
|||
#include <LibGUI/SortingProxyModel.h>
|
||||
#include <stdio.h>
|
||||
|
||||
ProcessTableView::ProcessTableView(GUI::Widget* parent)
|
||||
: TableView(parent)
|
||||
ProcessTableView::ProcessTableView()
|
||||
{
|
||||
set_size_columns_to_fit_content(true);
|
||||
set_model(GUI::SortingProxyModel::create(ProcessModel::create()));
|
||||
|
|
|
@ -45,5 +45,5 @@ public:
|
|||
Function<void(pid_t)> on_process_selected;
|
||||
|
||||
private:
|
||||
explicit ProcessTableView(GUI::Widget* parent = nullptr);
|
||||
ProcessTableView();
|
||||
};
|
||||
|
|
|
@ -29,12 +29,11 @@
|
|||
#include <LibGUI/JsonArrayModel.h>
|
||||
#include <LibGUI/TableView.h>
|
||||
|
||||
ProcessUnveiledPathsWidget::ProcessUnveiledPathsWidget(GUI::Widget* parent)
|
||||
: GUI::Widget(parent)
|
||||
ProcessUnveiledPathsWidget::ProcessUnveiledPathsWidget()
|
||||
{
|
||||
set_layout(make<GUI::VerticalBoxLayout>());
|
||||
layout()->set_margins({ 4, 4, 4, 4 });
|
||||
m_table_view = GUI::TableView::construct(this);
|
||||
m_table_view = add<GUI::TableView>();
|
||||
m_table_view->set_size_columns_to_fit_content(true);
|
||||
|
||||
Vector<GUI::JsonArrayModel::FieldSpec> pid_unveil_fields;
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
void set_pid(pid_t);
|
||||
|
||||
private:
|
||||
explicit ProcessUnveiledPathsWidget(GUI::Widget* parent);
|
||||
ProcessUnveiledPathsWidget();
|
||||
|
||||
RefPtr<GUI::TableView> m_table_view;
|
||||
pid_t m_pid { -1 };
|
||||
|
|
|
@ -123,7 +123,7 @@ int main(int argc, char** argv)
|
|||
|
||||
auto tabwidget = keeper->add<GUI::TabWidget>();
|
||||
|
||||
auto process_container_splitter = GUI::VerticalSplitter::construct(nullptr);
|
||||
auto process_container_splitter = GUI::VerticalSplitter::construct();
|
||||
tabwidget->add_widget("Processes", process_container_splitter);
|
||||
|
||||
auto process_table_container = process_container_splitter->add<GUI::Widget>();
|
||||
|
@ -136,7 +136,7 @@ int main(int argc, char** argv)
|
|||
|
||||
tabwidget->add_widget("Devices", build_devices_tab());
|
||||
|
||||
auto network_stats_widget = NetworkStatisticsWidget::construct(nullptr);
|
||||
auto network_stats_widget = NetworkStatisticsWidget::construct();
|
||||
tabwidget->add_widget("Network", network_stats_widget);
|
||||
|
||||
process_table_container->set_layout(make<GUI::VerticalBoxLayout>());
|
||||
|
@ -232,16 +232,16 @@ int main(int argc, char** argv)
|
|||
|
||||
auto process_tab_widget = process_container_splitter->add<GUI::TabWidget>();
|
||||
|
||||
auto memory_map_widget = ProcessMemoryMapWidget::construct(nullptr);
|
||||
auto memory_map_widget = ProcessMemoryMapWidget::construct();
|
||||
process_tab_widget->add_widget("Memory map", memory_map_widget);
|
||||
|
||||
auto open_files_widget = ProcessFileDescriptorMapWidget::construct(nullptr);
|
||||
auto open_files_widget = ProcessFileDescriptorMapWidget::construct();
|
||||
process_tab_widget->add_widget("Open files", open_files_widget);
|
||||
|
||||
auto unveiled_paths_widget = ProcessUnveiledPathsWidget::construct(nullptr);
|
||||
auto unveiled_paths_widget = ProcessUnveiledPathsWidget::construct();
|
||||
process_tab_widget->add_widget("Unveiled paths", unveiled_paths_widget);
|
||||
|
||||
auto stacks_widget = ProcessStacksWidget::construct(nullptr);
|
||||
auto stacks_widget = ProcessStacksWidget::construct();
|
||||
process_tab_widget->add_widget("Stacks", stacks_widget);
|
||||
|
||||
process_table_view->on_process_selected = [&](pid_t pid) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue