mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 16:25:08 +00:00
LibGUI: Take ProcessManager's process view and turn it into GTableView.
Make it sufficiently generic that it can be reused for any table data. :^)
This commit is contained in:
parent
b3ae1163ef
commit
dc9f8a9361
11 changed files with 173 additions and 88 deletions
35
Applications/ProcessManager/ProcessTableView.cpp
Normal file
35
Applications/ProcessManager/ProcessTableView.cpp
Normal file
|
@ -0,0 +1,35 @@
|
|||
#include "ProcessTableView.h"
|
||||
#include "ProcessTableModel.h"
|
||||
|
||||
|
||||
ProcessTableView::ProcessTableView(GWidget* parent)
|
||||
: GTableView(parent)
|
||||
{
|
||||
set_model(make<ProcessTableModel>());
|
||||
start_timer(1000);
|
||||
model().update();
|
||||
}
|
||||
|
||||
ProcessTableView::~ProcessTableView()
|
||||
{
|
||||
}
|
||||
|
||||
void ProcessTableView::timer_event(GTimerEvent&)
|
||||
{
|
||||
model().update();
|
||||
}
|
||||
|
||||
pid_t ProcessTableView::selected_pid() const
|
||||
{
|
||||
return model().selected_pid();
|
||||
}
|
||||
|
||||
inline ProcessTableModel& ProcessTableView::model()
|
||||
{
|
||||
return static_cast<ProcessTableModel&>(*GTableView::model());
|
||||
}
|
||||
|
||||
inline const ProcessTableModel& ProcessTableView::model() const
|
||||
{
|
||||
return static_cast<const ProcessTableModel&>(*GTableView::model());
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue