mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 03:25:07 +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
33
LibGUI/GTableModel.cpp
Normal file
33
LibGUI/GTableModel.cpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
#include <LibGUI/GTableModel.h>
|
||||
#include <LibGUI/GTableView.h>
|
||||
|
||||
GTableModel::GTableModel()
|
||||
{
|
||||
}
|
||||
|
||||
GTableModel::~GTableModel()
|
||||
{
|
||||
}
|
||||
|
||||
void GTableModel::register_view(Badge<GTableView>, GTableView& view)
|
||||
{
|
||||
m_views.set(&view);
|
||||
}
|
||||
|
||||
void GTableModel::unregister_view(Badge<GTableView>, GTableView& view)
|
||||
{
|
||||
m_views.remove(&view);
|
||||
}
|
||||
|
||||
void GTableModel::for_each_view(Function<void(GTableView&)> callback)
|
||||
{
|
||||
for (auto* view : m_views)
|
||||
callback(*view);
|
||||
}
|
||||
|
||||
void GTableModel::did_update()
|
||||
{
|
||||
for_each_view([] (GTableView& view) {
|
||||
view.did_update_model();
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue