diff --git a/Applications/IRCClient/IRCAppWindow.cpp b/Applications/IRCClient/IRCAppWindow.cpp index 1bc2eddadc..ba55d2f326 100644 --- a/Applications/IRCClient/IRCAppWindow.cpp +++ b/Applications/IRCClient/IRCAppWindow.cpp @@ -1,5 +1,5 @@ #include "IRCAppWindow.h" -#include "IRCSubWindow.h" +#include "IRCClientWindow.h" #include #include @@ -51,11 +51,11 @@ void IRCAppWindow::setup_widgets() m_subwindow_container->set_layout(make(Orientation::Vertical)); m_subwindow_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fill); - create_subwindow(IRCSubWindow::Server, "Server"); + create_subwindow(IRCClientWindow::Server, "Server"); } -void IRCAppWindow::create_subwindow(IRCSubWindow::Type type, const String& name) +void IRCAppWindow::create_subwindow(IRCClientWindow::Type type, const String& name) { - auto* subwindow = new IRCSubWindow(m_client, type, name, m_subwindow_container); + auto* subwindow = new IRCClientWindow(m_client, type, name, m_subwindow_container); m_subwindows.append(subwindow); } diff --git a/Applications/IRCClient/IRCAppWindow.h b/Applications/IRCClient/IRCAppWindow.h index 6bbb303047..33b7404659 100644 --- a/Applications/IRCClient/IRCAppWindow.h +++ b/Applications/IRCClient/IRCAppWindow.h @@ -3,7 +3,7 @@ #include #include #include "IRCClient.h" -#include "IRCSubWindow.h" +#include "IRCClientWindow.h" class IRCAppWindow : public GWindow { public: @@ -14,10 +14,10 @@ private: void setup_client(); void setup_widgets(); - void create_subwindow(IRCSubWindow::Type, const String& name); + void create_subwindow(IRCClientWindow::Type, const String& name); IRCClient m_client; GWidget* m_subwindow_container { nullptr }; - Vector m_subwindows; + Vector m_subwindows; }; diff --git a/Applications/IRCClient/IRCClient.cpp b/Applications/IRCClient/IRCClient.cpp index 9090867bbf..d441da15d2 100644 --- a/Applications/IRCClient/IRCClient.cpp +++ b/Applications/IRCClient/IRCClient.cpp @@ -2,7 +2,7 @@ #include "IRCChannel.h" #include "IRCQuery.h" #include "IRCLogBuffer.h" -#include "IRCSubWindow.h" +#include "IRCClientWindow.h" #include #include #include @@ -346,28 +346,28 @@ void IRCClient::handle_namreply(const Message& msg) channel.dump(); } -void IRCClient::register_subwindow(IRCSubWindow& subwindow) +void IRCClient::register_subwindow(IRCClientWindow& subwindow) { - if (subwindow.type() == IRCSubWindow::Server) { + if (subwindow.type() == IRCClientWindow::Server) { m_server_subwindow = &subwindow; subwindow.set_log_buffer(*m_log); return; } - if (subwindow.type() == IRCSubWindow::Channel) { + if (subwindow.type() == IRCClientWindow::Channel) { auto it = m_channels.find(subwindow.name()); ASSERT(it != m_channels.end()); auto& channel = *(*it).value; subwindow.set_log_buffer(channel.log()); return; } - if (subwindow.type() == IRCSubWindow::Query) { + if (subwindow.type() == IRCClientWindow::Query) { subwindow.set_log_buffer(ensure_query(subwindow.name()).log()); } } -void IRCClient::unregister_subwindow(IRCSubWindow& subwindow) +void IRCClient::unregister_subwindow(IRCClientWindow& subwindow) { - if (subwindow.type() == IRCSubWindow::Server) { + if (subwindow.type() == IRCClientWindow::Server) { m_server_subwindow = &subwindow; return; } diff --git a/Applications/IRCClient/IRCClient.h b/Applications/IRCClient/IRCClient.h index 71ea4e8dd6..028260ee20 100644 --- a/Applications/IRCClient/IRCClient.h +++ b/Applications/IRCClient/IRCClient.h @@ -8,7 +8,7 @@ class IRCChannel; class IRCQuery; -class IRCSubWindow; +class IRCClientWindow; class GNotifier; class IRCClient { @@ -33,8 +33,8 @@ public: Function on_query_message; Function on_server_message; - void register_subwindow(IRCSubWindow&); - void unregister_subwindow(IRCSubWindow&); + void register_subwindow(IRCClientWindow&); + void unregister_subwindow(IRCClientWindow&); private: struct Message { @@ -66,7 +66,7 @@ private: HashMap> m_channels; HashMap> m_queries; - IRCSubWindow* m_server_subwindow { nullptr }; + IRCClientWindow* m_server_subwindow { nullptr }; Retained m_log; }; diff --git a/Applications/IRCClient/IRCSubWindow.cpp b/Applications/IRCClient/IRCClientWindow.cpp similarity index 72% rename from Applications/IRCClient/IRCSubWindow.cpp rename to Applications/IRCClient/IRCClientWindow.cpp index e242a19fa9..172251dd1d 100644 --- a/Applications/IRCClient/IRCSubWindow.cpp +++ b/Applications/IRCClient/IRCClientWindow.cpp @@ -1,11 +1,11 @@ -#include "IRCSubWindow.h" +#include "IRCClientWindow.h" #include "IRCClient.h" #include "IRCLogBufferModel.h" #include #include #include -IRCSubWindow::IRCSubWindow(IRCClient& client, Type type, const String& name, GWidget* parent) +IRCClientWindow::IRCClientWindow(IRCClient& client, Type type, const String& name, GWidget* parent) : GWidget(parent) , m_client(client) , m_type(type) @@ -18,12 +18,12 @@ IRCSubWindow::IRCSubWindow(IRCClient& client, Type type, const String& name, GWi m_client.register_subwindow(*this); } -IRCSubWindow::~IRCSubWindow() +IRCClientWindow::~IRCClientWindow() { m_client.unregister_subwindow(*this); } -void IRCSubWindow::set_log_buffer(const IRCLogBuffer& log_buffer) +void IRCClientWindow::set_log_buffer(const IRCLogBuffer& log_buffer) { m_log_buffer = &log_buffer; m_table_view->set_model(OwnPtr((IRCLogBufferModel*)log_buffer.model())); diff --git a/Applications/IRCClient/IRCSubWindow.h b/Applications/IRCClient/IRCClientWindow.h similarity index 75% rename from Applications/IRCClient/IRCSubWindow.h rename to Applications/IRCClient/IRCClientWindow.h index 76e64db9a9..a8ef445617 100644 --- a/Applications/IRCClient/IRCSubWindow.h +++ b/Applications/IRCClient/IRCClientWindow.h @@ -6,7 +6,7 @@ class IRCClient; class IRCLogBuffer; class GTableView; -class IRCSubWindow : public GWidget { +class IRCClientWindow : public GWidget { public: enum Type { Server, @@ -14,8 +14,8 @@ public: Query, }; - explicit IRCSubWindow(IRCClient&, Type, const String& name, GWidget* parent); - virtual ~IRCSubWindow() override; + explicit IRCClientWindow(IRCClient&, Type, const String& name, GWidget* parent); + virtual ~IRCClientWindow() override; String name() const { return m_name; } void set_name(const String& name) { m_name = name; } diff --git a/Applications/IRCClient/Makefile b/Applications/IRCClient/Makefile index e7eb5ffef8..29e0ba1573 100644 --- a/Applications/IRCClient/Makefile +++ b/Applications/IRCClient/Makefile @@ -5,7 +5,7 @@ OBJS = \ IRCLogBuffer.o \ IRCLogBufferModel.o \ IRCAppWindow.o \ - IRCSubWindow.o \ + IRCClientWindow.o \ main.o APP = IRCClient