summaryrefslogtreecommitdiff
path: root/src/gui/chat.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-03-26 20:33:34 +0200
committerAndrei Karas <akaras@inbox.ru>2011-03-26 20:33:34 +0200
commite187567475275835796e06e0b102f23a18510832 (patch)
tree278f6e568939cfbe5b01decc6b53f7ab27055392 /src/gui/chat.cpp
parentadfacb195ba653b63fec08200d0535604d45e20e (diff)
downloadmanaverse-e187567475275835796e06e0b102f23a18510832.tar.gz
manaverse-e187567475275835796e06e0b102f23a18510832.tar.bz2
manaverse-e187567475275835796e06e0b102f23a18510832.tar.xz
manaverse-e187567475275835796e06e0b102f23a18510832.zip
Save chat tab options between client restarts.
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r--src/gui/chat.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index a72d562c2..e42b4b1bb 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -1344,14 +1344,24 @@ void ChatWindow::loadState()
if (nick.empty())
break;
- addWhisperTab(nick);
+ int flags = serverConfig.getValue(
+ "chatWhisperFlags" + toString(num), 1);
+
+ ChatTab *tab = addWhisperTab(nick);
+ if (tab)
+ {
+ tab->setAllowHighlight(flags & 1);
+ tab->setRemoveNames((flags & 2) / 2);
+ }
serverConfig.deleteKey("chatWhisper" + toString(num));
+ serverConfig.deleteKey("chatWhisperFlags" + toString(num));
num ++;
}
while (num < 50)
{
serverConfig.deleteKey("chatWhisper" + toString(num));
+ serverConfig.deleteKey("chatWhisperFlags" + toString(num));
num ++;
}
}
@@ -1371,7 +1381,11 @@ void ChatWindow::saveState()
continue;
serverConfig.setValue("chatWhisper" + toString(num),
- tab->getNick());
+ tab->getNick());
+
+ serverConfig.setValue("chatWhisperFlags" + toString(num),
+ static_cast<int>(tab->getAllowHighlight())
+ + (2 * static_cast<int>(tab->getRemoveNames())));
num ++;
}
@@ -1379,6 +1393,7 @@ void ChatWindow::saveState()
while (num < 50)
{
serverConfig.deleteKey("chatWhisper" + toString(num));
+ serverConfig.deleteKey("chatWhisperFlags" + toString(num));
num ++;
}
}