From 4ee5c0ce8a8ded1f4aa30212948c3acefb2b6242 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 9 Mar 2015 20:28:04 +0300 Subject: Impliment DebugMessageListener in chat window. --- src/gui/windows/chatwindow.cpp | 7 +++++++ src/gui/windows/chatwindow.h | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src/gui/windows') diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index 4324acca5..dd1c4d5f7 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -2125,3 +2125,10 @@ bool ChatWindow::isTabPresent(const ChatTab *const tab) const { return mChatTabs->isTabPresent(tab); } + +void ChatWindow::debugMessage(const std::string &msg) +{ + logger->log(msg); + if (debugChatTab) + debugChatTab->chatLog(msg, ChatMsgType::BY_SERVER); +} diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h index dd28ca74f..7dbe104c6 100644 --- a/src/gui/windows/chatwindow.h +++ b/src/gui/windows/chatwindow.h @@ -31,6 +31,7 @@ #include "listeners/actionlistener.h" #include "listeners/attributelistener.h" +#include "listeners/debugmessagelistener.h" #include "listeners/keylistener.h" #include "listeners/statlistener.h" @@ -60,7 +61,8 @@ class ChatWindow final : public Window, public KeyListener, public ConfigListener, public AttributeListener, - public StatListener + public StatListener, + public DebugMessageListener { public: /** @@ -361,6 +363,8 @@ class ChatWindow final : public Window, int mRainbowColor; + void debugMessage(const std::string &msg) override final; + private: void fillCommands(); -- cgit v1.2.3-70-g09d2