diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-10-12 16:21:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-10-12 16:21:11 +0300 |
commit | 2e8e53fb5e3f2ba7d0d4f55b0c6705d12ec8efa9 (patch) | |
tree | 95eabbcc64c3420f3b40110ee84e21bebf9bd557 /src/gui/widgets/tabs/chat/chattab.cpp | |
parent | 1d689e6492993a66935c7b36ff9827f6c170e166 (diff) | |
download | manaplus-2e8e53fb5e3f2ba7d0d4f55b0c6705d12ec8efa9.tar.gz manaplus-2e8e53fb5e3f2ba7d0d4f55b0c6705d12ec8efa9.tar.bz2 manaplus-2e8e53fb5e3f2ba7d0d4f55b0c6705d12ec8efa9.tar.xz manaplus-2e8e53fb5e3f2ba7d0d4f55b0c6705d12ec8efa9.zip |
Add log file name into chattab.
Diffstat (limited to 'src/gui/widgets/tabs/chat/chattab.cpp')
-rw-r--r-- | src/gui/widgets/tabs/chat/chattab.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gui/widgets/tabs/chat/chattab.cpp b/src/gui/widgets/tabs/chat/chattab.cpp index 783df0416..5dc18b329 100644 --- a/src/gui/widgets/tabs/chat/chattab.cpp +++ b/src/gui/widgets/tabs/chat/chattab.cpp @@ -62,12 +62,14 @@ static const unsigned int MAX_WORD_SIZE = 50; ChatTab::ChatTab(const Widget2 *const widget, const std::string &name, const std::string &channel, + const std::string &logName, const ChatTabType::Type &type) : Tab(widget), mTextOutput(new BrowserBox(this, BrowserBox::AUTO_WRAP, true, "browserbox.xml")), mScrollArea(new ScrollArea(this, mTextOutput, false)), mChannelName(channel), + mLogName(logName), mType(type), mAllowHightlight(true), mRemoveNames(false), @@ -461,7 +463,7 @@ bool ChatTab::handleCommands(const std::string &type, const std::string &args) return handleCommand(type, args); } -void ChatTab::saveToLogFile(const std::string &msg) const +void ChatTab::saveToLogFile(std::string msg) const { if (chatLogger) { @@ -469,10 +471,14 @@ void ChatTab::saveToLogFile(const std::string &msg) const { chatLogger->log(msg); } - else if (getType() == ChatTabType::DEBUG - && config.getBoolValue("enableDebugLog")) + else if (getType() == ChatTabType::DEBUG) { - chatLogger->log("#Debug", msg); + if (config.getBoolValue("enableDebugLog")) + chatLogger->log("#Debug", msg); + } + else if (!mLogName.empty()) + { + chatLogger->log(mLogName, msg); } } } |