mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:08:13 +00:00
IRCClient: Rename IRCClientWindowFoo => IRCWindowFoo.
This commit is contained in:
parent
5c2d405e1f
commit
fc7f700c20
9 changed files with 59 additions and 59 deletions
60
Applications/IRCClient/IRCWindowListModel.cpp
Normal file
60
Applications/IRCClient/IRCWindowListModel.cpp
Normal file
|
@ -0,0 +1,60 @@
|
|||
#include "IRCWindowListModel.h"
|
||||
#include "IRCWindow.h"
|
||||
#include "IRCClient.h"
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
IRCWindowListModel::IRCWindowListModel(IRCClient& client)
|
||||
: m_client(client)
|
||||
{
|
||||
set_activates_on_selection(true);
|
||||
}
|
||||
|
||||
IRCWindowListModel::~IRCWindowListModel()
|
||||
{
|
||||
}
|
||||
|
||||
int IRCWindowListModel::row_count() const
|
||||
{
|
||||
return m_client.window_count();
|
||||
}
|
||||
|
||||
int IRCWindowListModel::column_count() const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
String IRCWindowListModel::column_name(int column) const
|
||||
{
|
||||
switch (column) {
|
||||
case Column::Name: return "Name";
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
GTableModel::ColumnMetadata IRCWindowListModel::column_metadata(int column) const
|
||||
{
|
||||
switch (column) {
|
||||
case Column::Name: return { 70, TextAlignment::CenterLeft };
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
GVariant IRCWindowListModel::data(const GModelIndex& index, Role) const
|
||||
{
|
||||
switch (index.column()) {
|
||||
case Column::Name: return m_client.window_at(index.row()).name();
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
void IRCWindowListModel::update()
|
||||
{
|
||||
did_update();
|
||||
}
|
||||
|
||||
void IRCWindowListModel::activate(const GModelIndex& index)
|
||||
{
|
||||
if (on_activation)
|
||||
on_activation(m_client.window_at(index.row()));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue