diff options
author | Andrei Karas <akaras@inbox.ru> | 2010-05-01 21:27:58 +0300 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-05-01 17:06:27 -0600 |
commit | 844e9a7a72faca6a212e788a3adc45e17f41dca6 (patch) | |
tree | f488e4c149687ea3d60f39c042c241df7275b581 /src/gui/widgets/chattab.cpp | |
parent | c22ea2f169f58e765fc699fcd71bfd3a3cd4f859 (diff) | |
download | mana-844e9a7a72faca6a212e788a3adc45e17f41dca6.tar.gz mana-844e9a7a72faca6a212e788a3adc45e17f41dca6.tar.bz2 mana-844e9a7a72faca6a212e788a3adc45e17f41dca6.tar.xz mana-844e9a7a72faca6a212e788a3adc45e17f41dca6.zip |
Add chat logging.
Add option in players setup page.
Add command line option.
Signed-off-by: Jared Adams <jaxad0127@gmail.com>
Diffstat (limited to 'src/gui/widgets/chattab.cpp')
-rw-r--r-- | src/gui/widgets/chattab.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp index 39ea6887..8c300eca 100644 --- a/src/gui/widgets/chattab.cpp +++ b/src/gui/widgets/chattab.cpp @@ -21,6 +21,7 @@ #include "gui/widgets/chattab.h" +#include "chatlog.h" #include "commandhandler.h" #include "configuration.h" #include "localplayer.h" @@ -180,6 +181,9 @@ void ChatTab::chatLog(std::string line, int own, bool ignoreRecord) line = lineColor + timeStr.str() + tmp.nick + tmp.text; + if (config.getValue("enableChatLog", false)) + saveToLogFile(line); + // We look if the Vertical Scroll Bar is set at the max before // adding a row, otherwise the max will always be a row higher // at comparison. @@ -275,6 +279,12 @@ void ChatTab::handleCommand(const std::string &msg) commandHandler->handleCommand(msg, this); } +void ChatTab::saveToLogFile(std::string &msg) +{ + if (chatLogger) + chatLogger->log(msg); +} + void ChatTab::addRow(std::string &line) { std::string::size_type idx = 0; |