diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-03-26 20:33:34 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-03-26 20:33:34 +0200 |
commit | e187567475275835796e06e0b102f23a18510832 (patch) | |
tree | 278f6e568939cfbe5b01decc6b53f7ab27055392 | |
parent | adfacb195ba653b63fec08200d0535604d45e20e (diff) | |
download | mv-e187567475275835796e06e0b102f23a18510832.tar.gz mv-e187567475275835796e06e0b102f23a18510832.tar.bz2 mv-e187567475275835796e06e0b102f23a18510832.tar.xz mv-e187567475275835796e06e0b102f23a18510832.zip |
Save chat tab options between client restarts.
-rw-r--r-- | src/gui/chat.cpp | 19 |
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 ++; } } |