summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-30 13:37:31 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-30 13:37:31 +0300
commitdbe40332cd904f8e48504a2e8a3e7f74f4619712 (patch)
tree27dcb74352371cb75ccec81367f4705920132e69
parentdb4d45f08d4cd68ac46ad70930efcb25938faf82 (diff)
downloadplus-dbe40332cd904f8e48504a2e8a3e7f74f4619712.tar.gz
plus-dbe40332cd904f8e48504a2e8a3e7f74f4619712.tar.bz2
plus-dbe40332cd904f8e48504a2e8a3e7f74f4619712.tar.xz
plus-dbe40332cd904f8e48504a2e8a3e7f74f4619712.zip
Add support for logging debug chat tab.
Disabled by default.
-rw-r--r--src/gui/setup_chat.cpp4
-rw-r--r--src/gui/widgets/chattab.cpp14
2 files changed, 16 insertions, 2 deletions
diff --git a/src/gui/setup_chat.cpp b/src/gui/setup_chat.cpp
index a953ab4df..80e166639 100644
--- a/src/gui/setup_chat.cpp
+++ b/src/gui/setup_chat.cpp
@@ -106,6 +106,10 @@ Setup_Chat::Setup_Chat(const Widget2 *const widget) :
"enableChatLog", this, "enableChatLogEvent");
// TRANSLATORS: settings option
+ new SetupItemCheckBox(_("Enable debug chat Log"), "",
+ "enableDebugLog", this, "enableDebugLogEvent");
+
+ // TRANSLATORS: settings option
new SetupItemCheckBox(_("Show chat history"), "",
"showChatHistory", this, "showChatHistoryEvent");
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index 3ab9594fe..41b57c035 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -445,8 +445,18 @@ bool ChatTab::handleCommands(const std::string &type, const std::string &args)
void ChatTab::saveToLogFile(const std::string &msg)
{
- if (getType() == TAB_INPUT && chatLogger)
- chatLogger->log(msg);
+ if (chatLogger)
+ {
+ if (getType() == TAB_INPUT)
+ {
+ chatLogger->log(msg);
+ }
+ else if (getType() == TAB_DEBUG
+ && config.getBoolValue("enableDebugLog"))
+ {
+ chatLogger->log("#Debug", msg);
+ }
+ }
}
int ChatTab::getType() const