Ver Fonte

IRCClient: Rename IRCSubWindow => IRCClientWindow.

Andreas Kling há 6 anos atrás
pai
commit
eba5fd3f46

+ 4 - 4
Applications/IRCClient/IRCAppWindow.cpp

@@ -1,5 +1,5 @@
 #include "IRCAppWindow.h"
-#include "IRCSubWindow.h"
+#include "IRCClientWindow.h"
 #include <LibGUI/GListBox.h>
 #include <LibGUI/GBoxLayout.h>
 
@@ -51,11 +51,11 @@ void IRCAppWindow::setup_widgets()
     m_subwindow_container->set_layout(make<GBoxLayout>(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);
 }

+ 3 - 3
Applications/IRCClient/IRCAppWindow.h

@@ -3,7 +3,7 @@
 #include <LibGUI/GWindow.h>
 #include <LibGUI/GWidget.h>
 #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<IRCSubWindow*> m_subwindows;
+    Vector<IRCClientWindow*> m_subwindows;
 };

+ 7 - 7
Applications/IRCClient/IRCClient.cpp

@@ -2,7 +2,7 @@
 #include "IRCChannel.h"
 #include "IRCQuery.h"
 #include "IRCLogBuffer.h"
-#include "IRCSubWindow.h"
+#include "IRCClientWindow.h"
 #include <LibGUI/GNotifier.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -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;
     }

+ 4 - 4
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<void(const String& name)> on_query_message;
     Function<void()> 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<String, RetainPtr<IRCChannel>> m_channels;
     HashMap<String, RetainPtr<IRCQuery>> m_queries;
 
-    IRCSubWindow* m_server_subwindow { nullptr };
+    IRCClientWindow* m_server_subwindow { nullptr };
 
     Retained<IRCLogBuffer> m_log;
 };

+ 4 - 4
Applications/IRCClient/IRCSubWindow.cpp → Applications/IRCClient/IRCClientWindow.cpp

@@ -1,11 +1,11 @@
-#include "IRCSubWindow.h"
+#include "IRCClientWindow.h"
 #include "IRCClient.h"
 #include "IRCLogBufferModel.h"
 #include <LibGUI/GBoxLayout.h>
 #include <LibGUI/GTableView.h>
 #include <LibGUI/GTextBox.h>
 
-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>((IRCLogBufferModel*)log_buffer.model()));

+ 3 - 3
Applications/IRCClient/IRCSubWindow.h → 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; }

+ 1 - 1
Applications/IRCClient/Makefile

@@ -5,7 +5,7 @@ OBJS = \
     IRCLogBuffer.o \
     IRCLogBufferModel.o \
     IRCAppWindow.o \
-    IRCSubWindow.o \
+    IRCClientWindow.o \
     main.o
 
 APP = IRCClient