mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:07:34 +00:00
IRCClient: Use a model for the window list.
This commit is contained in:
parent
eba5fd3f46
commit
a23dddc56f
7 changed files with 138 additions and 24 deletions
|
@ -9,6 +9,7 @@
|
|||
class IRCChannel;
|
||||
class IRCQuery;
|
||||
class IRCClientWindow;
|
||||
class IRCClientWindowListModel;
|
||||
class GNotifier;
|
||||
|
||||
class IRCClient {
|
||||
|
@ -31,11 +32,19 @@ public:
|
|||
Function<void()> on_disconnect;
|
||||
Function<void(const String& channel)> on_channel_message;
|
||||
Function<void(const String& name)> on_query_message;
|
||||
Function<void(const String& channel)> on_join;
|
||||
Function<void()> on_server_message;
|
||||
|
||||
void register_subwindow(IRCClientWindow&);
|
||||
void unregister_subwindow(IRCClientWindow&);
|
||||
|
||||
IRCClientWindowListModel* client_window_list_model() { return m_client_window_list_model; }
|
||||
const IRCClientWindowListModel* client_window_list_model() const { return m_client_window_list_model; }
|
||||
|
||||
int window_count() const { return m_windows.size(); }
|
||||
const IRCClientWindow& window_at(int index) const { return *m_windows.at(index); }
|
||||
IRCClientWindow& window_at(int index) { return *m_windows.at(index); }
|
||||
|
||||
private:
|
||||
struct Message {
|
||||
String prefix;
|
||||
|
@ -66,7 +75,11 @@ private:
|
|||
HashMap<String, RetainPtr<IRCChannel>> m_channels;
|
||||
HashMap<String, RetainPtr<IRCQuery>> m_queries;
|
||||
|
||||
Vector<IRCClientWindow*> m_windows;
|
||||
|
||||
IRCClientWindow* m_server_subwindow { nullptr };
|
||||
|
||||
IRCClientWindowListModel* m_client_window_list_model { nullptr };
|
||||
|
||||
Retained<IRCLogBuffer> m_log;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue