summaryrefslogtreecommitdiff
path: root/Applications/ProcessManager/ProcessFileDescriptorMapWidget.cpp
blob: cf3691661e3defdc38f5879eb798ed46f9e3aafa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "ProcessFileDescriptorMapWidget.h"
#include "ProcessFileDescriptorMapModel.h"
#include <LibGUI/GBoxLayout.h>
#include <LibGUI/GTableView.h>

ProcessFileDescriptorMapWidget::ProcessFileDescriptorMapWidget(GWidget* parent)
    : GWidget(parent)
{
    set_layout(make<GBoxLayout>(Orientation::Vertical));
    layout()->set_margins({ 4, 4, 4, 4 });
    m_table_view = new GTableView(this);
    m_table_view->set_model(adopt(*new ProcessFileDescriptorMapModel));
}

ProcessFileDescriptorMapWidget::~ProcessFileDescriptorMapWidget()
{
}

void ProcessFileDescriptorMapWidget::set_pid(pid_t pid)
{
    if (m_pid == pid)
        return;
    m_pid = pid;
    static_cast<ProcessFileDescriptorMapModel*>(m_table_view->model())->set_pid(pid);
}