From e187567475275835796e06e0b102f23a18510832 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 26 Mar 2011 20:33:34 +0200 Subject: Save chat tab options between client restarts. --- src/gui/chat.cpp | 19 +++++++++++++++++-- 1 file 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(tab->getAllowHighlight()) + + (2 * static_cast(tab->getRemoveNames()))); num ++; } @@ -1379,6 +1393,7 @@ void ChatWindow::saveState() while (num < 50) { serverConfig.deleteKey("chatWhisper" + toString(num)); + serverConfig.deleteKey("chatWhisperFlags" + toString(num)); num ++; } } -- cgit v1.2.3-70-g09d2